Skip to content

Commit

Permalink
Merge remote-tracking branch 'apache/master' into ZOOKEEPER-3188
Browse files Browse the repository at this point in the history
  • Loading branch information
Mate Szalay-Beko committed Nov 2, 2019
2 parents 2eedf26 + 99be7de commit 6f2ab75
Show file tree
Hide file tree
Showing 167 changed files with 1,916 additions and 1,383 deletions.
15 changes: 6 additions & 9 deletions .gitignore
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]
90 changes: 90 additions & 0 deletions README_packaging.md
@@ -0,0 +1,90 @@
# 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

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.

## 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
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
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
27 changes: 27 additions & 0 deletions zookeeper-assembly/pom.xml
Expand Up @@ -33,9 +33,20 @@
<name>Apache ZooKeeper - Assembly</name>
<description>ZooKeeper Assembly</description>

<profiles>
<profile>
<id>full-build</id>
<properties>
<skip.lib.artifact>false</skip.lib.artifact>
</properties>
</profile>
</profiles>


<properties>
<rw.file.permission>0644</rw.file.permission>
<rwx.file.permission>0755</rwx.file.permission>
<skip.lib.artifact>true</skip.lib.artifact>
</properties>

<dependencies>
Expand Down Expand Up @@ -143,6 +154,22 @@
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
</execution>
<execution>
<id>lib-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.basedir}/src/main/assembly/lib-package.xml</descriptor>
</descriptors>
<finalName>apache-zookeeper-${project.version}-lib</finalName>
<appendAssemblyId>false</appendAssemblyId>
<tarLongFileMode>posix</tarLongFileMode>
<skipAssembly>${skip.lib.artifact}</skipAssembly>
</configuration>
</execution>
</executions>
</plugin>

Expand Down
2 changes: 1 addition & 1 deletion zookeeper-assembly/src/main/assembly/components.xml
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
63 changes: 63 additions & 0 deletions zookeeper-assembly/src/main/assembly/lib-package.xml
@@ -0,0 +1,63 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<!--
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<id>lib-package</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>

<fileSets>
<fileSet>
<!-- ZooKeeper C client lib and include files -->
<directory>${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c</directory>
<outputDirectory>usr</outputDirectory>
<includes>
<include>include/**/*</include>
<include>lib/*</include>
</includes>
<fileMode>${rw.file.permission}</fileMode>
<directoryMode>${rwx.file.permission}</directoryMode>
</fileSet>
<fileSet>
<!-- ZooKeeper C client binaries-->
<directory>${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c</directory>
<outputDirectory>usr</outputDirectory>
<includes>
<include>bin/*</include>
</includes>
<fileMode>${rwx.file.permission}</fileMode>
<directoryMode>${rwx.file.permission}</directoryMode>
</fileSet>
<fileSet>
<!-- ZooKeeper license -->
<directory>${project.basedir}/..</directory>
<includes>
<include>LICENSE.txt</include>
</includes>
<fileMode>${rw.file.permission}</fileMode>
<directoryMode>${rwx.file.permission}</directoryMode>
</fileSet>

</fileSets>

</assembly>

0 comments on commit 6f2ab75

Please sign in to comment.