Changeset 15142 for release-kits/lirk3
- Timestamp:
- 2008-03-28T12:43:46+13:00 (16 years ago)
- Location:
- release-kits/lirk3
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
release-kits/lirk3/ant-scripts/compile.xml
r14982 r15142 199 199 <target name="rtftohtml-add-static"> 200 200 <if><bool><istrue value="${execute}"/></bool> 201 <rsr file="greenstone3/gs2build/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml .{2}EXEEXT.{1}" replacement="-o rtftohtml\$(EXEEXT)-static" />201 <rsr file="greenstone3/gs2build/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" /> 202 202 </if> 203 203 </target> -
release-kits/lirk3/ant-scripts/create-installer.xml
r14982 r15142 12 12 13 13 <target name="create-installer"> 14 <addressedcall target="setup-for-installer-creation"/> 15 <addressedcall target="compile-installer"/> 16 <addressedcall target="clean-up-after-installer-creation"/> 17 </target> 18 19 <target name="setup-for-installer-creation"> 14 20 <if><bool><istrue value="${execute}"/></bool> 15 21 16 <echo>Project Path: ${ project.path}</echo>22 <echo>Project Path: ${basedir}/distribution/greenstone3</echo> 17 23 <mkdir dir="${basedir}/installer"/> 24 <copy todir="${basedir}/installer" file="${lirk3.home}/installer/antinstall-config.xml"/> 25 <copy todir="${basedir}/installer" file="${lirk3.home}/installer/build.xml"/> 26 <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@version@" replacement="${version}"/> 27 <rsr file="${basedir}/installer/build.xml" pattern="@java.extracted@" replacement="${java.extracted}"/> 28 29 </if> 30 </target> 31 32 <target name="compile-installer"> 33 <if><bool><istrue value="${execute}"/></bool> 34 18 35 <installer file="${basedir}/installer/greenstone3.jar" 19 36 compress="true" 20 37 extractType="NonExtractor" 21 installConfig="${ project.installer.path}/antinstall-config.xml"22 buildFile="${ project.installer.path}/build.xml"23 antInstallLib="${ ant.installer.home}/lib"24 antLib="${ ant.installer.home}/antlib"38 installConfig="${basedir}/installer/antinstall-config.xml" 39 buildFile="${basedir}/installer/build.xml" 40 antInstallLib="${lirk3.home}/bin/ant-installer/lib" 41 antLib="${lirk3.home}/bin/ant-installer/antlib" 25 42 validateConfig="true" 26 43 icons="bluecurve"> 27 44 28 45 <!-- copy all the important files into the archive to be extracted for install --> 29 <zipfileset dir="${ project.installer.path}/cp" includes="resources/*"/>46 <zipfileset dir="${lirk3.home}/installer/cp" includes="resources/*"/> 30 47 <zipfileset dir="${lirk3.home}/ant-scripts/tasks/orans"><include name="RegexSearchReplace.class"/></zipfileset> 31 48 32 <zipfileset dir="${ project.path}" includes="*"/>33 <zipfileset dir="${ project.path}/bin" prefix="bin"><include name="**/*"/></zipfileset>34 <zipfileset dir="${ project.path}/docs" prefix="docs"><include name="**/*"/></zipfileset>35 <zipfileset dir="${ project.path}/gli" prefix="gli"><include name="**/*"/></zipfileset>36 <zipfileset dir="${ project.path}/gs2build" prefix="gs2build"><include name="**/*"/></zipfileset>37 <zipfileset dir="${ project.path}/lib" prefix="lib"><include name="**/*"/></zipfileset>38 <zipfileset dir="${ project.path}/web" prefix="web"><include name="**/*"/></zipfileset>39 <zipfileset dir="${ project.path}/packages" prefix="packages"><include name="**/*"/></zipfileset>40 <zipfileset dir="${ project.path}/resources" prefix="resources"><include name="**/*"/></zipfileset>41 <zipfileset dir="${ project.path}/src" prefix="src"><include name="**/*"/></zipfileset>49 <zipfileset dir="${basedir}/distribution/greenstone3" includes="*"/> 50 <zipfileset dir="${basedir}/distribution/greenstone3/bin" prefix="bin"><include name="**/*"/></zipfileset> 51 <zipfileset dir="${basedir}/distribution/greenstone3/docs" prefix="docs"><include name="**/*"/></zipfileset> 52 <zipfileset dir="${basedir}/distribution/greenstone3/gli" prefix="gli"><include name="**/*"/></zipfileset> 53 <zipfileset dir="${basedir}/distribution/greenstone3/gs2build" prefix="gs2build"><include name="**/*"/></zipfileset> 54 <zipfileset dir="${basedir}/distribution/greenstone3/lib" prefix="lib"><include name="**/*"/></zipfileset> 55 <zipfileset dir="${basedir}/distribution/greenstone3/web" prefix="web"><include name="**/*"/></zipfileset> 56 <zipfileset dir="${basedir}/distribution/greenstone3/packages" prefix="packages"><include name="**/*"/></zipfileset> 57 <zipfileset dir="${basedir}/distribution/greenstone3/resources" prefix="resources"><include name="**/*"/></zipfileset> 58 <zipfileset dir="${basedir}/distribution/greenstone3/src" prefix="src"><include name="**/*"/></zipfileset> 42 59 </installer> 43 60 … … 45 62 </target> 46 63 64 <target name="clean-up-after-installer-creation"> 65 <if><bool><istrue value="${execute}"/></bool> 66 <delete file="${basedir}/installer/antinstall-config.xml"/> 67 <delete file="${basedir}/installer/build.xml"/> 68 </if> 69 </target> 70 71 47 72 </project> -
release-kits/lirk3/ant-scripts/init.xml
r14982 r15142 38 38 <property file="build.properties" /> 39 39 40 <!-- project details (for ant-installer) -->41 <property name="project.name" value="Greenstone3"/>42 <property name="project.short.name" value="greenstone3"/>43 <property name="project.path" value="${basedir}/distribution/greenstone3"/>44 <property name="project.installer.path" value="${lirk3.home}/installer"/>45 <property name="project.version" value="${version}"/>46 <property name="ant.installer.home" value="${lirk3.home}/bin/ant-installer"/>47 48 40 <!-- somewhere to store temporary text --> 49 41 <tempfile property="temp.file" destdir="${java.io.tmpdir}" prefix="delete" suffix=".tmp"/> 42 43 <!-- bundled java strings --> 44 <!-- java.installer: use a filename which has only letters numbers and underscores --> 45 <property name="java.installer" value="jre_6u5_linux_i586"/> 46 <property name="java.extracted" value="jre1.6.0_05"/> 47 <property name="java.min.version" value="1.5.0_00"/> 48 50 49 51 50 <!-- stuff to do before all tasks --> -
release-kits/lirk3/ant-scripts/wrap.xml
r15104 r15142 3 3 <!-- 4 4 .......................................................... 5 September 20076 Greenstone3 'release maker' script7 Oran Fry5 September 2007 6 Greenstone3 'release maker' script 7 Oran Fry 8 8 .......................................................... 9 9 --> 10 10 11 11 <project name="lirk3-wrap" default="wrap"> 12 13 12 14 13 <target name="wrap"> … … 25 24 <mkdir dir="${basedir}/wrapped-installer/build"/> 26 25 <copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/wrapper/mywrapper.c"/> 26 27 <!-- copy bundled files --> 28 <copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/search4j/search4j"/> 29 <copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/wrapper/${java.installer}"/> 27 30 <copy todir="${basedir}/wrapped-installer/build" file="${basedir}/installer/greenstone3.jar"/> 31 32 <!-- substitute the real java installer filename and min version into various files --> 33 <rsr file="${basedir}/wrapped-installer/build/mywrapper.c" pattern="@java.installer@" replacement="${java.installer}"/> 34 <rsr file="${basedir}/wrapped-installer/build/mywrapper.c" pattern="@java.extracted@" replacement="${java.extracted}"/> 35 <rsr file="${basedir}/wrapped-installer/build/mywrapper.c" pattern="@java.min.version@" replacement="${java.min.version}"/> 28 36 29 37 </if> … … 37 45 <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone3_jar_start=greenstone3jar --readonly-text greenstone3.jar greenstone3.jar.o"/> 38 46 </exec> 47 <exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build"> 48 <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_search4j_start=search4j --readonly-text search4j search4j.o"/> 49 </exec> 50 <exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build"> 51 <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_${java.installer}_start=java --readonly-text ${java.installer} java.o"/> 52 </exec> 39 53 40 <echo level="info">create a header file declaring the bundled files and their sizes</echo> 54 55 <echo level="info">create a header file declaring bundled greenstone.jar and search4j</echo> 41 56 <delete file="mywrapper.h"/> 42 57 43 58 <!-- greenstone.jar --> 44 <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone3.jar.ls"> 45 <arg line="-l greenstone3.jar"/> 46 </exec> 47 <!--<echo level="info">ls: ${greenstone3.jar.ls}</echo>--> 48 <exec executable="sed" inputstring="${greenstone3.jar.ls}" outputproperty="greenstone3.jar.size"> 49 <arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/> 50 </exec> 51 <!--<echo level="info">size: ${greenstone3.jar.size}</echo>--> 52 <exec executable="echo" output="${basedir}/wrapped-installer/build/mywrapper.h"> 53 <arg line="extern const char greenstone3jar[${greenstone3.jar.size}];"/> 54 </exec> 59 <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone3.jar.ls"><arg line="-l greenstone3.jar"/></exec> 60 <exec executable="sed" inputstring="${greenstone3.jar.ls}" outputproperty="greenstone3.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec> 61 <exec executable="echo" output="${basedir}/wrapped-installer/build/mywrapper.h"><arg line="extern const char greenstone3jar[${greenstone3.jar.size}];"/></exec> 62 63 <!-- search4j --> 64 <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="search4j.ls"><arg line="-l search4j"/></exec> 65 <exec executable="sed" inputstring="${search4j.ls}" outputproperty="search4j.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec> 66 <exec executable="echo" output="${basedir}/wrapped-installer/build/mywrapper.h" append="true"><arg line="extern const char search4j[${search4j.size}];"/></exec> 67 55 68 56 69 <echo level="info">compile the wrapper program</echo> … … 61 74 <echo level="info">link, bundling the files to be bundled</echo> 62 75 <exec executable="g++" dir="${basedir}/wrapped-installer/build"> 63 <arg line="-static -static-libgcc -o ../greenstone-${version}-linux.bin mywrapper.o greenstone3.jar.o "/>76 <arg line="-static -static-libgcc -o ../greenstone-${version}-linux.bin mywrapper.o greenstone3.jar.o search4j.o"/> 64 77 </exec> 78 79 80 <echo level="info">add java to the header file</echo> 81 <!-- java --> 82 <exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="java.ls"><arg line="-l ${java.installer}"/></exec> 83 <exec executable="sed" inputstring="${java.ls}" outputproperty="java.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec> 84 <exec executable="echo" output="${basedir}/wrapped-installer/build/mywrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec> 85 <exec executable="echo" output="${basedir}/wrapped-installer/build/mywrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec> 86 87 <echo level="info">recompile the wrapper program</echo> 88 <exec executable="g++" dir="${basedir}/wrapped-installer/build"> 89 <arg line="-Wall -static -static-libgcc -c -o mywrapper.o mywrapper.c"/> 90 </exec> 91 92 <echo level="info">relink, bundling the files to be bundled</echo> 93 <exec executable="g++" dir="${basedir}/wrapped-installer/build"> 94 <arg line="-static -static-libgcc -o ../greenstone-${version}-linux-with-jre.bin mywrapper.o greenstone3.jar.o search4j.o java.o"/> 95 </exec> 96 97 65 98 66 99 </if> -
release-kits/lirk3/bin/lirk3
r15097 r15142 84 84 85 85 #echo $toexec 86 echo "LiRK3" 86 echo "O---------------------------------------O" 87 echo "| |" 88 echo "| LiRK3 |" 89 echo "| Linux Release Kit for Greenstone3 |" 90 echo "| |" 91 echo "O---------------------------------------O" 87 92 echo " Ant Script: $LIRK3_HOME/ant-scripts/build.xml" 88 93 echo " Basedir: `pwd`" -
release-kits/lirk3/installer/antinstall-config.xml
r15097 r15142 15 15 type="input" 16 16 name="intro" 17 displayText=" 绿å®ç³èœ¯ä»¶">17 displayText="Welcome to the Greenstone3 installer"> 18 18 </page> 19 19 … … 34 34 <directory 35 35 property="installDir" 36 defaultValue="/ research/oranfry/sandbox/Greenstone3.03a"37 defaultValueWin="${env.ProgramFiles}\Greenstone 3"36 defaultValue="/usr/local/Greenstone-@version@" 37 defaultValueWin="${env.ProgramFiles}\Greenstone-@version@" 38 38 displayText="Select an installation directory" 39 39 create="true"/> … … 45 45 <comment name="tomcatportsdescription" displayText="Please select the ports which the web server (Apache Tomcat) will use will use. It is usually safe to accept the defaults by just clicking Next. The exception is when you are running other services on these ports - if this is the case, select some free ports and click Next."/> 46 46 47 <text property="tomcat.server" defaultValue="localhost" displayText="Tomcat Server"/> 47 48 <text property="tomcat.port" defaultValue="8080" displayText="Tomcat Port"/> 48 49 <text property="tomcat.shutdown.port" defaultValue="8005" displayText="Tomcat Shutdown Port"/> 50 49 51 </page> 50 52 … … 54 56 name="selector" 55 57 displayText="Components to install"> 56 <comment 57 name="choosecomponents" 58 displayText="Choose the components you want to install" 59 bold="true"/> 60 <target 61 displayText="Core components" 62 target="default" 63 defaultValue="true" 64 force="true"/> 65 66 <target 67 displayText="Source code" 68 target="tgsrc" 69 defaultValue="false"/> 70 58 59 <comment name="choosecomponents" displayText="Choose the components you want to install" bold="true"/> 60 <target displayText="Core components" target="default" defaultValue="true" force="true"/> 61 <target displayText="Source code" target="tgsrc" defaultValue="false"/> 62 71 63 </page> 72 64 -
release-kits/lirk3/installer/build.xml
r14982 r15142 4 4 --> 5 5 6 <project name="Installation" default="" basedir="${basedir}">6 <project name="Installation" default=""> 7 7 8 8 <!-- this is required to pick up the properties generated during the install pages --> … … 15 15 <!-- custom tasks --> 16 16 <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/> 17 18 <condition property="bundled.java.exists"> 19 <available file="../@java.extracted@/bin/java"/> 20 </condition> 21 17 22 18 23 <target name="default" depends=""> … … 76 81 <chmod dir="${installDir}" includes="*.sh" perm="775"/> 77 82 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/> 83 <chmod dir="${installDir}/bin" includes="*" perm="775"/> 78 84 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/> 85 <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/> 79 86 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/> 80 87 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/> … … 110 117 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" /> 111 118 112 <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH --> 113 <echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo> 119 120 <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH (no need anymore)--> 121 <!--<echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo> 114 122 <exec executable="echo" output="${installDir}/gs3-setup.sh" append="true"> 115 123 <arg line="export ANT_HOME=${installDir}/packages/ant; export PATH=$ANT_HOME/bin:$PATH;"/> 116 </exec> 124 </exec>--> 117 125 118 126 <!-- delete unneeded files --> 127 <echo message="Deleting some extraneous files"/> 119 128 <delete dir="${installDir}/resources/icons"/> 120 129 <delete file="${installDir}/resources/*.png"/> 130 131 <echo message="Finished"/> 121 132 122 133 </target> … … 133 144 </target> 134 145 135 <target name="cleanuptarget"> 146 <target name="install-bundled-java" depends="" if="bundled.java.exists"> 147 <echo message="Installing bundled java"/> 148 <copy todir="${installDir}/packages/jre"> 149 <fileset dir="../@java.extracted@"/> 150 </copy> 151 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/> 152 </target> 153 154 <target name="cleanuptarget" depends="install-bundled-java"> 136 155 </target> 137 156 -
release-kits/lirk3/wrapper/mywrapper.c
r14982 r15142 2 2 #include <fstream> 3 3 #include <iomanip> 4 4 5 using namespace std; 5 6 6 7 #include "mywrapper.h" 7 8 8 bool extract_bundled_file( const char[], int, char* );9 bool extract_bundled_file( const char[], int, char*, bool ); 9 10 10 11 int main(int argc, char** argv) { … … 12 13 string tempdir = (string)argv[0] + ".tmp"; //temporary directory where we will store extracted files 13 14 string jarfile = tempdir + "/greenstone3.jar"; //where we will store the jar file 15 string search4jfile = tempdir + "/search4j"; //where we will store the jar file 14 16 bool succeeded = false; 15 17 … … 25 27 26 28 //extract files 27 cout << "Extracting JAR file..." << endl;28 succeeded = extract_bundled_file( greenstone3jar, sizeof(greenstone3jar), (char*)jarfile.c_str() 29 cout << "Extracting installer jar..." << endl; 30 succeeded = extract_bundled_file( greenstone3jar, sizeof(greenstone3jar), (char*)jarfile.c_str(), false); 29 31 if ( !succeeded ) { 30 32 cout << "failed" << endl; 31 33 cout << "Failed to extract the JAR file to '" << jarfile << "'" << endl; 32 cout << "The JAR file may have been bundled with this executable incorrectly" << endl;33 cout << "Or this programmay not have sufficient file permissions to write it to disk" << endl;34 cout << "The file may be corrupt or missing" << endl; 35 cout << "Or this installer may not have sufficient file permissions to write it to disk" << endl; 34 36 cout << "Exiting" << endl; 35 37 return 1; 36 38 } 37 39 38 //run the jar 39 cout << "Running the jar" << endl; 40 system( ("java -jar " + jarfile).c_str() ); 40 cout << "Extracting search4j tool..." << endl; 41 succeeded = extract_bundled_file( search4j, sizeof(search4j), (char*)search4jfile.c_str(), true ); 42 if ( !succeeded ) { 43 cout << "failed" << endl; 44 cout << "Failed to extract the search4j tool to '" << jarfile << "'" << endl; 45 cout << "The file may be corrupt or missing" << endl; 46 cout << "Or this installer may not have sufficient file permissions to write it to disk" << endl; 47 cout << "Exiting" << endl; 48 return 1; 49 } 50 51 52 //change to the temp directory 53 chdir( tempdir.c_str() ); 54 55 56 //check if an appropriate java is found 57 bool jvmFound = (system( "./search4j -m @java.min.version@ -h ./@java.extracted@" ) == 0); 58 59 //if the jvm was not found, try to fix it and find it 60 if ( !jvmFound ) { 61 //did not find a good java 62 cout << "Greenstone requires java @java.min.version@ or greater" << endl; 63 64 //tell them if java is absent or just too old 65 if ( system( "./search4j -h ./@java.extracted@" ) == 0 ) { 66 cout << "Your java is too old." << endl; 67 } else { 68 cout << "Could not find java." << endl; 69 } 70 71 //is this an installer with the bundled JRE? 72 73 #ifdef java_is_bundled 74 //yes, JRE is bundled 75 cout 76 << "This installer comes bundled with a suitible version of java: " << endl 77 << " @java.installer@" << endl 78 << "Do you want to install this java? (y/n)" << endl; 79 char r[1024]; cin >> r; 80 if ( strcmp( r, "y" ) == 0 || strcmp( r, "Y" ) == 0) { 81 extract_bundled_file( java, sizeof(java), (char*)"@java.installer@", true ); 82 system( "./@java.installer@" ); 83 jvmFound = true; //assume the java installation went well 84 } 85 #endif 86 87 #ifndef java_is_bundled 88 //no, JRE is not bundled 89 cout << "Install java (@java.min.version@ or greater) and set JAVA_HOME or JRE_HOME, and try again" << endl; 90 cout << "Or, download a greentsone3 installer with bundled java and use that instead of this one" << endl; 91 #endif 92 } 93 94 //if we have found it by now, launch the installer 95 if ( jvmFound ) { 96 cout << "Launching Installer ..." << endl; 97 int launch_exit_code = 0; 98 launch_exit_code = system("./search4j -m @java.min.version@ -l greenstone3.jar -h ./@java.extracted@"); 99 100 //report how it went 101 if ( launch_exit_code == 0 ) { 102 cout << "Setup complete" << endl; 103 } else { 104 cout << "Still could not find a suitible version of java" << endl; 105 cout << "Please install java, set JAVA_HOME or JRE_HOME, and try again" << endl; 106 } 107 108 } 109 110 //change back to the original directory 111 chdir(".."); 41 112 42 113 //delete the temp files 43 114 cout << "Deleting the temp directory" << endl; 44 115 system( ("rm -rf " + tempdir).c_str() ); 45 system( "rm ant.install.log" );46 116 47 117 … … 50 120 } 51 121 52 bool extract_bundled_file( const char data[], int size, char* filename ) { 122 bool extract_bundled_file( const char data[], int size, char* filename, bool make_executable) { 123 124 if ( size == 0 ) return false; 53 125 54 126 //delete the file if it exists … … 76 148 } 77 149 150 if ( make_executable ) { 151 string command = "chmod a+x " + string(filename); 152 system( command.c_str() ); 153 } 154 78 155 return true; 79 156
Note:
See TracChangeset
for help on using the changeset viewer.