Ignore:
Timestamp:
2010-01-27T09:20:02+13:00 (14 years ago)
Author:
oranfry
Message:

tidied up the cdrom and documented examples release kits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml

    r21649 r21651  
    1010<project name="cdrk2-build" default="cdrk2">
    1111
    12     <!-- CONSTANTS -->
    13 
    14     <!-- for the benefit of the shared scripts, set release-kit home -->
    15     <property name="rk.name" value="cdrk2"/>
    16     <property name="rk.home" value="${cdrk2.home}" />
    17     <property name="rk.os" value="multi" />
    18     <property name="os.suffix" value="AnyPlatform"/>
    19    
    2012    <!-- IMPORT OTHER ANT SCRIPTS -->
    2113    <import file="${rk.home}/shared/core/ant-scripts/shared.xml"/>
     
    2315
    2416    <!-- figure out where the compiled software is coming from -->
    25     <property name="software.archive.linux"                     value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-linux.tar.gz"/>
    26     <property name="software.archive.windows"                   value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-windows.tar.gz"/>
    27     <property name="software.archive.mac"                       value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-mac.tar.gz"/>
    28     <property name="software.archive.documented-examples"       value="http://www.greenstone.org/caveat-emptor/Greenstone-documented-examples-${version}-candidate-${date}.tar.gz"/>
    29 
    30     <target name="cdrk2-init">
     17    <property name="software.archive.linux"
     18        value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-linux.tar.gz"/>
     19    <property name="software.archive.windows"
     20        value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-windows.tar.gz"/>
     21    <property name="software.archive.mac"
     22        value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-mac.tar.gz"/>
     23    <property name="software.archive.documented-examples"
     24        value="http://www.greenstone.org/caveat-emptor/Greenstone-documented-examples-${version}-candidate-${date}.tar.gz"/>
     25
     26
     27    <!-- THE MAIN TARGET -->
     28    <target name="cdrk2" depends="init">
     29
     30        <!-- show the properties we're using -->
    3131        <echo message="software.archive.linux:                    ${software.archive.linux}"/>
    3232        <echo message="software.archive.windows:                  ${software.archive.windows}"/>
    3333        <echo message="software.archive.mac:                      ${software.archive.mac}"/>
    3434        <echo message="software.archive.documented-examples:      ${software.archive.documented-examples}"/>
    35     </target>
    36 
    37 
    38     <!-- THE MAIN TARGET -->
    39     <target name="cdrk2" depends="init,cdrk2-init">
    40         <antcall target="checkout-and-compile-documentation"/>
    41         <antcall target="build-tutorials"/>
    42         <antcall target="build-documentation"/>
    43         <antcall target="insert-documented-examples"/>
    44         <antcall target="insert-readmes"/>
    45         <antcall target="insert-software"/>
    46         <antcall target="create-autorun"/>
    47         <antcall target="create-image"/>
    48     </target>
    49 
    50     <target name="properties">
    51         <echo>Required Properties:</echo>
    52         <echo>version                                     the version string for the release</echo>
    53         <echo/>
    54         <echo>Optional Properties:</echo>
    55         <echo>software.archive.linux                      the URL to the linux archive of components</echo>
    56         <echo>software.archive.windows                    the URL to the windows archive of components</echo>
    57         <echo>software.archive.mac                        the URL to the mac archive of components</echo>
    58         <echo>software.archive.documented-examples        the URL to the archive of documented examples</echo>
    59         <echo/>
    60     </target>
    61 
    62     <target name="checkout-and-compile-documentation">
     35
     36        <!-- create a directory for the cdrom contents -->
     37        <mkdir dir="cdrom"/>
     38
     39        <!-- checkout and compile documentation java/fop code -->
    6340        <exec executable="svn">
    6441            <arg value="export"/>
     
    7047        </javac>
    7148
    72     </target>
    73 
    74     <target name="build-tutorials">
    75 
     49        <!-- checkout tutorials and build them -->
    7650        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/tutorials"/><arg value="documentation/tutorials"/></exec>
    7751        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/main/${branch.path}/gli"/><arg value="documentation/gli"/></exec>
     
    7953        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/main/${branch.path}/greenstone2/macros"/><arg value="documentation/macros"/></exec>
    8054        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/tutorial_sample_files"/><arg value="documentation/tutorial_sample_files"/></exec>
    81 
    8255        <delete dir="documentation/tutorials/html"/>
    8356        <exec dir="documentation/tutorials" executable="/bin/bash">
     
    8558            <env key="GSDLHOME" value="${basedir}/documentation"/>
    8659        </exec>
    87 
    8860        <delete dir="cdrom/Tutorial Exercises"/>
    8961        <mkdir dir="cdrom/Tutorial Exercises/sample_files"/>
    9062
    91         <!-- tutorial html -->
     63        <!-- copy tutorial html into place on the cd -->
    9264        <copy todir="cdrom/Tutorial Exercises/English"><fileset dir="documentation/tutorials/html/en"/></copy>
    9365        <copy todir="cdrom/Tutorial Exercises/French"><fileset dir="documentation/tutorials/html/fr"/></copy>
     
    9567        <copy todir="cdrom/Tutorial Exercises/Russian"><fileset dir="documentation/tutorials/html/ru"/></copy>
    9668
    97         <!-- sample files -->
     69        <!-- create tutorial sample files zips in place on the cdrom -->
    9870        <zip destfile="cdrom/Tutorial Exercises/sample_files/beatles.zip" basedir="documentation/tutorial_sample_files/beatles"/>
    9971        <zip destfile="cdrom/Tutorial Exercises/sample_files/custom.zip" basedir="documentation/tutorial_sample_files/custom"/>
     
    10981        <zip destfile="cdrom/Tutorial Exercises/sample_files/Word_and_PDF.zip" basedir="documentation/tutorial_sample_files/Word_and_PDF"/>
    11082
    111     </target>
    112 
    113     <target name="build-documentation">
    114        
     83        <!-- checkout manuals ad build them -->
    11584        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/manuals"/><arg value="documentation/manuals"/></exec>
    11685        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/shared"/><arg value="documentation/shared"/></exec>
     
    138107        </exec>
    139108
     109        <!-- put manuals in place on cdrom -->
    140110        <delete dir="cdrom/Documentation"/>
    141111        <copy todir="cdrom/Documentation/English"><fileset dir="documentation/manuals/build/en/pdf"/></copy>
     
    145115        <copy todir="cdrom/Documentation/Arabic"><fileset dir="documentation/manuals/build/ar/pdf"/></copy>
    146116
    147         <!-- top it off with a few more -->
     117        <!-- top off manuals with a few more from the web -->
    148118        <get src="http://wiki.greenstone.org/wiki/gsdoc/others/CDS-ISIS_to_DL.pdf" dest="cdrom/Documentation/English/CDS-ISIS_to_DL.pdf"/>
    149119        <get src="http://www.greenstone.org/docs/inside_greenstone.pdf" dest="cdrom/Documentation/English/inside_greenstone.pdf"/>
     
    165135        <get src="http://prdownloads.sourceforge.net/greenstone/Paper-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/Paper-2.39-kz.pdf"/>
    166136
    167 
    168     </target>
    169 
    170     <target name="insert-documented-examples">
    171         <antcall target="download-documented-examples"/>
    172         <antcall target="untar-documented-examples"/>
    173     </target>
    174 
    175     <target name="download-documented-examples">
    176         <!-- download the documented examples -->
     137        <!-- insert the documented examples onto cdrom -->
    177138        <mkdir dir="archives"/>
    178139        <get src="${software.archive.documented-examples}" dest="archives/documented-examples.tar.gz"/>
    179     </target>
    180 
    181     <target name="untar-documented-examples">
    182         <!-- create Document Examples folder -->
    183         <!-- insert the documented examples -->
    184140        <delete dir="cdrom/Documented Examples"/>
    185141        <copy toDir="cdrom">
    186             <fileset dir="${cdrk2.home}/resources">
     142            <fileset dir="${rk.home}/kits/${rk.name}/resources">
    187143                <include name="Documented Examples/**/*"/>
    188144                <include name="Documented Examples"/>
     
    190146        </copy>
    191147        <exec executable="tar" dir="cdrom/Documented Examples"><arg value="-xzf"/><arg value="../../archives/documented-examples.tar.gz"/></exec>
     148
     149        <!-- insert readmes -->
     150        <copy todir="cdrom"><fileset dir="${rk.home}/greenstone2/docs"/></copy>
     151        <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${basedir}/cdrom"/></antcall>
     152
     153        <!-- insert linux software -->
     154        <mkdir dir="cdrom"/>
     155        <mkdir dir="archives"/>
     156        <get src="${software.archive.linux}" dest="archives/linux.tar.gz"/>
     157        <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/linux.tar.gz"/></exec>
     158
     159        <!-- insert windows software -->
     160        <mkdir dir="cdrom"/>
     161        <mkdir dir="archives"/>
     162        <get src="${software.archive.windows}" dest="archives/windows.tar.gz"/>
     163        <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/windows.tar.gz"/></exec>
     164
     165        <!-- insert mac software -->
     166        <mkdir dir="cdrom"/>
     167        <mkdir dir="archives"/>
     168        <get src="${software.archive.mac}" dest="archives/mac.tar.gz"/>
     169        <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/mac.tar.gz"/></exec>
     170
     171        <!-- create autorun (windows) -->
     172        <exec executable="cp">
     173            <arg value="${rk.home}/kits/${rk.name}/resources/AUTORUN.INF"/>
     174            <arg value="cdrom"/>
     175        </exec>
     176
     177        <!-- finally create the cdrom image -->
     178        <mkdir dir="products"/>
     179        <exec executable="mkisofs">
     180            <arg value="-V"/>
     181            <arg value="Greenstone-${version}"/>
     182            <arg value="-input-charset"/>
     183            <arg value="utf-8"/>
     184            <arg value="-o"/>
     185            <arg value="products/Greenstone-${version}-cdrom.iso"/>
     186            <arg value="-J"/>
     187            <arg value="-R"/>
     188            <arg value="-D"/>
     189            <arg value="cdrom"/>
     190        </exec>
     191        <exec executable="/bin/bash" dir="products">
     192            <arg value="-c"/>
     193            <arg value="cat Greenstone-${version}-cdrom.iso | gzip > Greenstone-${version}-cdrom.iso.gz"/>
     194        </exec>
     195        <exec executable="/bin/bash" dir="products">
     196            <arg value="-c"/>
     197            <arg value="zip Greenstone-${version}-cdrom.zip Greenstone-${version}-cdrom.iso"/>
     198        </exec>
     199
    192200    </target>
    193201
    194 
     202    <target name="properties" depends="core-properties">
     203        <echo>Optional Properties:</echo>
     204        <echo>software.archive.linux                      the URL to the linux archive of components</echo>
     205        <echo>software.archive.windows                    the URL to the windows archive of components</echo>
     206        <echo>software.archive.mac                        the URL to the mac archive of components</echo>
     207        <echo>software.archive.documented-examples        the URL to the archive of documented examples</echo>
     208        <echo/>
     209    </target>
     210
     211    <!-- target to generate the manual chapter about gli in a given language -->
    195212    <target name="generate-gli-chapter">
    196213        <path id="documentation.compile.classpath">
     
    211228    </target>
    212229
    213     <target name="insert-readmes">
    214         <copy todir="cdrom"><fileset dir="${rk.home}/greenstone2/docs"/></copy>
    215         <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${basedir}/cdrom"/></antcall>
    216     </target>
    217 
    218     <target name="insert-software">
    219         <antcall target="insert-software-linux"/>
    220         <antcall target="insert-software-windows"/>
    221         <antcall target="insert-software-mac"/>
    222     </target>
    223 
    224     <target name="insert-software-linux">
    225         <mkdir dir="cdrom"/>
    226         <mkdir dir="archives"/>
    227         <get src="${software.archive.linux}" dest="archives/linux.tar.gz"/>
    228         <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/linux.tar.gz"/></exec>
    229     </target>
    230 
    231     <target name="insert-software-windows">
    232         <mkdir dir="cdrom"/>
    233         <mkdir dir="archives"/>
    234         <get src="${software.archive.windows}" dest="archives/windows.tar.gz"/>
    235         <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/windows.tar.gz"/></exec>
    236     </target>
    237 
    238     <target name="insert-software-mac">
    239         <mkdir dir="cdrom"/>
    240         <mkdir dir="archives"/>
    241         <get src="${software.archive.mac}" dest="archives/mac.tar.gz"/>
    242         <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/mac.tar.gz"/></exec>
    243     </target>
    244 
    245     <target name="create-autorun">
    246         <exec executable="cp">
    247             <arg value="${cdrk2.home}/resources/AUTORUN.INF"/>
    248             <arg value="cdrom"/>
    249         </exec>
    250     </target>
    251 
    252     <target name="create-image">
    253 
    254         <mkdir dir="products"/>
    255 
    256         <exec executable="mkisofs">
    257             <arg value="-V"/>
    258             <arg value="Greenstone-${version}"/>
    259             <arg value="-input-charset"/>
    260             <arg value="utf-8"/>
    261             <arg value="-o"/>
    262             <arg value="products/Greenstone-${version}-cdrom.iso"/>
    263             <arg value="-J"/>
    264             <arg value="-R"/>
    265             <arg value="-D"/>
    266             <arg value="cdrom"/>
    267         </exec>
    268 
    269         <exec executable="/bin/bash" dir="products">
    270             <arg value="-c"/>
    271             <arg value="cat Greenstone-${version}-cdrom.iso | gzip > Greenstone-${version}-cdrom.iso.gz"/>
    272         </exec>
    273 
    274         <exec executable="/bin/bash" dir="products">
    275             <arg value="-c"/>
    276             <arg value="zip Greenstone-${version}-cdrom.zip Greenstone-${version}-cdrom.iso"/>
    277         </exec>
    278 
    279     </target>
    280 
    281230</project>
Note: See TracChangeset for help on using the changeset viewer.