[14982] | 1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
| 2 |
|
---|
| 3 | <!--
|
---|
| 4 | ..........................................................
|
---|
| 5 | September 2007
|
---|
| 6 | Greenstone3 'release maker' script
|
---|
| 7 | Oran Fry
|
---|
| 8 | ..........................................................
|
---|
| 9 | -->
|
---|
| 10 |
|
---|
| 11 | <project name="lirk3-wrap" default="wrap">
|
---|
| 12 |
|
---|
| 13 |
|
---|
| 14 | <target name="wrap">
|
---|
| 15 | <addressedcall target="setup-for-wrapping"/>
|
---|
| 16 | <addressedcall target="compile-wrapper"/>
|
---|
| 17 | <addressedcall target="clean-up-after-wrapping"/>
|
---|
| 18 | </target>
|
---|
| 19 |
|
---|
| 20 |
|
---|
| 21 | <target name="setup-for-wrapping">
|
---|
| 22 | <if><bool><istrue value="${execute}"/></bool>
|
---|
| 23 |
|
---|
| 24 | <mkdir dir="${basedir}/wrapped-installer/build"/>
|
---|
| 25 | <copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/wrapper/mywrapper.c"/>
|
---|
| 26 | <copy todir="${basedir}/wrapped-installer/build" file="${basedir}/installer/greenstone3.jar"/>
|
---|
| 27 |
|
---|
| 28 | </if>
|
---|
| 29 | </target>
|
---|
| 30 |
|
---|
| 31 | <target name="compile-wrapper">
|
---|
| 32 | <if><bool><istrue value="${execute}"/></bool>
|
---|
| 33 |
|
---|
| 34 | <echo level="info">create an object file (extension .o) for each file to bundle</echo>
|
---|
| 35 | <exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
|
---|
| 36 | <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone3_jar_start=greenstone3jar --readonly-text greenstone3.jar greenstone3.jar.o"/>
|
---|
| 37 | </exec>
|
---|
| 38 |
|
---|
| 39 | <echo level="info">create a header file declaring the bundled files and their sizes</echo>
|
---|
| 40 | <delete file="mywrapper.h"/>
|
---|
| 41 |
|
---|
| 42 | <!-- greenstone.jar -->
|
---|
[14984] | 43 | <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone3.jar.ls">
|
---|
| 44 | <arg line="-l greenstone3.jar"/>
|
---|
[14982] | 45 | </exec>
|
---|
[14984] | 46 | <!--<echo level="info">ls: ${greenstone3.jar.ls}</echo>-->
|
---|
| 47 | <exec executable="sed" inputstring="${greenstone3.jar.ls}" outputproperty="greenstone3.jar.size">
|
---|
| 48 | <arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/>
|
---|
[14982] | 49 | </exec>
|
---|
[14984] | 50 | <!--<echo level="info">size: ${greenstone3.jar.size}</echo>-->
|
---|
[14982] | 51 | <exec executable="echo" output="${basedir}/wrapped-installer/build/mywrapper.h">
|
---|
| 52 | <arg line="extern const char greenstone3jar[${greenstone3.jar.size}];"/>
|
---|
| 53 | </exec>
|
---|
| 54 |
|
---|
| 55 | <echo level="info">compile the wrapper program</echo>
|
---|
| 56 | <exec executable="g++" dir="${basedir}/wrapped-installer/build">
|
---|
| 57 | <arg line="-Wall -static -static-libgcc -c -o mywrapper.o mywrapper.c"/>
|
---|
| 58 | </exec>
|
---|
| 59 |
|
---|
| 60 | <echo level="info">link, bundling the files to be bundled</echo>
|
---|
| 61 | <exec executable="g++" dir="${basedir}/wrapped-installer/build">
|
---|
| 62 | <arg line="-static -static-libgcc -o ../greenstone-${version}-linux.bin mywrapper.o greenstone3.jar.o"/>
|
---|
| 63 | </exec>
|
---|
| 64 |
|
---|
| 65 | </if>
|
---|
| 66 | </target>
|
---|
| 67 |
|
---|
| 68 | <target name="clean-up-after-wrapping">
|
---|
| 69 | <if><bool><istrue value="${execute}"/></bool>
|
---|
| 70 | <delete dir="${basedir}/wrapped-installer/build"/>
|
---|
| 71 | </if>
|
---|
| 72 | </target>
|
---|
| 73 |
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 | </project>
|
---|