Skip to content

Commit 6f37b66

Browse files
symatMate Szalay-Beko
authored andcommitted
Merge remote-tracking branch 'apache/master' into HEAD
2 parents 9809143 + c9eeeda commit 6f37b66

173 files changed

Lines changed: 1833 additions & 1398 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,11 @@ tags
6868
.cproject
6969
.project
7070
obj
71-
zookeeper-client/zookeeper-client-c/core.*
72-
zookeeper-client/zookeeper-client-c/TEST-*.txt
73-
zookeeper-client/zookeeper-client-c/*.la
74-
zookeeper-client/zookeeper-client-c/*.lo
75-
zookeeper-client/zookeeper-client-c/*.o
76-
zookeeper-client/zookeeper-client-c/generated/
7771
zookeeper-server/src/main/resources/lib/ant-eclipse-*
7872
zookeeper-server/src/main/resources/lib/ivy-*
73+
zookeeper-server/src/main/java/org/apache/zookeeper/version/Info.java
74+
zookeeper-server/src/main/java/org/apache/zookeeper/version/VersionInfoMain.java
75+
zookeeper-server/src/test/resources/
7976
zookeeper-client/zookeeper-client-c/Makefile.in
8077
zookeeper-client/zookeeper-client-c/aclocal.m4
8178
zookeeper-client/zookeeper-client-c/autom4te.cache/
@@ -88,7 +85,6 @@ zookeeper-client/zookeeper-client-c/depcomp
8885
zookeeper-client/zookeeper-client-c/install-sh
8986
zookeeper-client/zookeeper-client-c/ltmain.sh
9087
zookeeper-client/zookeeper-client-c/missing
91-
zookeeper-server/src/test/resources/
9288
zookeeper-client/zookeeper-client-c/.deps/
9389
zookeeper-client/zookeeper-client-c/.libs/
9490
zookeeper-client/zookeeper-client-c/Makefile
@@ -100,6 +96,12 @@ zookeeper-client/zookeeper-client-c/libtool
10096
zookeeper-client/zookeeper-client-c/load_gen
10197
zookeeper-client/zookeeper-client-c/stamp-h1
10298
zookeeper-client/zookeeper-client-c/build
99+
zookeeper-client/zookeeper-client-c/core.*
100+
zookeeper-client/zookeeper-client-c/TEST-*.txt
101+
zookeeper-client/zookeeper-client-c/*.la
102+
zookeeper-client/zookeeper-client-c/*.lo
103+
zookeeper-client/zookeeper-client-c/*.o
104+
zookeeper-client/zookeeper-client-c/generated/
103105

104106
# Python
105107
*.py[cod]

README_packaging.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
68+
## Package build command (using ant)
69+
70+
**Command to build tarball package:** `ant tar`
71+
72+
`zookeeper-<version>.tar.gz` tarball file structure layout:
73+
74+
- `/bin` - User executable
75+
- `/sbin` - System executable
76+
- `/libexec` - Configuration boot trap script
77+
- `/lib` - Library dependencies
78+
- `/docs` - Documents
79+
- `/share/zookeeper` - Project files
80+
81+
82+
**Command to build tarball package with native components:** `ant package-native tar`
83+
84+
`zookeeper-<version>-lib.tar.gz` tarball file structure layout:
85+
86+
- `/bin` - User executable
87+
- `/lib` - Native libraries
88+
- `/include/zookeeper` - Native library headers
89+

README_packaging.txt

Lines changed: 0 additions & 45 deletions
This file was deleted.

build.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
875875
<copy todir="${dist.dir}">
876876
<fileset file="CHANGES.txt"/>
877877
<fileset file="README.md"/>
878-
<fileset file="README_packaging.txt"/>
878+
<fileset file="README_packaging.md"/>
879879
<fileset file="build.xml"/>
880880
<fileset file="ivy.xml"/>
881881
<fileset file="ivysettings.xml"/>
@@ -1004,7 +1004,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
10041004
<copy todir="${dist.dir}">
10051005
<fileset file="CHANGES.txt"/>
10061006
<fileset file="README.md"/>
1007-
<fileset file="README_packaging.txt"/>
1007+
<fileset file="README_packaging.md"/>
10081008
<fileset file="build.xml"/>
10091009
<fileset file="ivy.xml"/>
10101010
<fileset file="ivysettings.xml"/>
@@ -1760,7 +1760,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
17601760
<exclude name="**/wrappers*.opt"/>
17611761
<exclude name="CHANGES.txt"/>
17621762
<exclude name="**/README.md"/>
1763-
<exclude name="README_packaging.txt"/>
1763+
<exclude name="README_packaging.md"/>
17641764
<exclude name="**/TODO"/>
17651765
<exclude name="**/VERSION"/>
17661766
<exclude name="**/ChangeLog"/>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@
789789
<exclude>conf/configuration.xsl</exclude>
790790
<exclude>.travis.yml</exclude>
791791
<exclude>excludeFindBugsFilter.xml</exclude>
792-
<exclude>README_packaging.txt</exclude>
792+
<exclude>README_packaging.md</exclude>
793793
<exclude>src/main/resources/markdown/skin/*</exclude>
794794
<exclude>src/main/resources/markdown/html/*</exclude>
795795
<exclude>src/main/resources/markdown/images/*</exclude>

zookeeper-assembly/src/main/assembly/components.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<include>NOTICE.txt</include>
3030
<include>LICENSE.txt</include>
3131
<include>README.md</include>
32-
<include>README_packaging.txt</include>
32+
<include>README_packaging.md</include>
3333
</includes>
3434
<fileMode>${rw.file.permission}</fileMode>
3535
</fileSet>

zookeeper-client/zookeeper-client-c/pom.xml

Lines changed: 76 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -33,54 +33,33 @@
3333
<name>Apache ZooKeeper - Client - C</name>
3434
<description>ZooKeeper c client</description>
3535

36+
<profiles>
37+
<profile>
38+
<id>c-test-coverage</id>
39+
<properties>
40+
<c-test-coverage-arg>--enable-gcov</c-test-coverage-arg>
41+
</properties>
42+
</profile>
43+
<profile>
44+
<id>no-c-test-coverage</id>
45+
<activation>
46+
<activeByDefault>true</activeByDefault>
47+
</activation>
48+
<properties>
49+
<c-test-coverage-arg> </c-test-coverage-arg>
50+
</properties>
51+
</profile>
52+
</profiles>
53+
3654
<build>
3755
<plugins>
38-
<plugin>
39-
<groupId>org.apache.maven.plugins</groupId>
40-
<artifactId>maven-antrun-plugin</artifactId>
41-
<executions>
42-
<execution>
43-
<id>generate-sources</id>
44-
<phase>generate-sources</phase>
45-
<configuration>
46-
<tasks>
47-
<mkdir dir="target/c" />
48-
</tasks>
49-
</configuration>
50-
<goals>
51-
<goal>run</goal>
52-
</goals>
53-
</execution>
54-
<execution>
55-
<id>test-cppunit</id>
56-
<phase>test</phase>
57-
<configuration>
58-
<!-- do not run cpp tests if tests are globally skipped -->
59-
<skip>${skipTests}</skip>
60-
<tasks>
61-
<exec dir="${basedir}/target/c" executable="make" failonerror="true">
62-
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
63-
<env key="PATH" path="${env.PATH};${basedir};" />
64-
<env key="CALLER" value="ANT" />
65-
<env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
66-
<env key="base_dir" value="${basedir}/../.." />
67-
<arg line="clean check" />
68-
</exec>
69-
</tasks>
70-
</configuration>
71-
<goals>
72-
<goal>run</goal>
73-
</goals>
74-
</execution>
75-
</executions>
76-
</plugin>
77-
<plugin>
56+
<plugin>
7857
<groupId>org.codehaus.mojo</groupId>
7958
<artifactId>exec-maven-plugin</artifactId>
8059
<executions>
8160
<execution>
8261
<id>autoreconf</id>
83-
<phase>test-compile</phase>
62+
<phase>process-sources</phase>
8463
<goals>
8564
<goal>exec</goal>
8665
</goals>
@@ -97,7 +76,7 @@
9776
</execution>
9877
<execution>
9978
<id>configure</id>
100-
<phase>test-compile</phase>
79+
<phase>process-sources</phase>
10180
<goals>
10281
<goal>exec</goal>
10382
</goals>
@@ -111,31 +90,68 @@
11190
<arguments>
11291
<argument>--with-openssl=/usr/include/openssl/</argument>
11392
<argument>--prefix=${project.build.directory}/c</argument>
114-
<argument>--enable-gcov</argument>
93+
<argument>${c-test-coverage-arg}</argument>
11594
</arguments>
11695
</configuration>
11796
</execution>
118-
<!--execution> TODO: Why is this not working?!
119-
<id>test-cppunit</id>
120-
<phase>test</phase>
97+
</executions>
98+
</plugin>
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-antrun-plugin</artifactId>
102+
<executions>
103+
<execution>
104+
<id>generate-sources</id>
105+
<phase>generate-sources</phase>
106+
<configuration>
107+
<tasks>
108+
<mkdir dir="target/c" />
109+
</tasks>
110+
</configuration>
121111
<goals>
122-
<goal>exec</goal>
112+
<goal>run</goal>
123113
</goals>
114+
</execution>
115+
<execution>
116+
<id>build-c-client</id>
117+
<phase>compile</phase>
124118
<configuration>
125-
<workingDirectory>${project.build.directory}/c</workingDirectory>
126-
<executable>make</executable>
127-
<environmentVariables>
128-
<LD_LIBRARY_PATH>${env.LD_LIBRARY_PATH};/usr/lib</LD_LIBRARY_PATH>
129-
<PATH>${env.PATH};${project.basedir};</PATH>
130-
<CALLER>ANT</CALLER>
131-
<CLOVER_HOME></CLOVER_HOME>
132-
<base_dir>${project.basedir}/../..</base_dir>
133-
</environmentVariables>
134-
<arguments>
135-
<argument>clean check</argument>
136-
</arguments>
119+
<tasks>
120+
<exec dir="${basedir}/target/c" executable="make" failonerror="true">
121+
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
122+
<env key="PATH" path="${env.PATH};${basedir};" />
123+
<env key="CALLER" value="ANT" />
124+
<env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
125+
<env key="base_dir" value="${basedir}/../.." />
126+
<arg line="clean install" />
127+
</exec>
128+
</tasks>
129+
</configuration>
130+
<goals>
131+
<goal>run</goal>
132+
</goals>
133+
</execution>
134+
<execution>
135+
<id>test-cppunit</id>
136+
<phase>test</phase>
137+
<configuration>
138+
<!-- do not run cpp tests if tests are globally skipped -->
139+
<skip>${skipTests}</skip>
140+
<tasks>
141+
<exec dir="${basedir}/target/c" executable="make" failonerror="true">
142+
<env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
143+
<env key="PATH" path="${env.PATH};${basedir};" />
144+
<env key="CALLER" value="ANT" />
145+
<env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
146+
<env key="base_dir" value="${basedir}/../.." />
147+
<arg line="check" />
148+
</exec>
149+
</tasks>
137150
</configuration>
138-
</execution-->
151+
<goals>
152+
<goal>run</goal>
153+
</goals>
154+
</execution>
139155
</executions>
140156
</plugin>
141157
</plugins>

0 commit comments

Comments
 (0)