Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ tags
.cproject
.project
obj
zookeeper-client/zookeeper-client-c/core.*
zookeeper-client/zookeeper-client-c/TEST-*.txt
zookeeper-client/zookeeper-client-c/*.la
zookeeper-client/zookeeper-client-c/*.lo
zookeeper-client/zookeeper-client-c/*.o
zookeeper-client/zookeeper-client-c/generated/
zookeeper-server/src/main/resources/lib/ant-eclipse-*
zookeeper-server/src/main/resources/lib/ivy-*
zookeeper-client/zookeeper-client-c/Makefile.in
zookeeper-client/zookeeper-client-c/aclocal.m4
zookeeper-client/zookeeper-client-c/autom4te.cache/
Expand All @@ -88,7 +80,12 @@ zookeeper-client/zookeeper-client-c/depcomp
zookeeper-client/zookeeper-client-c/install-sh
zookeeper-client/zookeeper-client-c/ltmain.sh
zookeeper-client/zookeeper-client-c/missing
zookeeper-server/src/test/resources/
zookeeper-client/zookeeper-client-c/TEST-*.txt
zookeeper-client/zookeeper-client-c/generated/
zookeeper-server/src/main/resources/lib/ant-eclipse-*
zookeeper-server/src/main/resources/lib/ivy-*
zookeeper-server/src/main/java/org/apache/zookeeper/version/Info.java
zookeeper-server/src/main/java/org/apache/zookeeper/version/VersionInfoMain.java

# Python
*.py[cod]
89 changes: 89 additions & 0 deletions README_packaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# README file for Packaging Notes

The ZooKeeper project publishes releases as tarballs. For ZooKeeper packages
specific to your OS (such as rpm and deb), consider using Apache Bigtop:

http://bigtop.apache.org/


## Requirements

- ant (recommended version 1.9.4 or later for concurrent JUnit test execution) or maven to build the java code
- gcc, cppunit and python-setuptools are required to build C and python bindings.

On RHEL machine:

```
yum install cppunit
yum install python-setuptools
```

On Ubuntu:

```
apt-get install cppunit
apt-get install python-setuptools
```


## Package build command (using maven)

Commands to clean everything and build the tarball package without executing the tests: `mvn clean install -DskipTests`


`zookeeper-assembly/target/apache-zookeeper-<version>-bin.tar.gz` tarball file structure layout:

- `/bin` - User executables
- `/conf` - Configuration files
- `/lib` - ZooKeeper JAR files and all the required java library dependencies
- `/docs` - Documents

Beside the binary tarball, you can find the whole original source project packaged into:
`zookeeper-assembly/target/apache-zookeeper-<version>.tar.gz`


### Building the C client (using maven)

To also build the C client, you need to activate the `full-build` profile:

```
mvn clean -Pfull-build
mvn install -Pfull-build -DskipTests
```

Optional parameters you might consider when using maven:
- `-Pfull-build` - activates the full-build profile, causing the C client to be built
- `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build
- `-Pc-test-coverage` - activates the test coverage calculation during the execution of C client tests

Please note: if you don't provide the `-Pfull-build` parameter, then the C client will not be built, the C client tests
will not be executed and the previous C client builds will no be cleaned up (e.g. with simply using `mvn clean`).

The compiled C client can be found here:
- `zookeeper-client/zookeeper-client-c/target/c/bin` - User executable
- `zookeeper-client/zookeeper-client-c/target/c/lib` - Native libraries
- `zookeeper-client/zookeeper-client-c/target/c/include/zookeeper` - Native library headers


## Package build command (using ant)

**Command to build tarball package:** `ant tar`

`zookeeper-<version>.tar.gz` tarball file structure layout:

- `/bin` - User executable
- `/sbin` - System executable
- `/libexec` - Configuration boot trap script
- `/lib` - Library dependencies
- `/docs` - Documents
- `/share/zookeeper` - Project files


**Command to build tarball package with native components:** `ant package-native tar`

`zookeeper-<version>-lib.tar.gz` tarball file structure layout:

- `/bin` - User executable
- `/lib` - Native libraries
- `/include/zookeeper` - Native library headers

45 changes: 0 additions & 45 deletions README_packaging.txt

This file was deleted.

6 changes: 3 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
<copy todir="${dist.dir}">
<fileset file="CHANGES.txt"/>
<fileset file="README.md"/>
<fileset file="README_packaging.txt"/>
<fileset file="README_packaging.md"/>
<fileset file="build.xml"/>
<fileset file="ivy.xml"/>
<fileset file="ivysettings.xml"/>
Expand Down Expand Up @@ -1004,7 +1004,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
<copy todir="${dist.dir}">
<fileset file="CHANGES.txt"/>
<fileset file="README.md"/>
<fileset file="README_packaging.txt"/>
<fileset file="README_packaging.md"/>
<fileset file="build.xml"/>
<fileset file="ivy.xml"/>
<fileset file="ivysettings.xml"/>
Expand Down Expand Up @@ -1760,7 +1760,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
<exclude name="**/wrappers*.opt"/>
<exclude name="CHANGES.txt"/>
<exclude name="**/README.md"/>
<exclude name="README_packaging.txt"/>
<exclude name="README_packaging.md"/>
<exclude name="**/TODO"/>
<exclude name="**/VERSION"/>
<exclude name="**/ChangeLog"/>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@
<exclude>conf/configuration.xsl</exclude>
<exclude>.travis.yml</exclude>
<exclude>excludeFindBugsFilter.xml</exclude>
<exclude>README_packaging.txt</exclude>
<exclude>README_packaging.md</exclude>
<exclude>src/main/resources/markdown/skin/*</exclude>
<exclude>src/main/resources/markdown/html/*</exclude>
<exclude>src/main/resources/markdown/images/*</exclude>
Expand Down
2 changes: 1 addition & 1 deletion zookeeper-assembly/src/main/assembly/components.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<include>NOTICE.txt</include>
<include>LICENSE.txt</include>
<include>README.md</include>
<include>README_packaging.txt</include>
<include>README_packaging.md</include>
</includes>
<fileMode>${rw.file.permission}</fileMode>
</fileSet>
Expand Down
138 changes: 77 additions & 61 deletions zookeeper-client/zookeeper-client-c/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,54 +33,33 @@
<name>Apache ZooKeeper - Client - C</name>
<description>ZooKeeper c client</description>

<profiles>
<profile>
<id>c-test-coverage</id>
<properties>
<c-test-coverage-arg>--enable-gcov</c-test-coverage-arg>
</properties>
</profile>
<profile>
<id>no-c-test-coverage</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<c-test-coverage-arg> </c-test-coverage-arg>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<mkdir dir="target/c" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>test-cppunit</id>
<phase>test</phase>
<configuration>
<!-- do not run cpp tests if tests are globally skipped -->
<skip>${skipTests}</skip>
<tasks>
<exec dir="${basedir}/target/c" executable="make" failonerror="true">
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
<env key="PATH" path="${env.PATH};${basedir};" />
<env key="CALLER" value="ANT" />
<env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
<env key="base_dir" value="${basedir}/../.." />
<arg line="clean check" />
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>autoreconf</id>
<phase>test-compile</phase>
<phase>process-sources</phase>
<goals>
<goal>exec</goal>
</goals>
Expand All @@ -97,7 +76,7 @@
</execution>
<execution>
<id>configure</id>
<phase>test-compile</phase>
<phase>process-sources</phase>
<goals>
<goal>exec</goal>
</goals>
Expand All @@ -110,34 +89,71 @@
</environmentVariables>
<arguments>
<argument>--prefix=${project.build.directory}/c</argument>
<argument>--enable-gcov</argument>
<argument>${c-test-coverage-arg}</argument>
</arguments>
</configuration>
</execution>
<!--execution> TODO: Why is this not working?!
<id>test-cppunit</id>
<phase>test</phase>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<mkdir dir="target/c" />
</tasks>
</configuration>
<goals>
<goal>exec</goal>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>build-c-client</id>
<phase>compile</phase>
<configuration>
<workingDirectory>${project.build.directory}/c</workingDirectory>
<executable>make</executable>
<environmentVariables>
<LD_LIBRARY_PATH>${env.LD_LIBRARY_PATH};/usr/lib</LD_LIBRARY_PATH>
<PATH>${env.PATH};${project.basedir};</PATH>
<CALLER>ANT</CALLER>
<CLOVER_HOME></CLOVER_HOME>
<base_dir>${project.basedir}/../..</base_dir>
</environmentVariables>
<arguments>
<argument>clean check</argument>
</arguments>
<tasks>
<exec dir="${basedir}/target/c" executable="make" failonerror="true">
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
<env key="PATH" path="${env.PATH};${basedir};" />
<env key="CALLER" value="ANT" />
<env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
<env key="base_dir" value="${basedir}/../.." />
<arg line="clean install" />
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>test-cppunit</id>
<phase>test</phase>
<configuration>
<!-- do not run cpp tests if tests are globally skipped -->
<skip>${skipTests}</skip>
<tasks>
<exec dir="${basedir}/target/c" executable="make" failonerror="true">
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
<env key="PATH" path="${env.PATH};${basedir};" />
<env key="CALLER" value="ANT" />
<env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
<env key="base_dir" value="${basedir}/../.." />
<arg line="check" />
</exec>
</tasks>
</configuration>
</execution-->
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
</project>