[20721] | 1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
| 2 | <project name="rk2-create-cdrom-components" default="create-cdrom-components">
|
---|
| 3 |
|
---|
[21311] | 4 | <!--
|
---|
| 5 | cd components
|
---|
| 6 | produce components for cdrom distributions, to be picked up and used by cdrk2 release kit
|
---|
| 7 | split components into linux only files (linux) and general files (all)
|
---|
| 8 | -->
|
---|
| 9 |
|
---|
[21521] | 10 | <target name="create-cdrom-components" depends="init,gs2-init">
|
---|
[21311] | 11 | <antcall target="compile-cdrom-installer"/> <!-- from init -->
|
---|
| 12 |
|
---|
| 13 | <!-- clean up -->
|
---|
| 14 | <delete dir="cdrom"/>
|
---|
| 15 |
|
---|
| 16 | <!-- setup directory structure -->
|
---|
| 17 | <mkdir dir="cdrom/build"/>
|
---|
| 18 | <mkdir dir="cdrom/dist/Software"/>
|
---|
| 19 | <mkdir dir="cdrom/dist/Java/Jars"/>
|
---|
| 20 |
|
---|
| 21 | <!-- create core component -->
|
---|
| 22 | <mkdir dir="cdrom/dist/Software/core/all"/>
|
---|
| 23 | <mkdir dir="cdrom/dist/Software/core/${rk.os}"/>
|
---|
| 24 |
|
---|
[22093] | 25 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
| 26 | <mkdir dir="cdrom/dist/Software/core/full-windows"/>
|
---|
| 27 | </if>
|
---|
| 28 |
|
---|
[21311] | 29 | <!-- core linux -->
|
---|
| 30 | <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
[21521] | 31 | <unzip src="components/core.comp" dest="cdrom/dist/Software/core/all" overwrite="true"/>
|
---|
[21311] | 32 | <move todir="cdrom/dist/Software/core/linux" overwrite="true">
|
---|
| 33 | <fileset dir="cdrom/dist/Software/core/all">
|
---|
| 34 | <include name="bin/linux"/>
|
---|
| 35 | <include name="bin/linux/**/*"/>
|
---|
| 36 | <include name="bin/windows"/>
|
---|
| 37 | <include name="bin/windows/**/*"/>
|
---|
| 38 | <include name="cgi-bin/library.cgi"/>
|
---|
| 39 | <include name="cgi-bin/oaiserver.cgi"/>
|
---|
| 40 | <include name="*.sh"/>
|
---|
| 41 | <include name="*.csh"/>
|
---|
| 42 | <include name="*.bash"/>
|
---|
| 43 | </fileset>
|
---|
| 44 | </move>
|
---|
| 45 | <!-- delete the apache manual to save space -->
|
---|
| 46 | <delete dir="cdrom/dist/Software/core/linux/apache-httpd/linux/manual"/>
|
---|
| 47 |
|
---|
| 48 | <!-- core windows -->
|
---|
| 49 | <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
[21521] | 50 | <unzip src="components/core.comp" dest="cdrom/dist/Software/core/windows" overwrite="true">
|
---|
| 51 | <patternset>
|
---|
[21311] | 52 | <include name="bin/windows"/>
|
---|
[22093] | 53 | <include name="bin/windows/**/*"/>
|
---|
[21311] | 54 | <include name="server.exe"/>
|
---|
| 55 | <include name="cgi-bin/library.cgi"/>
|
---|
| 56 | <include name="cgi-bin/oaiserver.cgi"/>
|
---|
| 57 | <include name="*.bat"/>
|
---|
[24119] | 58 | <include name="gli/*.bat"/>
|
---|
| 59 | <include name="uninstall/*.bat"/>
|
---|
| 60 | <include name="uninstall/*.uninstall"/>
|
---|
[21521] | 61 | </patternset>
|
---|
| 62 | </unzip>
|
---|
[21311] | 63 |
|
---|
[22093] | 64 | <unzip src="components/core.comp" dest="cdrom/dist/Software/core/full-windows" overwrite="true"/>
|
---|
| 65 |
|
---|
[21311] | 66 | <!-- core mac -->
|
---|
| 67 | <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
|
---|
[21521] | 68 | <unzip src="components/core.comp" dest="cdrom/dist/Software/core/mac" overwrite="true">
|
---|
| 69 | <patternset>
|
---|
[21311] | 70 | <include name="bin/darwin"/>
|
---|
| 71 | <include name="bin/darwin/**/*"/>
|
---|
| 72 | <include name="bin/windows"/>
|
---|
| 73 | <include name="bin/windows/**/*"/>
|
---|
| 74 | <include name="cgi-bin/library.cgi"/>
|
---|
| 75 | <include name="cgi-bin/oaiserver.cgi"/>
|
---|
| 76 | <include name="*.sh"/>
|
---|
| 77 | <include name="*.csh"/>
|
---|
| 78 | <include name="*.bash"/>
|
---|
[21521] | 79 | </patternset>
|
---|
| 80 | </unzip>
|
---|
[21311] | 81 | <!-- delete the httpd manual to save space -->
|
---|
| 82 | <delete dir="cdrom/dist/Software/core/mac/apache-httpd/darwin/manual"/>
|
---|
| 83 |
|
---|
| 84 | </if></else></if></else></if>
|
---|
| 85 |
|
---|
| 86 | <!-- imagemagick -->
|
---|
| 87 | <mkdir dir="cdrom/dist/Software/imagemagick/${rk.os}"/>
|
---|
[21521] | 88 | <unzip src="components/imagemagick.comp" dest="cdrom/dist/Software/imagemagick/${rk.os}" overwrite="true"/>
|
---|
[21311] | 89 |
|
---|
| 90 | <!-- ghostscript: windows and mac only -->
|
---|
| 91 | <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
|
---|
| 92 | <mkdir dir="cdrom/dist/Software/ghostscript/${rk.os}"/>
|
---|
[21521] | 93 | <unzip src="components/ghostscript.comp" dest="cdrom/dist/Software/ghostscript/${rk.os}" overwrite="true"/>
|
---|
[21311] | 94 | </if>
|
---|
[22325] | 95 |
|
---|
| 96 | <!-- apache httpd -->
|
---|
| 97 | <unzip src="components/apachehttpd.comp" dest="cdrom/dist/Software" overwrite="true"/>
|
---|
| 98 |
|
---|
[21311] | 99 | <!-- jre linux -->
|
---|
| 100 | <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
| 101 | <mkdir dir="cdrom/dist/Java/Linux"/>
|
---|
| 102 | <exec executable="cp">
|
---|
[23535] | 103 | <arg value="${rk.home}/shared/linux/jre_bin${extension_x64}"/>
|
---|
[21311] | 104 | <arg value="cdrom/dist/Java/Linux"/>
|
---|
| 105 | </exec>
|
---|
| 106 | <!--
|
---|
| 107 | don't extract to save space
|
---|
[21394] | 108 | <exec dir="cdrom/dist/Java/Linux" executable="${rk.home}/shared/linux/jre_bin"/>
|
---|
[21311] | 109 | <exec dir="cdrom/dist/Java/Linux" executable="tar"><arg value="-xf"/><arg value="jre.tar"/></exec>
|
---|
| 110 | <delete file="cdrom/dist/Java/Linux/jre.tar"/>
|
---|
| 111 | -->
|
---|
[21623] | 112 |
|
---|
[21311] | 113 | <!-- jre windows -->
|
---|
| 114 | <else><if><bool><or><equals arg1="${rk.os}" arg2="windows"/></or></bool>
|
---|
| 115 | <mkdir dir="cdrom/dist/Java/Windows"/>
|
---|
[21394] | 116 | <exec dir="cdrom/dist/Java/Windows" executable="${rk.home}/shared/windows/wrapper/jre.exe"/>
|
---|
[21311] | 117 |
|
---|
| 118 | </if></else></if>
|
---|
| 119 |
|
---|
| 120 | <!-- jar installer: windows and linux only -->
|
---|
| 121 | <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
|
---|
| 122 | <copy file="installer/cdrom.jar" tofile="cdrom/dist/Java/Jars/${rk.os}.jar"/>
|
---|
| 123 | </if>
|
---|
| 124 |
|
---|
[21623] | 125 | <!-- compile cdrom wrapper -->
|
---|
| 126 | <!-- (windows) -->
|
---|
[20721] | 127 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
[21521] | 128 | <copy todir="cdrom/build" overwrite="true">
|
---|
| 129 | <fileset dir="${rk.home}/shared/windows/wrapper"/>
|
---|
[21725] | 130 | <fileset dir="${rk.home}/shared/core/icon" includes="icon.ico"/>
|
---|
[21521] | 131 | <fileset dir="${rk.home}/shared/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/>
|
---|
| 132 | </copy>
|
---|
[21311] | 133 | <exec executable="rc" dir="cdrom/build">
|
---|
| 134 | <arg line="wrapper.rc"/>
|
---|
| 135 | </exec>
|
---|
| 136 | <exec executable="cl" dir="cdrom/build">
|
---|
| 137 | <arg line="/c -GX -DCDROM wrapper.cpp"/>
|
---|
| 138 | </exec>
|
---|
| 139 | <exec executable="link" dir="cdrom/build">
|
---|
[23493] | 140 | <arg line="/OUT:../dist/Greenstone-${version}${version-extra}-windows.exe gdi32.lib advapi32.lib shell32.lib user32.lib wrapper.obj wrapper.RES"/>
|
---|
[21311] | 141 | </exec>
|
---|
[20721] | 142 |
|
---|
[21623] | 143 | <!-- (linux) -->
|
---|
[20721] | 144 | <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
[21593] | 145 | <copy file="${rk.home}/shared/linux/wrapper.cpp" todir="cdrom/build" overwrite="true"/>
|
---|
[20721] | 146 |
|
---|
[21311] | 147 | <echo level="info">compile the cdrom wrapper</echo>
|
---|
| 148 | <exec executable="g++" dir="cdrom/build">
|
---|
| 149 | <arg line="-Wall -static -static-libgcc -c -DCDROM -o wrapper.o wrapper.cpp"/>
|
---|
| 150 | </exec>
|
---|
| 151 |
|
---|
| 152 | <echo level="info">link the compiled code</echo>
|
---|
| 153 | <exec executable="g++" dir="cdrom/build">
|
---|
[23493] | 154 | <arg line="-static -static-libgcc -o ../dist/Greenstone-${version}${version-extra}-linux wrapper.o"/>
|
---|
[21311] | 155 | </exec>
|
---|
| 156 |
|
---|
[21623] | 157 | <!-- (mac) -->
|
---|
[20721] | 158 | <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
|
---|
| 159 |
|
---|
[21311] | 160 | <mkdir dir="wrapped-installer/cdrom"/>
|
---|
| 161 | <!-- create app for cdrom installer -->
|
---|
[23493] | 162 | <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app"><fileset dir="${rk.home}/shared/mac/Wrapper.app"/></copy>
|
---|
| 163 | <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Resources" file="${rk.home}/shared/core/icon/icon.icns"/>
|
---|
| 164 | <chmod file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/MacOS/JavaApplicationStub" perm="+x"/>
|
---|
[21311] | 165 |
|
---|
| 166 | <!-- copy bundled files -->
|
---|
[23493] | 167 | <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Resources/Java" file="${basedir}/installer/cdrom.jar"/>
|
---|
[21311] | 168 |
|
---|
| 169 | <!-- substitute in real values -->
|
---|
[23493] | 170 | <rsr file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Info.plist" pattern="@jar@" replacement="cdrom.jar"/>
|
---|
| 171 | <rsr file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
|
---|
[21311] | 172 |
|
---|
[20721] | 173 | </if></else></if></else></if>
|
---|
| 174 |
|
---|
| 175 |
|
---|
[21623] | 176 | <!-- create cdrom components -archive -->
|
---|
[21311] | 177 | <mkdir dir="products"/>
|
---|
[21623] | 178 | <!-- (windows) -->
|
---|
[21311] | 179 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
[23493] | 180 | <tar destfile="products/cdrom-components-${version}${version-extra}-windows.tar.gz" compression="gzip">
|
---|
[22093] | 181 | <tarfileset dir="cdrom/dist">
|
---|
[22116] | 182 | <include name="**/*"/>
|
---|
| 183 | <exclude name="**/full-windows"/>
|
---|
| 184 | <exclude name="**/full-windows/**/*"/>
|
---|
[22093] | 185 | </tarfileset>
|
---|
[21311] | 186 | </tar>
|
---|
[23493] | 187 | <tar destfile="products/cdrom-components-${version}${version-extra}-full-windows.tar.gz" compression="gzip">
|
---|
[22093] | 188 | <tarfileset dir="cdrom/dist">
|
---|
[22116] | 189 | <include name="**/*"/>
|
---|
[22161] | 190 | <exclude name="**/Software/core/windows"/>
|
---|
| 191 | <exclude name="**/Software/core/windows/**/*"/>
|
---|
[22093] | 192 | </tarfileset>
|
---|
| 193 | </tar>
|
---|
[21311] | 194 |
|
---|
[21623] | 195 | <!-- (linux and mac) -->
|
---|
[21311] | 196 | <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
|
---|
| 197 | <exec dir="cdrom/dist" executable="bash">
|
---|
| 198 | <arg value="-c"/>
|
---|
[23535] | 199 | <arg value="tar -czf ../../products/cdrom-components-${version}${version-extra}-${rk.os}${extension-x64}.tar.gz *"/>
|
---|
[21311] | 200 | </exec>
|
---|
| 201 | </if></else></if>
|
---|
| 202 | </target>
|
---|
| 203 |
|
---|
[20721] | 204 | </project>
|
---|