Changeset 16453 for release-kits/mark2

Show
Ignore:
Timestamp:
18.07.2008 10:01:16 (12 years ago)
Author:
oranfry
Message:

the bulk of the work on the compile logic for mark2

Location:
release-kits/mark2/ant-scripts
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • release-kits/mark2/ant-scripts/build.xml

    r16241 r16453  
    11<?xml version="1.0" encoding="utf-8" ?> 
    22<!-- 
    3         ..........................................................  
     3        .......................................................... 
    44        June 2008 
    5         Linux Release Kit for Greenstone2 (lirk2) 
     5        Mac Release Kit for Greenstone2 (mark2) 
    66        Oran Fry 
    77        .......................................................... 
    88--> 
    9 <project name="lirk2-build" default="lirk2"> 
     9<project name="mark2-build" default="mark2"> 
    1010 
    1111    <!-- CONSTANTS --> 
     
    1616 
    1717    <!-- for the benefit of the shared scripts, set release-kit home --> 
    18     <property name="rk.home" value="${lirk2.home}" /> 
     18    <property name="rk.home" value="${mark2.home}" /> 
    1919 
    2020    <!-- IMPORT OTHER ANT SCRIPTS --> 
     
    2626 
    2727    <!-- THE MAIN TARGET --> 
    28     <target name="lirk2" depends="init"> 
     28    <target name="mark2" depends="init"> 
    2929        <addressedcall target="compile"/> 
    3030        <addressedcall target="create-distribution"/> 
  • release-kits/mark2/ant-scripts/compile.xml

    r16294 r16453  
    11<?xml version="1.0" encoding="utf-8" ?> 
    2 <project name="lirk2-compile" default="compile"> 
     2<project name="mark2-compile" default="compile"> 
    33 
    44    <target name="compile"> 
     
    88         
    99        <!-- configure --> 
    10         <addressedcall target="add-static-to-configure-in"/> 
    11         <addressedcall target="set-environment-in-packages-configure"/> 
    1210        <addressedcall target="run-configure"/> 
    13         <addressedcall target="makefiles-add-static"/> 
     11        <addressedcall target="tweak-makefiles"/> 
    1412 
    1513        <!-- make --> 
    1614        <addressedcall target="run-make"/> 
    17         <!-- <addressedcall target="fix-wget"/> upgraded wget, mightn't need to do this now --> 
    1815        <addressedcall target="run-make-install"/> 
    1916        <addressedcall target="copy-library-oai"/> 
     
    3532    </target> 
    3633 
    37     <target name="add-static-to-configure-in"> 
    38         <if><bool><istrue value="${execute}"/></bool> 
    39             <rsr file="${basedir}/gsdl/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/> 
    40             <exec dir="${basedir}/gsdl" executable="autoconf" output="${basedir}/gsdl/configure"><arg value="configure.in"/></exec> 
    41         </if> 
    42     </target> 
    43  
    44     <target name="set-environment-in-packages-configure"> 
    45         <if><bool><istrue value="${execute}"/></bool> 
    46             <rsr file="${basedir}/gsdl/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/> 
    47         </if> 
    48     </target> 
    49  
    5034    <target name="run-configure"> 
    5135        <if><bool><istrue value="${execute}"/></bool> 
    5236            <exec dir="${basedir}/gsdl" executable="${basedir}/gsdl/configure"> 
    53                 <env key="LDFLAGS" value="-static"/> 
     37                <arg line="--with-gdbm=${mark2.home}/linux/gdbm-1.8.3"/> 
    5438            </exec> 
    5539        </if> 
    5640    </target> 
    5741 
    58     <target name="makefiles-add-static"> 
     42    <target name="tweak-makefiles"> 
    5943        <if><bool><istrue value="${execute}"/></bool> 
    60             <rsr file="${basedir}/gsdl/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" /> 
    61             <rsr file="${basedir}/gsdl/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" /> 
    62             <rsr file="${basedir}/gsdl/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" /> 
    63             <rsr file="${basedir}/gsdl/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static" /> 
     44    <rsr file="${basedir}/gsdl/src/recpt/Makefile" pattern="^(LIBS =.*)-L${mark2.home}/linux/gdbm-1.8.3/lib -lgdbm(.*)$" replacement="$1${mark2.home}/linux/gdbm-1.8.3/lib/libgdbm.a$2" /> 
     45    <rsr file="${basedir}/gsdl/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L${mark2.home}/linux/gdbm-1.8.3/lib -lgdbm(.*)$" replacement="$1${mark2.home}/linux/gdbm-1.8.3/lib/libgdbm.a$2" /> 
     46    <rsr file="${basedir}/gsdl/src/gdbmedit/db2txt/Makefile" pattern="^(LIBS =.*)-L${mark2.home}/linux/gdbm-1.8.3/lib -lgdbm(.*)$" replacement="$1${mark2.home}/linux/gdbm-1.8.3/lib/libgdbm.a$2" /> 
     47    <rsr file="${basedir}/gsdl/src/gdbmedit/txt2db/Makefile" pattern="^(LIBS =.*)-L${mark2.home}/linux/gdbm-1.8.3/lib -lgdbm(.*)$" replacement="$1${mark2.home}/linux/gdbm-1.8.3/lib/libgdbm.a$2" /> 
     48    <rsr file="${basedir}/gsdl/src/recpt/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3" /> 
     49    <rsr file="${basedir}/gsdl/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3" /> 
    6450        </if> 
    6551    </target> 
     
    7157    </target> 
    7258 
    73     <target name="fix-wget"> 
    74         <if><bool><istrue value="${execute}"/></bool> 
    75             <delete file="${basedir}/gsdl/packages/wget/wget-1.9/src/wget"/> 
    76             <exec dir="${basedir}/gsdl/packages/wget/wget-1.9/src" executable="gcc"><arg line="-O2 -Wall -Wno-implicit -o wget cmpt.o connect.o convert.o cookies.o ftp.o ftp-basic.o ftp-ls.o ftp-opie.o hash.o headers.o host.o html-parse.o html-url.o http.o init.o log.o main.o gen-md5.o netrc.o progress.o rbuf.o recur.o res.o retr.o safe-ctype.o snprintf.o gen_sslfunc.o url.o utils.o version.o  -lssl -lcrypto -ldl -static"/></exec> 
    77         </if> 
    78     </target> 
    79      
    80  
    8159    <target name="run-make-install"> 
    8260        <if><bool><istrue value="${execute}"/></bool> 
     
    8765    <target name="copy-library-oai"> 
    8866        <if><bool><istrue value="${execute}"/></bool> 
    89             <exec executable="cp"><arg line="${basedir}/gsdl/cgi-bin/library ${basedir}/gsdl/bin/linux/library"/></exec> 
    90             <exec executable="cp"><arg line="${basedir}/gsdl/cgi-bin/oaiserver ${basedir}/gsdl/bin/linux/oaiserver"/></exec> 
     67            <exec executable="cp"><arg line="${basedir}/gsdl/cgi-bin/library ${basedir}/gsdl/bin/darwin/library"/></exec> 
     68            <exec executable="cp"><arg line="${basedir}/gsdl/cgi-bin/oaiserver ${basedir}/gsdl/bin/darwin/oaiserver"/></exec> 
    9169        </if> 
    9270    </target> 
     
    9472    <target name="strip-execs"> 
    9573        <if><bool><istrue value="${execute}"/></bool> 
    96             <exec dir="${basedir}/gsdl/bin/linux" executable="find"> 
    97                 <arg line="! -name . -type f -maxdepth 1 -exec strip {} &#59;"/> 
     74            <exec dir="${basedir}/gsdl/bin/darwin" executable="find"> 
     75                <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/> 
    9876            </exec> 
    9977        </if> 
     
    10280    <target name="build-demo-collection"> 
    10381        <if><bool><istrue value="${execute}"/></bool> 
    104             <exec dir="${basedir}/gsdl" executable="${lirk2.home}/resources/build-demo.sh"/> 
     82            <exec dir="${basedir}/gsdl" executable="${mark2.home}/resources/build-demo.sh"/> 
    10583        </if> 
    10684    </target> 
    10785 
    108  
    109  
    11086</project> 
  • release-kits/mark2/ant-scripts/create-distribution.xml

    r16241 r16453  
    11<?xml version="1.0" encoding="utf-8" ?> 
    2 <project name="lirk2-create-distribution" default="create-distribution"> 
     2<project name="mark2-create-distribution" default="create-distribution"> 
    33 
    44 
     
    4747    <target name="dist-set-gli-version"> 
    4848        <if><bool><istrue value="${execute}"/></bool> 
    49             <ant antfile="${lirk2.home}/ant-scripts/shared-ant-scripts/operations-on-gli.xml" dir="${basedir}/distributions/web/gli" target="set-version-numbers"/> 
     49            <ant antfile="${mark2.home}/ant-scripts/shared-ant-scripts/operations-on-gli.xml" dir="${basedir}/distributions/web/gli" target="set-version-numbers"/> 
    5050        </if> 
    5151    </target> 
     
    7373            <echo level="info">Dropping gsdl docs  into distribution</echo> 
    7474            <copy todir="${basedir}/distributions/web" overwrite="true"> 
    75                 <fileset dir="${lirk2.home}/greenstone2/docs"/> 
     75                <fileset dir="${mark2.home}/greenstone2/docs"/> 
    7676            </copy> 
    7777        </if> 
  • release-kits/mark2/ant-scripts/create-installer.xml

    r16278 r16453  
    11<?xml version="1.0" encoding="utf-8" ?> 
    2 <project name="lirk2-create-installer" default="create-installer"> 
     2<project name="mark2-create-installer" default="create-installer"> 
    33 
    44    <target name="create-installer"> 
     
    1212            <echo>Getting things ready to compile the installer</echo> 
    1313            <mkdir dir="${basedir}/installer/classes"/> 
    14             <copy todir="${basedir}/installer" file="${lirk2.home}/installer/antinstall-config.xml" overwrite="true"/> 
    15             <copy todir="${basedir}/installer" file="${lirk2.home}/installer/build.xml" overwrite="true"/> 
     14            <copy todir="${basedir}/installer" file="${mark2.home}/installer/antinstall-config.xml" overwrite="true"/> 
     15            <copy todir="${basedir}/installer" file="${mark2.home}/installer/build.xml" overwrite="true"/> 
    1616            <copy todir="${basedir}/installer/classes" overwrite="true"> 
    17                 <fileset dir="${lirk2.home}/greenstone2/installer-classes"/> 
    18                 <fileset dir="${lirk2.home}/ant-scripts/tasks/orans" includes="RegexSearchReplace.class" /> 
     17                <fileset dir="${mark2.home}/greenstone2/installer-classes"/> 
     18                <fileset dir="${mark2.home}/ant-scripts/tasks/orans" includes="RegexSearchReplace.class" /> 
    1919            </copy> 
    2020 
     
    3838 
    3939            <!-- create the installer with java --> 
    40             <installer file="${basedir}/installer/greenstone-${version}-linux-with-java.jar" 
     40            <installer file="${basedir}/installer/Greenstone-${version}-MacOS-x86-with-java.jar" 
    4141                    compress="true" 
    4242                    extractType="NonExtractor" 
    4343                    installConfig="${basedir}/installer/antinstall-config.xml" 
    4444                    buildFile="${basedir}/installer/build.xml" 
    45                     antInstallLib="${lirk2.home}/packages/ant-installer/lib" 
    46                     antLib="${lirk2.home}/packages/ant/lib" 
     45                    antInstallLib="${mark2.home}/packages/ant-installer/lib" 
     46                    antLib="${mark2.home}/packages/ant/lib" 
    4747                    validateConfig="true" 
    4848                    failOnError="false" 
     
    5858 
    5959            <!-- create the installer without java --> 
    60             <installer file="${basedir}/installer/greenstone-${version}-linux.jar" 
     60            <installer file="${basedir}/installer/Greenstone-${version}-MacOS-x86.jar" 
    6161                    compress="true" 
    6262                    extractType="NonExtractor" 
    6363                    installConfig="${basedir}/installer/antinstall-config.xml" 
    6464                    buildFile="${basedir}/installer/build.xml" 
    65                     antInstallLib="${lirk2.home}/packages/ant-installer/lib" 
    66                     antLib="${lirk2.home}/packages/ant/lib" 
     65                    antInstallLib="${mark2.home}/packages/ant-installer/lib" 
     66                    antLib="${mark2.home}/packages/ant/lib" 
    6767                    validateConfig="true" 
    6868                    failOnError="false" 
  • release-kits/mark2/ant-scripts/wrap.xml

    r16233 r16453  
    11<?xml version="1.0" encoding="utf-8" ?> 
    2 <project name="lirk2-wrap" default="wrap"> 
     2<project name="mark2-wrap" default="wrap"> 
    33 
    44    <target name="wrap"> 
    5         <addressedcall target="setup-for-wrapping"/> 
    6         <addressedcall target="compile-wrapper"/> 
    7     </target> 
    8  
    9  
    10     <target name="setup-for-wrapping"> 
    115        <if><bool><istrue value="${execute}"/></bool> 
    126 
    137            <!-- create and setup the build directory --> 
    14             <mkdir dir="${basedir}/wrapped-installer/build"/> 
    15             <copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/linux/wrapper.cpp"/> 
    16             <copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/packages/search4j/libsearch4j.cpp"/> 
    17             <copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/packages/search4j/libsearch4j.h"/> 
     8            <delete dir="${basedir}/wrapped-installer"/> 
     9            <mkdir dir="${basedir}/wrapped-installer"/> 
     10            <copy todir="${basedir}/wrapped-installer/Greenstone${version}.app"><fileset dir="${mark2.home}/mac/Wrapper.app"/></copy> 
     11            <chmod file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/MacOS/JavaApplicationStub" perm="ug+x"/> 
    1812 
    1913            <!-- copy bundled files --> 
    20             <copy todir="${basedir}/wrapped-installer/build" file="${lirk2.home}/linux/${linux-java.installer}"/> 
    21             <copy tofile="${basedir}/wrapped-installer/build/greenstone2.jar" file="${basedir}/installer/greenstone-${version}-linux.jar"/> 
    22             <copy tofile="${basedir}/wrapped-installer/build/greenstone2-with-java.jar" file="${basedir}/installer/greenstone-${version}-linux-with-java.jar"/> 
     14            <!--<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${mark2.home}/linux/${linux-java.installer}"/>--> 
     15            <copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${basedir}/installer/Greenstone-${version}-MacOS-x86.jar"/> 
    2316 
    2417            <!-- substitute in real values --> 
    25             <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.installer@" replacement="${linux-java.installer}"/> 
    26             <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@installer.name@" replacement="greenstone2"/> 
    27             <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.extracted@" replacement="${linux-java.extracted}"/> 
    28             <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/> 
     18            <rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@jar@" replacement="Greenstone-${version}-MacOS-x86.jar"/> 
     19            <rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/> 
    2920 
    30         </if> 
    31     </target> 
     21                        <!-- get size of app --> 
     22                        <exec executable="du" dir="${basedir}/wrapped-installer" outputproperty="app.du"><arg line="-ks Greenstone${version}.app"/></exec> 
     23            <echo>app.du: ${app.du}</echo> 
     24                        <exec executable="sed" inputstring="${app.du}" outputproperty="app.size"><arg line="-e 's/^\([0-9]*\).*$/\1/g'"/></exec> 
     25            <echo>app.size: ${app.size}</echo> 
     26            <math result="dmg.size" operand1="${app.size}" operation="+" operand2="2048" datatype="int"/> 
     27            <echo>dmg.size: ${dmg.size}</echo> 
    3228 
    33     <target name="compile-wrapper"> 
    34         <if><bool><istrue value="${execute}"/></bool> 
    35  
    36             <echo level="info">create an object file (extension .o) for each file to bundle</echo> 
    37             <exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build"> 
    38                 <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone2_jar_start=greenstone2jar --readonly-text greenstone2.jar greenstone2.jar.o"/> 
    39             </exec> 
    40             <exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build"> 
    41                 <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone2_with_java_jar_start=greenstone2jar --readonly-text greenstone2-with-java.jar greenstone2-with-java.jar.o"/> 
    42             </exec> 
    43             <exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build"> 
    44                 <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_${linux-java.installer}_start=java --readonly-text ${linux-java.installer} java.o"/> 
    45             </exec> 
    46  
    47             <!-- get size of greenstone.jar --> 
    48             <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone2.jar.ls"><arg line="-l greenstone2.jar"/></exec> 
    49             <exec executable="sed" inputstring="${greenstone2.jar.ls}" outputproperty="greenstone2.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec> 
    50  
    51             <!-- get size of greenstone-with-java.jar --> 
    52             <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone2-with-java.jar.ls"><arg line="-l greenstone2-with-java.jar"/></exec> 
    53             <exec executable="sed" inputstring="${greenstone2-with-java.jar.ls}" outputproperty="greenstone2-with-java.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec> 
    54  
    55             <!-- get size of java --> 
    56             <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="java.ls"><arg line="-l ${linux-java.installer}"/></exec> 
    57             <exec executable="sed" inputstring="${java.ls}" outputproperty="java.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec> 
    58  
    59             <echo level="info">creating the header file for no java version</echo> 
    60             <delete file="wrapper.h"/> 
    61             <exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h"><arg line="extern const char greenstone2jar[${greenstone2.jar.size}];"/></exec> 
    62  
    63             <echo level="info">compile the wrapper program</echo> 
    64             <exec executable="g++" dir="${basedir}/wrapped-installer/build"> 
    65                 <arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/> 
    66             </exec> 
    67  
    68             <echo level="info">compile libsearch4j</echo> 
    69             <exec executable="g++" dir="${basedir}/wrapped-installer/build"> 
    70                 <arg line="-Wall -static -static-libgcc -c -o libsearch4j.o libsearch4j.cpp"/> 
    71             </exec> 
    72  
    73             <echo level="info">link, bundling the files to be bundled</echo> 
    74             <exec executable="g++" dir="${basedir}/wrapped-installer/build"> 
    75                 <arg line="-static -static-libgcc -o  ../greenstone-${version}-linux.bin wrapper.o libsearch4j.o greenstone2.jar.o"/> 
    76             </exec> 
    77  
    78             <echo level="info">creating the header file for bundled java version</echo> 
    79             <delete file="wrapper.h"/> 
    80             <exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h"><arg line="extern const char greenstone2jar[${greenstone2-with-java.jar.size}];"/></exec> 
    81             <exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec> 
    82             <exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec> 
    83  
    84             <echo level="info">recompile the wrapper program</echo> 
    85             <exec executable="g++" dir="${basedir}/wrapped-installer/build"> 
    86                 <arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/> 
    87             </exec> 
    88  
    89             <echo level="info">relink, bundling the files to be bundled</echo> 
    90             <exec executable="g++" dir="${basedir}/wrapped-installer/build"> 
    91                 <arg line="-static -static-libgcc -o  ../greenstone-${version}-linux-with-java.bin wrapper.o libsearch4j.o greenstone2-with-java.jar.o java.o"/> 
    92             </exec> 
    93  
     29            <!-- create disk image --> 
     30            <exec dir="${basedir}/wrapped-installer" executable="hdiutil"><arg line="create -size ${dmg.size}k -fs HFS+ -volname Greenstone${version} Greenstone${version}.dmg"/></exec> 
     31            <!-- mount it --> 
     32            <exec executable="hdiutil" dir="${basedir}/wrapped-installer"><arg line="attach Greenstone${version}.dmg"/></exec> 
     33            <!-- copy file into it --> 
     34            <exec executable="cp" dir="${basedir}/wrapped-installer"><arg line="-r Greenstone${version}.app /Volumes/Greenstone${version}"/></exec> 
     35            <!-- unmount it--> 
     36            <exec executable="hdiutil" dir="${basedir}/wrapped-installer"><arg line="detach /Volumes/Greenstone${version}"/></exec> 
    9437        </if> 
    9538    </target>