[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 |
|
---|
| 25 | <!-- core linux -->
|
---|
| 26 | <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
[21521] | 27 | <unzip src="components/core.comp" dest="cdrom/dist/Software/core/all" overwrite="true"/>
|
---|
[21311] | 28 | <move todir="cdrom/dist/Software/core/linux" overwrite="true">
|
---|
| 29 | <fileset dir="cdrom/dist/Software/core/all">
|
---|
| 30 | <include name="bin/linux"/>
|
---|
| 31 | <include name="bin/linux/**/*"/>
|
---|
| 32 | <include name="bin/windows"/>
|
---|
| 33 | <include name="bin/windows/**/*"/>
|
---|
| 34 | <include name="cgi-bin/library.cgi"/>
|
---|
| 35 | <include name="cgi-bin/oaiserver.cgi"/>
|
---|
| 36 | <include name="apache-httpd/**/*"/>
|
---|
| 37 | <include name="*.sh"/>
|
---|
| 38 | <include name="*.csh"/>
|
---|
| 39 | <include name="*.bash"/>
|
---|
| 40 | </fileset>
|
---|
| 41 | </move>
|
---|
| 42 | <!-- delete the apache manual to save space -->
|
---|
| 43 | <delete dir="cdrom/dist/Software/core/linux/apache-httpd/linux/manual"/>
|
---|
| 44 |
|
---|
| 45 | <!-- core windows -->
|
---|
| 46 | <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
[21521] | 47 | <unzip src="components/core.comp" dest="cdrom/dist/Software/core/windows" overwrite="true">
|
---|
| 48 | <patternset>
|
---|
[21311] | 49 | <include name="bin/windows"/>
|
---|
| 50 | <include name="server.exe"/>
|
---|
| 51 | <include name="bin/windows/**/*"/>
|
---|
| 52 | <include name="cgi-bin/library.cgi"/>
|
---|
| 53 | <include name="cgi-bin/oaiserver.cgi"/>
|
---|
| 54 | <include name="*.bat"/>
|
---|
| 55 | <include name="gli/*.bat"/>
|
---|
[21521] | 56 | </patternset>
|
---|
| 57 | </unzip>
|
---|
[21311] | 58 |
|
---|
| 59 | <!-- core mac -->
|
---|
| 60 | <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
|
---|
[21521] | 61 | <unzip src="components/core.comp" dest="cdrom/dist/Software/core/mac" overwrite="true">
|
---|
| 62 | <patternset>
|
---|
[21311] | 63 | <include name="bin/darwin"/>
|
---|
| 64 | <include name="bin/darwin/**/*"/>
|
---|
| 65 | <include name="bin/windows"/>
|
---|
| 66 | <include name="bin/windows/**/*"/>
|
---|
| 67 | <include name="cgi-bin/library.cgi"/>
|
---|
| 68 | <include name="cgi-bin/oaiserver.cgi"/>
|
---|
| 69 | <include name="apache-httpd"/>
|
---|
| 70 | <include name="apache-httpd/**/*"/>
|
---|
| 71 | <include name="*.sh"/>
|
---|
| 72 | <include name="*.csh"/>
|
---|
| 73 | <include name="*.bash"/>
|
---|
[21521] | 74 | </patternset>
|
---|
| 75 | </unzip>
|
---|
[21311] | 76 | <!-- delete the httpd manual to save space -->
|
---|
| 77 | <delete dir="cdrom/dist/Software/core/mac/apache-httpd/darwin/manual"/>
|
---|
| 78 |
|
---|
| 79 | </if></else></if></else></if>
|
---|
| 80 |
|
---|
| 81 | <!-- imagemagick -->
|
---|
| 82 | <mkdir dir="cdrom/dist/Software/imagemagick/${rk.os}"/>
|
---|
[21521] | 83 | <unzip src="components/imagemagick.comp" dest="cdrom/dist/Software/imagemagick/${rk.os}" overwrite="true"/>
|
---|
[21311] | 84 |
|
---|
| 85 | <!-- ghostscript: windows and mac only -->
|
---|
| 86 | <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
|
---|
| 87 | <mkdir dir="cdrom/dist/Software/ghostscript/${rk.os}"/>
|
---|
[21521] | 88 | <unzip src="components/ghostscript.comp" dest="cdrom/dist/Software/ghostscript/${rk.os}" overwrite="true"/>
|
---|
[21311] | 89 | </if>
|
---|
| 90 |
|
---|
| 91 | <!-- jre linux -->
|
---|
| 92 | <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
| 93 | <mkdir dir="cdrom/dist/Java/Linux"/>
|
---|
| 94 | <exec executable="cp">
|
---|
[21394] | 95 | <arg value="${rk.home}/shared/linux/jre_bin"/>
|
---|
[21311] | 96 | <arg value="cdrom/dist/Java/Linux"/>
|
---|
| 97 | </exec>
|
---|
| 98 | <!--
|
---|
| 99 | don't extract to save space
|
---|
[21394] | 100 | <exec dir="cdrom/dist/Java/Linux" executable="${rk.home}/shared/linux/jre_bin"/>
|
---|
[21311] | 101 | <exec dir="cdrom/dist/Java/Linux" executable="tar"><arg value="-xf"/><arg value="jre.tar"/></exec>
|
---|
| 102 | <delete file="cdrom/dist/Java/Linux/jre.tar"/>
|
---|
| 103 | -->
|
---|
[21623] | 104 |
|
---|
[21311] | 105 | <!-- jre windows -->
|
---|
| 106 | <else><if><bool><or><equals arg1="${rk.os}" arg2="windows"/></or></bool>
|
---|
| 107 | <mkdir dir="cdrom/dist/Java/Windows"/>
|
---|
[21394] | 108 | <exec dir="cdrom/dist/Java/Windows" executable="${rk.home}/shared/windows/wrapper/jre.exe"/>
|
---|
[21311] | 109 |
|
---|
| 110 | </if></else></if>
|
---|
| 111 |
|
---|
| 112 | <!-- jar installer: windows and linux only -->
|
---|
| 113 | <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
|
---|
| 114 | <copy file="installer/cdrom.jar" tofile="cdrom/dist/Java/Jars/${rk.os}.jar"/>
|
---|
| 115 | </if>
|
---|
| 116 |
|
---|
[21623] | 117 | <!-- compile cdrom wrapper -->
|
---|
| 118 | <!-- (windows) -->
|
---|
[20721] | 119 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
[21521] | 120 | <copy todir="cdrom/build" overwrite="true">
|
---|
| 121 | <fileset dir="${rk.home}/shared/windows/wrapper"/>
|
---|
| 122 | <fileset dir="${rk.home}/shared/greenstone2/wrapper" includes="*.bmp"/>
|
---|
| 123 | <fileset dir="${rk.home}/shared/greenstone2/icon" includes="icon.ico"/>
|
---|
| 124 | <fileset dir="${rk.home}/shared/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/>
|
---|
| 125 | </copy>
|
---|
[21311] | 126 | <exec executable="rc" dir="cdrom/build">
|
---|
| 127 | <arg line="wrapper.rc"/>
|
---|
| 128 | </exec>
|
---|
| 129 | <exec executable="cl" dir="cdrom/build">
|
---|
| 130 | <arg line="/c -GX -DCDROM wrapper.cpp"/>
|
---|
| 131 | </exec>
|
---|
| 132 | <exec executable="link" dir="cdrom/build">
|
---|
| 133 | <arg line="/OUT:../dist/Greenstone-${version}-windows.exe gdi32.lib advapi32.lib shell32.lib user32.lib wrapper.obj wrapper.RES"/>
|
---|
| 134 | </exec>
|
---|
[20721] | 135 |
|
---|
[21623] | 136 | <!-- (linux) -->
|
---|
[20721] | 137 | <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
[21593] | 138 | <copy file="${rk.home}/shared/linux/wrapper.cpp" todir="cdrom/build" overwrite="true"/>
|
---|
[20721] | 139 |
|
---|
[21311] | 140 | <echo level="info">compile the cdrom wrapper</echo>
|
---|
| 141 | <exec executable="g++" dir="cdrom/build">
|
---|
| 142 | <arg line="-Wall -static -static-libgcc -c -DCDROM -o wrapper.o wrapper.cpp"/>
|
---|
| 143 | </exec>
|
---|
| 144 |
|
---|
| 145 | <echo level="info">link the compiled code</echo>
|
---|
| 146 | <exec executable="g++" dir="cdrom/build">
|
---|
| 147 | <arg line="-static -static-libgcc -o ../dist/Greenstone-${version}-linux wrapper.o"/>
|
---|
| 148 | </exec>
|
---|
| 149 |
|
---|
[21623] | 150 | <!-- (mac) -->
|
---|
[20721] | 151 | <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
|
---|
| 152 |
|
---|
[21311] | 153 | <mkdir dir="wrapped-installer/cdrom"/>
|
---|
| 154 | <!-- create app for cdrom installer -->
|
---|
[21394] | 155 | <copy todir="cdrom/dist/Greenstone-${version}-MacOS.app"><fileset dir="${rk.home}/shared/mac/Wrapper.app"/></copy>
|
---|
| 156 | <copy todir="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Resources" file="${rk.home}/shared/greenstone2/icon/icon.icns"/>
|
---|
[21311] | 157 | <chmod file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/MacOS/JavaApplicationStub" perm="+x"/>
|
---|
| 158 |
|
---|
| 159 | <!-- copy bundled files -->
|
---|
| 160 | <copy todir="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Resources/Java" file="${basedir}/installer/cdrom.jar"/>
|
---|
| 161 |
|
---|
| 162 | <!-- substitute in real values -->
|
---|
| 163 | <rsr file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Info.plist" pattern="@jar@" replacement="cdrom.jar"/>
|
---|
| 164 | <rsr file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
|
---|
| 165 |
|
---|
[20721] | 166 | </if></else></if></else></if>
|
---|
| 167 |
|
---|
| 168 |
|
---|
[21623] | 169 | <!-- create cdrom components -archive -->
|
---|
[21311] | 170 | <mkdir dir="products"/>
|
---|
[21623] | 171 | <!-- (windows) -->
|
---|
[21311] | 172 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
| 173 | <tar destfile="products/cdrom-components-${version}-windows.tar.gz" compression="gzip">
|
---|
| 174 | <tarfileset dir="cdrom/dist"><include name="**/*"/></tarfileset>
|
---|
| 175 | </tar>
|
---|
| 176 |
|
---|
[21623] | 177 | <!-- (linux and mac) -->
|
---|
[21311] | 178 | <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
|
---|
| 179 | <exec dir="cdrom/dist" executable="bash">
|
---|
| 180 | <arg value="-c"/>
|
---|
| 181 | <arg value="tar -czf ../../products/cdrom-components-${version}-linux.tar.gz *"/>
|
---|
| 182 | </exec>
|
---|
| 183 | </if></else></if>
|
---|
| 184 | </target>
|
---|
| 185 |
|
---|
[20721] | 186 | </project>
|
---|