diff --git a/.gitignore b/.gitignore index c3a688e159c..f8b39ded50d 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ @@ -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] diff --git a/README_packaging.md b/README_packaging.md new file mode 100644 index 00000000000..fe731a7ff03 --- /dev/null +++ b/README_packaging.md @@ -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--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-.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-.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--lib.tar.gz` tarball file structure layout: + +- `/bin` - User executable +- `/lib` - Native libraries +- `/include/zookeeper` - Native library headers + diff --git a/README_packaging.txt b/README_packaging.txt deleted file mode 100644 index 9776f74ca90..00000000000 --- a/README_packaging.txt +++ /dev/null @@ -1,45 +0,0 @@ -README file for Packaging Notes - -Requirement ------------ - -ant (recommended version 1.9.4 or later for concurrent JUnit test execution) -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 ---------------------- - -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/ - -Command to build tarball package: ant tar - -zookeeper-.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--lib.tar.gz tarball file structure layout - - /bin - User executable - /lib - Native libraries - /include/zookeeper - Native library headers diff --git a/build.xml b/build.xml index b965084f008..ce9436100c7 100644 --- a/build.xml +++ b/build.xml @@ -875,7 +875,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - + @@ -1004,7 +1004,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - + @@ -1760,7 +1760,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - + diff --git a/pom.xml b/pom.xml index 01c38115283..34abff47e20 100755 --- a/pom.xml +++ b/pom.xml @@ -789,7 +789,7 @@ conf/configuration.xsl .travis.yml excludeFindBugsFilter.xml - README_packaging.txt + README_packaging.md src/main/resources/markdown/skin/* src/main/resources/markdown/html/* src/main/resources/markdown/images/* diff --git a/zookeeper-assembly/src/main/assembly/components.xml b/zookeeper-assembly/src/main/assembly/components.xml index 2510db1ba85..e0df12bec16 100644 --- a/zookeeper-assembly/src/main/assembly/components.xml +++ b/zookeeper-assembly/src/main/assembly/components.xml @@ -29,7 +29,7 @@ NOTICE.txt LICENSE.txt README.md - README_packaging.txt + README_packaging.md ${rw.file.permission} diff --git a/zookeeper-client/zookeeper-client-c/pom.xml b/zookeeper-client/zookeeper-client-c/pom.xml index 82948105d99..e3703f1f85d 100755 --- a/zookeeper-client/zookeeper-client-c/pom.xml +++ b/zookeeper-client/zookeeper-client-c/pom.xml @@ -33,54 +33,33 @@ Apache ZooKeeper - Client - C ZooKeeper c client + + + c-test-coverage + + --enable-gcov + + + + no-c-test-coverage + + true + + + + + + + - - org.apache.maven.plugins - maven-antrun-plugin - - - generate-sources - generate-sources - - - - - - - run - - - - test-cppunit - test - - - ${skipTests} - - - - - - - - - - - - - run - - - - - + org.codehaus.mojo exec-maven-plugin autoreconf - test-compile + process-sources exec @@ -97,7 +76,7 @@ configure - test-compile + process-sources exec @@ -110,34 +89,71 @@ --prefix=${project.build.directory}/c - --enable-gcov + ${c-test-coverage-arg} - + ${skipTests} + + + + + + + + + + - + + run + + - \ No newline at end of file +