Review Board 1.7.22


ZOOKEEPER-999 Create an package integration project

Review Request #1143 - Created July 19, 2011 and updated

Patrick Hunt
trunk
ZOOKEEPER-999
Reviewers
zookeeper
mahadev
zookeeper
This goal of this ticket is to generate a set of RPM/debian package which integrate well with RPM sets created by HADOOP-6255.

 
./build.xml
Diff Revision 1 Diff Revision 2
[20] 100 lines
[+20]
101
    <property name="ivy.version" value="2.2.0"/>
101
    <property name="ivy.version" value="2.2.0"/>
102
    <property name="ivy.url"
102
    <property name="ivy.url"
103
              value="http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
103
              value="http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
104
    <property name="ivy.home" value="${user.home}/.ant" />
104
    <property name="ivy.home" value="${user.home}/.ant" />
105
    <property name="ivy.lib" value="${build.dir}/lib"/>
105
    <property name="ivy.lib" value="${build.dir}/lib"/>

    
   
106
    <property name="ivy.package.lib" value="${build.dir}/package/lib"/>
106
    <property name="ivy.test.lib" value="${build.dir}/test/lib"/>
107
    <property name="ivy.test.lib" value="${build.dir}/test/lib"/>
107
    <property name="ivy.jdiff.lib" value="${build.dir}/jdiff/lib"/>
108
    <property name="ivy.jdiff.lib" value="${build.dir}/jdiff/lib"/>
108
    <property name="ivysettings.xml" value="${basedir}/ivysettings.xml"/>
109
    <property name="ivysettings.xml" value="${basedir}/ivysettings.xml"/>
109

    
   
110

   
110
    <available property="clover.present"
111
    <available property="clover.present"
[+20] [20] 38 lines
[+20]
149
    <property name="build.dir.eclipse" value=".eclipse"/>
150
    <property name="build.dir.eclipse" value=".eclipse"/>
150
    <property name="build.dir.eclipse-main-classes" value="${build.dir.eclipse}/classes-main"/>
151
    <property name="build.dir.eclipse-main-classes" value="${build.dir.eclipse}/classes-main"/>
151
    <property name="build.dir.eclipse-test-classes" value="${build.dir.eclipse}/classes-test"/>
152
    <property name="build.dir.eclipse-test-classes" value="${build.dir.eclipse}/classes-test"/>
152

    
   
153

   
153
    <!-- cppunit property set -->
154
    <!-- cppunit property set -->
154
    <property name="cppunit.lib" value="/usr/local/lib"/>
155
    <property name="cppunit.lib" value="/usr/lib"/>
155
    <property name="cppunit.m4" value="/usr/local/share/aclocal"/>
156
    <property name="cppunit.m4" value="/usr/share/aclocal"/>
156

    
   
157

   
157
    <!-- packaging property set -->
158
    <!-- packaging property set -->
158
    <property name="package.release" value="1"/>
159
    <property name="package.release" value="1"/>
159
    <property name="package.prefix" value="/usr"/>
160
    <property name="package.prefix" value="/usr"/>
160
    <property name="package.conf.dir" value="/etc/zookeeper"/>
161
    <property name="package.conf.dir" value="/etc/zookeeper"/>
[+20] [20] 46 lines
[+20]
207
      </fileset>
208
      </fileset>
208
      <path refid="java.classpath"/>
209
      <path refid="java.classpath"/>
209
    </path>
210
    </path>
210

    
   
211

   
211
    <path id="package.classpath">
212
    <path id="package.classpath">
212
      <fileset dir="${ivy.lib}">
213
      <fileset dir="${ivy.package.lib}">
213
        <include name="**/jdeb*.jar" />
214
        <include name="**/jdeb*.jar" />
214
      </fileset>
215
      </fileset>
215
    </path>
216
    </path>
216

    
   
217

   
217
    <!-- ====================================================== -->
218
    <!-- ====================================================== -->
218
    <!-- Generate and compile the Java files                    -->
219
    <!-- Generate and compile the Java files                    -->
219
    <!-- ====================================================== -->
220
    <!-- ====================================================== -->
220
    <target name="init">    
221
    <target name="init">    
221
        <mkdir dir="${build.classes}" />
222
        <mkdir dir="${build.classes}" />
222

    
   
223

   
223
        <mkdir dir="${ivy.lib}"/>
224
        <mkdir dir="${ivy.lib}"/>

    
   
225
        <mkdir dir="${ivy.package.lib}"/>
224
        <mkdir dir="${ivy.test.lib}"/>
226
        <mkdir dir="${ivy.test.lib}"/>
225
        <condition property="ivy.jar.exists">
227
        <condition property="ivy.jar.exists">
226
          <available file="${lib.dir}/ivy-${ivy.version}.jar"/>
228
          <available file="${lib.dir}/ivy-${ivy.version}.jar"/>
227
        </condition>
229
        </condition>
228

    
   
230

   
[+20] [20] 102 lines
[+20]
331
    <target name="ivy-retrieve-test" depends="init,ivy-init">
