summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMate Szalay-Beko <mszalay@cloudera.com>2019-10-24 08:49:42 +0200
committerAndor Molnar <andor@apache.org>2019-10-24 08:49:42 +0200
commit99be7de0c394a32d46c3f06b23f860eadfbd42b0 (patch)
tree9e786d47ea5a2541d6c56f75f968975109a017e6
parentc9eeeda3bb83ee492a29ccbdc9f9541ee676e578 (diff)
downloadzookeeper-99be7de0c394a32d46c3f06b23f860eadfbd42b0.tar.gz
ZOOKEEPER-3530: add new artifact for compiled c-client code
During the old ZooKeeper 3.4 ant builds (ant package-native), there was an artifact (zookeeper-<version>-lib.tar.gz) created just for the C-client, with the following content: ``` usr |--- bin |--- cli_mt |--- cli_st |--- load_gen |--- include |--- zookeeper |--- proto.h |--- recordio.h |--- zookeeper.h |--- zookeeper.jute.h |--- zookeeper_log.h |--- zookeeper_version.h |--- lib |--- libzookeeper_mt.a |--- libzookeeper_mt.la |--- libzookeeper_mt.so |--- libzookeeper_mt.so.2 |--- libzookeeper_mt.so.2.0.0 |--- libzookeeper_st.a |--- libzookeeper_st.la |--- libzookeeper_st.so |--- libzookeeper_st.so.2 |--- libzookeeper_st.so.2.0.0 ``` Currently with maven, when we are generating a tarball during full-build then the C-client is not getting archived. In [PR-1078](https://github.com/apache/zookeeper/pull/1078) we discussed that we should re-introduce the apache-zookeeper-<version>-lib.tar.gz artifact. The goals of this PR are: - re-introduce the 'lib' artifact, with the same structure we had for the older zookeeper 3.4.x ant generated tar file - we should also add the LICENSE.txt file to the archive (it was missing from the 3.4.x version tar.gz file) - the new artifact should be generated only when the full-build profile is set for maven - we should also update the README_packaging.md file Author: Mate Szalay-Beko <mszalay@cloudera.com> Reviewers: nkalmar@apache.org, andor@apache.org Closes #1113 from symat/ZOOKEEPER-3530-PR
-rw-r--r--README_packaging.md1
-rwxr-xr-xzookeeper-assembly/pom.xml27
-rw-r--r--zookeeper-assembly/src/main/assembly/lib-package.xml63
3 files changed, 91 insertions, 0 deletions
diff --git a/README_packaging.md b/README_packaging.md
index fe731a7ff..ea54e9635 100644
--- a/README_packaging.md
+++ b/README_packaging.md
@@ -64,6 +64,7 @@ The compiled C client can be found here:
- `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)
diff --git a/zookeeper-assembly/pom.xml b/zookeeper-assembly/pom.xml
index 7586a3c52..36964956c 100755
--- a/zookeeper-assembly/pom.xml
+++ b/zookeeper-assembly/pom.xml
@@ -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>
@@ -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>
diff --git a/zookeeper-assembly/src/main/assembly/lib-package.xml b/zookeeper-assembly/src/main/assembly/lib-package.xml
new file mode 100644
index 000000000..61c277900
--- /dev/null
+++ b/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>