|
| 1 | +# README file for Packaging Notes |
| 2 | + |
| 3 | +The ZooKeeper project publishes releases as tarballs. For ZooKeeper packages |
| 4 | +specific to your OS (such as rpm and deb), consider using Apache Bigtop: |
| 5 | + |
| 6 | +http://bigtop.apache.org/ |
| 7 | + |
| 8 | + |
| 9 | +## Requirements |
| 10 | + |
| 11 | +- ant (recommended version 1.9.4 or later for concurrent JUnit test execution) or maven to build the java code |
| 12 | +- gcc, cppunit and python-setuptools are required to build C and python bindings. |
| 13 | + |
| 14 | +On RHEL machine: |
| 15 | + |
| 16 | +``` |
| 17 | +yum install cppunit |
| 18 | +yum install python-setuptools |
| 19 | +``` |
| 20 | + |
| 21 | +On Ubuntu: |
| 22 | + |
| 23 | +``` |
| 24 | +apt-get install cppunit |
| 25 | +apt-get install python-setuptools |
| 26 | +``` |
| 27 | + |
| 28 | + |
| 29 | +## Package build command (using maven) |
| 30 | + |
| 31 | +Commands to clean everything and build the tarball package without executing the tests: `mvn clean install -DskipTests` |
| 32 | + |
| 33 | + |
| 34 | +`zookeeper-assembly/target/apache-zookeeper-<version>-bin.tar.gz` tarball file structure layout: |
| 35 | + |
| 36 | +- `/bin` - User executables |
| 37 | +- `/conf` - Configuration files |
| 38 | +- `/lib` - ZooKeeper JAR files and all the required java library dependencies |
| 39 | +- `/docs` - Documents |
| 40 | + |
| 41 | +Beside the binary tarball, you can find the whole original source project packaged into: |
| 42 | +`zookeeper-assembly/target/apache-zookeeper-<version>.tar.gz` |
| 43 | + |
| 44 | + |
| 45 | +### Building the C client (using maven) |
| 46 | + |
| 47 | +To also build the C client, you need to activate the `full-build` profile: |
| 48 | + |
| 49 | +``` |
| 50 | +mvn clean -Pfull-build |
| 51 | +mvn install -Pfull-build -DskipTests |
| 52 | +``` |
| 53 | + |
| 54 | +Optional parameters you might consider when using maven: |
| 55 | +- `-Pfull-build` - activates the full-build profile, causing the C client to be built |
| 56 | +- `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build |
| 57 | +- `-Pc-test-coverage` - activates the test coverage calculation during the execution of C client tests |
| 58 | + |
| 59 | +Please note: if you don't provide the `-Pfull-build` parameter, then the C client will not be built, the C client tests |
| 60 | +will not be executed and the previous C client builds will no be cleaned up (e.g. with simply using `mvn clean`). |
| 61 | + |
| 62 | +The compiled C client can be found here: |
| 63 | +- `zookeeper-client/zookeeper-client-c/target/c/bin` - User executable |
| 64 | +- `zookeeper-client/zookeeper-client-c/target/c/lib` - Native libraries |
| 65 | +- `zookeeper-client/zookeeper-client-c/target/c/include/zookeeper` - Native library headers |
| 66 | + |
| 67 | +The same folders gets archived to the `zookeeper-assembly/target/apache-zookeeper-<version>-lib.tar.gz` file, assuming you activated the `full-build` maven profile. |
| 68 | + |
| 69 | +## Package build command (using ant) |
| 70 | + |
| 71 | +**Command to build tarball package:** `ant tar` |
| 72 | + |
| 73 | +`zookeeper-<version>.tar.gz` tarball file structure layout: |
| 74 | + |
| 75 | +- `/bin` - User executable |
| 76 | +- `/sbin` - System executable |
| 77 | +- `/libexec` - Configuration boot trap script |
| 78 | +- `/lib` - Library dependencies |
| 79 | +- `/docs` - Documents |
| 80 | +- `/share/zookeeper` - Project files |
| 81 | + |
| 82 | + |
| 83 | +**Command to build tarball package with native components:** `ant package-native tar` |
| 84 | + |
| 85 | +`zookeeper-<version>-lib.tar.gz` tarball file structure layout: |
| 86 | + |
| 87 | +- `/bin` - User executable |
| 88 | +- `/lib` - Native libraries |
| 89 | +- `/include/zookeeper` - Native library headers |
| 90 | + |
0 commit comments