333
    <target name="ivy-retrieve-test" depends="init,ivy-init">
332
      <ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="test"
334
      <ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="test"
333
                    pattern="${ivy.test.lib}/[artifact]-[revision].[ext]"/>
335
                    pattern="${ivy.test.lib}/[artifact]-[revision].[ext]"/>
334
    </target>
336
    </target>
335

    
   
337

   

    
   
338
    <target name="ivy-retrieve-package" depends="init,ivy-init">

    
   
339
      <ivy:retrieve settingsRef="${ant.project.name}" conf="package"

    
   
340
                    pattern="${ivy.package.lib}/[artifact]-[revision].[ext]"/>

    
   
341
    </target>

    
   
342

   
336
    <target name="ivy-retrieve-jdiff" depends="init,ivy-init">
343
    <target name="ivy-retrieve-jdiff" depends="init,ivy-init">
337
      <mkdir dir="${ivy.jdiff.lib}"/>
344
      <mkdir dir="${ivy.jdiff.lib}"/>
338
      <ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="jdiff"
345
      <ivy:retrieve settingsRef="${ant.project.name}" type="jar" conf="jdiff"
339
                    pattern="${ivy.jdiff.lib}/[artifact]-[revision].[ext]"/>
346
                    pattern="${ivy.jdiff.lib}/[artifact]-[revision].[ext]"/>
340
    </target>
347
    </target>
[+20] [20] 394 lines
[+20]
735
      <copy todir="${dist.dir}/src" includeEmptyDirs="true">
742
      <copy todir="${dist.dir}/src" includeEmptyDirs="true">
736
        <fileset dir="src" excludes="**/*.template **/docs/build/**/* **/ivy*.jar"/>
743
        <fileset dir="src" excludes="**/*.template **/docs/build/**/* **/ivy*.jar"/>
737
      </copy>
744
      </copy>
738

    
   
745

   
739
      <copy todir="${dist.dir}/${package.share.dir}/templates/conf">
746
      <copy todir="${dist.dir}/${package.share.dir}/templates/conf">
740
        <fileset dir="${basedir}/src/packages/templates/conf" includes="*"/>
747
        <fileset dir="src/packages/templates/conf"/>
741
      </copy>
748
      </copy>

    
   
749

   

    
   
750
      <copy file="${basedir}/conf/zoo_sample.cfg" tofile="${dist.dir}/${package.share.dir}/templates/conf/zoo.cfg" />

    
   
751
      <replace file="${dist.dir}/${package.share.dir}/templates/conf/zoo.cfg">

    
   
752
        <replacetoken>/tmp/zookeeper</replacetoken>

    
   
753
        <replacevalue>${VAR_DIR}/data</replacevalue>

    
   
754
      </replace>
742
  	  
755
  	  
743
      <chmod perm="ugo+x" type="file" parallel="false">
756
      <chmod perm="ugo+x" type="file" parallel="false">
744
        <fileset dir="${dist.dir}/bin"/>
757
        <fileset dir="${dist.dir}/bin"/>
745
        <fileset dir="${dist.dir}/sbin"/>
758
        <fileset dir="${dist.dir}/sbin"/>
746
        <fileset dir="${dist.dir}/src/contrib/">
759
        <fileset dir="${dist.dir}/src/contrib/">
[+20] [20] 68 lines
[+20]
815
          </tarfileset>
828
          </tarfileset>
816
        </param.listofitems>
829
        </param.listofitems>
817
      </macro_tar>
830
      </macro_tar>
818
    </target>
831
    </target>
819

    
   
832

   
820
    <target name="package-native" depends="compile-native" description="Make C binding tarball">
833
    <target name="package-native" depends="compile-native, package" description="Make C binding tarball">
821
      <!-- For Unix platforms only, use OS native tar to preserve symlinks -->
834
      <!-- For Unix platforms only, use OS native tar to preserve symlinks -->
822
      <exec executable="tar" dir="${build.dir}/c/build">
835
      <exec executable="tar" dir="${build.dir}/c/build">
823
        <arg value="cfzv" />
836
        <arg value="cfzv" />
824
        <arg value="${build.dir}/${final.name}-lib.tar.gz" />
837
        <arg value="${build.dir}/${final.name}-lib.tar.gz" />
825
        <arg value="." />
838
        <arg value="." />
826
      </exec>
839
      </exec>

    
   
840
      <subant target="package">

    
   
841
        <!--Pass down the version in case its needed again and the target

    
   
842
            distribution directory so contribs know where to install to.-->

    
   
843
        <property name="version" value="${version}"/>

    
   
844
        <property name="dist.dir" value="${dist.dir}"/>

    
   
845
        <fileset file="${contrib.dir}/build.xml"/>

    
   
846
        <fileset file="${recipes.dir}/build.xml"/>

    
   
847
      </subant>
827
    </target>
848
    </target>
828

    
   
849

   
829
    <target name="rpm" depends="package-native, tar" description="Make rpm package">
850
    <target name="rpm" depends="package-native, tar" description="Make rpm package">
830
      <subant target="rpm">
851
      <subant target="rpm">
831
        <!--Pass down the version in case its needed again and the target
852
        <!--Pass down the version in case its needed again and the target
[+20] [20] 47 lines
[+20]
879
        </fileset>
900
        </fileset>
880
      </copy>
901
      </copy>
881
      <delete dir="${package.buildroot}" quiet="true" verbose="false"/>
902
      <delete dir="${package.buildroot}" quiet="true" verbose="false"/>
882
    </target>
903
    </target>
883

    
   
904

   
884
    <target name="deb" depends="compile-native, tar" description="Make deb package">
905
    <target name="deb" depends="ivy-retrieve-package, compile-native, tar" description="Make deb package">
885
      <subant target="deb">
906
      <subant target="deb">
886
        <!--Pass down the version in case its needed again and the target
907
        <!--Pass down the version in case its needed again and the target
887
            distribution directory so contribs know where to install to.-->
908
            distribution directory so contribs know where to install to.-->
888
        <property name="version" value="${version}"/>
909
        <property name="version" value="${version}"/>
889
        <property name="dist.dir" value="${dist.dir}"/>
910
        <property name="dist.dir" value="${dist.dir}"/>
[+20] [20] 681 lines
./ivy.xml
Diff Revision 1 Diff Revision 2
 
./bin/zkCleanup.sh
Diff Revision 1 Diff Revision 2
 
./bin/zkCli.sh
Diff Revision 1 Diff Revision 2
 
./bin/zkEnv.sh
Diff Revision 1 Diff Revision 2
 
./bin/zkServer.sh
Diff Revision 1 Diff Revision 2
 
./src/contrib/build.xml
Diff Revision 1 Diff Revision 2
 
./src/contrib/build-contrib.xml
Diff Revision 1 Diff Revision 2
 
./src/contrib/zkpython/build.xml
Diff Revision 1 Diff Revision 2
 
./src/contrib/zkpython/ivy.xml
Diff Revision 1 Diff Revision 2
 
./src/contrib/zkpython/src/packages/deb/zkpython.control/control
Diff Revision 1 Diff Revision 2
 
./src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec
Diff Revision 1 Diff Revision 2
 
./src/contrib/zkpython/src/python/setup.py
Diff Revision 1 Diff Revision 2
 
./src/packages/deb/init.d/zookeeper
Diff Revision 1 Diff Revision 2
 
./src/packages/deb/zookeeper.control/control
Diff Revision 1 Diff Revision 2
 
./src/packages/deb/zookeeper.control/preinst
Diff Revision 1 Diff Revision 2
 
./src/packages/rpm/init.d/zookeeper
Diff Revision 1 Diff Revision 2
 
./src/packages/rpm/spec/zookeeper.spec
Diff Revision 1 Diff Revision 2
 
./src/packages/templates/conf/zoo.cfg
Diff Revision 1 Diff Revision 2 - File Reverted
 
./src/packages/templates/conf/zookeeper-env.sh
Diff Revision 1 Diff Revision 2
 
./src/recipes/build.xml
Diff Revision 1 Diff Revision 2
 
./src/recipes/build-recipes.xml
Diff Revision 1 Diff Revision 2
 
./src/recipes/lock/build.xml
Diff Revision 1 Diff Revision 2
 
./src/recipes/queue/build.xml
Diff Revision 1 Diff Revision 2
 
  1. ./build.xml: Loading...
  2. ./ivy.xml: Loading...
  3. ./bin/zkCleanup.sh: Loading...
  4. ./bin/zkCli.sh: Loading...
  5. ./bin/zkEnv.sh: Loading...
  6. ./bin/zkServer.sh: Loading...
  7. ./src/contrib/build.xml: Loading...
  8. ./src/contrib/build-contrib.xml: Loading...
  9. ./src/contrib/zkpython/build.xml: Loading...
  10. ./src/contrib/zkpython/ivy.xml: Loading...
  11. ./src/contrib/zkpython/src/packages/deb/zkpython.control/control: Loading...
  12. ./src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec: Loading...
  13. ./src/contrib/zkpython/src/python/setup.py: Loading...
  14. ./src/packages/deb/init.d/zookeeper: Loading...
  15. ./src/packages/deb/zookeeper.control/control: Loading...
  16. ./src/packages/deb/zookeeper.control/preinst: Loading...
  17. ./src/packages/rpm/init.d/zookeeper: Loading...
  18. ./src/packages/rpm/spec/zookeeper.spec: Loading...
  19. ./src/packages/templates/conf/zoo.cfg: Loading...
  20. ./src/packages/templates/conf/zookeeper-env.sh: Loading...
  21. ./src/recipes/build.xml: Loading...
  22. ./src/recipes/build-recipes.xml: Loading...
  23. ./src/recipes/lock/build.xml: Loading...
  24. ./src/recipes/queue/build.xml: Loading...