[14982] | 1 | <?xml version="1.0"?>
|
---|
| 2 | <!--
|
---|
| 3 | This is the build.xml run by AntInstaller for the installer
|
---|
| 4 | -->
|
---|
[15205] | 5 | <project name="Installation">
|
---|
[14982] | 6 |
|
---|
| 7 | <!-- this is required to pick up the properties generated during the install pages -->
|
---|
| 8 | <property file="${basedir}/ant.install.properties"/>
|
---|
| 9 |
|
---|
[19935] | 10 | <!-- custom tasks -->
|
---|
| 11 | <path id="project.classpath"><pathelement path="${antinstaller.jar}"/></path>
|
---|
[14982] | 12 |
|
---|
[17107] | 13 | <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
|
---|
[19959] | 14 | <!-- if linux|mac -->
|
---|
[17468] | 15 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
|
---|
[19959] | 16 | <!-- /if -->
|
---|
[19935] | 17 | <!-- if windows -->
|
---|
| 18 | <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
|
---|
| 19 | <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
|
---|
| 20 | <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
|
---|
| 21 | <!-- /if -->
|
---|
[14982] | 22 |
|
---|
[19935] | 23 | <!-- create a local and strictly unix installDir String -->
|
---|
| 24 | <path id="installDir.path"><pathelement location="${installDir}"/></path>
|
---|
| 25 | <property name="installDir.local" refid="installDir.path"/>
|
---|
| 26 | <pathconvert targetos="unix" property="installDir.unix" refid="installDir.path"/>
|
---|
[14982] | 27 |
|
---|
[19935] | 28 | <!-- if windows -->
|
---|
| 29 | <!-- load windows properties -->
|
---|
| 30 | <winprops/>
|
---|
| 31 | <!-- /if -->
|
---|
| 32 |
|
---|
| 33 | <!-- work out whether a jre is bundled with this installer -->
|
---|
| 34 | <available file="../jre/bin/java" property="bundled.java.exists"/>
|
---|
| 35 |
|
---|
| 36 | <!-- determine if there is an existing installation in the installDir-->
|
---|
| 37 | <available file="${installDir}\installation.properties" property="is.overinstall"/>
|
---|
| 38 |
|
---|
| 39 | <!-- target to copy the bundled jre into place -->
|
---|
[17765] | 40 | <target name="Initialising" if="bundled.java.exists">
|
---|
[17754] | 41 | <mkdir dir="${installDir}"/>
|
---|
| 42 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
[19935] | 43 | <fileset dir="../jre"/>
|
---|
[17754] | 44 | </copy>
|
---|
| 45 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
| 46 | </target>
|
---|
| 47 |
|
---|
[19935] | 48 | <!-- target to load in the messages left by the last installation -->
|
---|
| 49 | <target name="Looking For Previous Installation" if="is.overinstall">
|
---|
| 50 | <property file="${installDir}\installation.properties"/>
|
---|
| 51 | <delete dir="${installed.startmenu.path}" failonerror="false"/>
|
---|
| 52 | </target>
|
---|
| 53 |
|
---|
[17764] | 54 | <target name="Installing Core System">
|
---|
[17754] | 55 |
|
---|
[19935] | 56 | <!-- rip out build.xml to the temp dir so we can fake and <antcall> with <ant> -->
|
---|
| 57 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="build.xml"/></patternset></unzip>
|
---|
[14982] | 58 |
|
---|
| 59 |
|
---|
[19935] | 60 | <!-- if windows -->
|
---|
| 61 | <echo>Figuring out the start menu path</echo>
|
---|
| 62 | <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
|
---|
| 63 | <path id="startmenu.path.path" path="${startmenu.path}"/>
|
---|
| 64 | <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
|
---|
| 65 |
|
---|
| 66 | <echo>Extracting 7za tool</echo>
|
---|
| 67 | <unzip src="${antinstaller.jar}" dest="${basedir}">
|
---|
| 68 | <patternset><include name="7za.exe"/></patternset>
|
---|
| 69 | </unzip>
|
---|
| 70 | <!-- /if -->
|
---|
| 71 |
|
---|
| 72 | <echo>Extracting core component</echo>
|
---|
| 73 | <ant target="extract-component"><property name="component.name" value="core"/></ant>
|
---|
| 74 |
|
---|
| 75 | <echo>Setting binaries to executable</echo>
|
---|
[14982] | 76 | <chmod dir="${installDir}" includes="*.sh" perm="775"/>
|
---|
| 77 | <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
|
---|
[15142] | 78 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[19935] | 79 | <!-- if linux -->
|
---|
[14982] | 80 | <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
|
---|
[19935] | 81 | <!-- /if -->
|
---|
| 82 | <!-- if mac -->
|
---|
| 83 | <chmod dir="${installDir}/gs2build/bin/darwin" includes="*" perm="775"/>
|
---|
| 84 | <!-- /if -->
|
---|
[14982] | 85 | <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
|
---|
| 86 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
[20084] | 87 | <chmod file="${installDir}/packages/ant/bin/ant" perm="775"/>
|
---|
[19964] | 88 | <!--
|
---|
| 89 | source is not included for now
|
---|
[19953] | 90 | <chmod dir="${installDir}/gs2build" includes="**/configure" perm="775"/>
|
---|
| 91 | <chmod dir="${installDir}/gs2build/common-src/packages/gdbm/gdbm-1.8.3" includes="mkinstalldirs" perm="775"/>
|
---|
[19964] | 92 | <chmod file="${installDir}/src/packages/javagdbm/configure" perm="775"/>
|
---|
| 93 | -->
|
---|
[14982] | 94 |
|
---|
[19935] | 95 | <echo>Setting tomcat ports</echo>
|
---|
[14982] | 96 | <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
|
---|
| 97 | <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
|
---|
| 98 |
|
---|
[17123] | 99 | <echo>Setting up global properties</echo>
|
---|
[14982] | 100 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
[19935] | 101 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties">
|
---|
| 102 | <job pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
|
---|
| 103 | <job pattern="@tomcat.server@" replacement="${tomcat.server}" />
|
---|
| 104 | <job pattern="@tomcat.port@" replacement="${tomcat.port}" />
|
---|
| 105 | </rsr>
|
---|
[14982] | 106 |
|
---|
[17123] | 107 | <echo>Setting up log4j properties</echo>
|
---|
[14982] | 108 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
[19955] | 109 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
|
---|
[14982] | 110 |
|
---|
[19935] | 111 | <!-- if windows -->
|
---|
| 112 | <echo message="Setting GSDLHOME in gs2build\setup.bat"/>
|
---|
| 113 | <rsr file="${installDir}/gs2build/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}\gs2build" />
|
---|
| 114 | <!-- /if -->
|
---|
| 115 |
|
---|
[18980] | 116 | <echo>Creating the english dictionary</echo>
|
---|
| 117 | <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
|
---|
| 118 |
|
---|
[19935] | 119 | <echo>Creating usage.txt</echo>
|
---|
[17814] | 120 | <echo file="${installDir}/gs2build/etc/usage.txt"></echo>
|
---|
| 121 |
|
---|
[17257] | 122 | <echo>Creating installation properties file</echo>
|
---|
[19935] | 123 | <echo file="${installDir}\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
|
---|
[17257] | 124 |
|
---|
[17123] | 125 | <echo>Finished</echo>
|
---|
[15142] | 126 |
|
---|
[14982] | 127 | </target>
|
---|
| 128 |
|
---|
[17646] | 129 | <target name="Installing ImageMagick">
|
---|
[19935] | 130 |
|
---|
[17646] | 131 | <echo>Installing ImageMagick</echo>
|
---|
[19935] | 132 | <ant target="extract-component"><property name="component.name" value="imagemagick"/></ant>
|
---|
| 133 |
|
---|
| 134 | <echo>Setting binaries to executable</echo>
|
---|
| 135 | <!-- if linux -->
|
---|
[17699] | 136 | <chmod dir="${installDir}/gs2build/bin/linux/imagemagick/bin" includes="*" perm="775"/>
|
---|
[19935] | 137 | <!-- /if -->
|
---|
| 138 | <!-- if mac -->
|
---|
| 139 | <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
|
---|
| 140 | <!-- /if -->
|
---|
| 141 |
|
---|
[14982] | 142 | </target>
|
---|
| 143 |
|
---|
[19935] | 144 | <target name="Installing Ghostscript">
|
---|
[17646] | 145 |
|
---|
[19935] | 146 | <echo>Installing Ghostscript</echo>
|
---|
| 147 | <ant target="extract-component"><property name="component.name" value="ghostscript"/></ant>
|
---|
| 148 |
|
---|
| 149 | <echo>Setting binaries to executable</echo>
|
---|
| 150 | <!-- if linux -->
|
---|
| 151 | <chmod dir="${installDir}/gs2build/bin/linux/ghostscript/bin" includes="*" perm="775"/>
|
---|
| 152 | <!-- /if -->
|
---|
| 153 | <!-- if mac -->
|
---|
| 154 | <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
|
---|
| 155 | <!-- /if -->
|
---|
| 156 |
|
---|
| 157 | </target>
|
---|
| 158 |
|
---|
[17596] | 159 | <target name="Installing Tomcat">
|
---|
[19935] | 160 |
|
---|
[17123] | 161 | <echo>Installing Tomcat (packages/tomcat)</echo>
|
---|
[17446] | 162 | <mkdir dir="packages"/>
|
---|
[19935] | 163 | <ant target="extract-component"><property name="component.name" value="tomcat"/></ant>
|
---|
[17446] | 164 |
|
---|
[17123] | 165 | <echo>Changing tomcat ports tomcat's server.xml</echo>
|
---|
[20084] | 166 | <copy file="${installDir}/resources/tomcat/server_tomcat6.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
[19935] | 167 | <rsr file="${installDir}/packages/tomcat/conf/server.xml">
|
---|
| 168 | <job pattern="@port@" replacement="${tomcat.port}"/>
|
---|
| 169 | <job pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}"/>
|
---|
| 170 | </rsr>
|
---|
| 171 |
|
---|
[17123] | 172 | <echo>Copying greenstone3.xml to tomcat directory</echo>
|
---|
[15973] | 173 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
[19962] | 174 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}${file.separator}web" />
|
---|
[15973] | 175 |
|
---|
[19935] | 176 | <echo>Set binaries to executable</echo>
|
---|
[15973] | 177 | <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
|
---|
[19935] | 178 |
|
---|
[15142] | 179 | </target>
|
---|
[15205] | 180 |
|
---|
[19935] | 181 | <target name="Installing Start Menu Shortcuts">
|
---|
[17786] | 182 |
|
---|
[19935] | 183 | <echo>Installing Start Menu Shortcuts</echo>
|
---|
[17814] | 184 |
|
---|
[19935] | 185 | <mkdir dir="${startmenu.path}\Documentation"/>
|
---|
| 186 |
|
---|
| 187 | <shortcut
|
---|
| 188 | file="${startmenu.path}\Greenstone3 Server.lnk"
|
---|
| 189 | execute="${installDir}\gs3-server.bat"
|
---|
| 190 | workingDirectory="${installDir}"
|
---|
[20012] | 191 | iconFile="${installDir}\resources\images\serverico.ico"
|
---|
[19935] | 192 | iconIndex="0" />
|
---|
[17786] | 193 |
|
---|
[19935] | 194 | <shortcut
|
---|
| 195 | file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
|
---|
| 196 | execute="${installDir}\gli\gli.bat"
|
---|
| 197 | workingDirectory="${installDir}\gli"
|
---|
| 198 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
| 199 | iconIndex="0" />
|
---|
| 200 |
|
---|
| 201 | <shortcut
|
---|
| 202 | file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
|
---|
| 203 | execute="${installDir}\gli\gems.bat"
|
---|
| 204 | workingDirectory="${installDir}\gli"
|
---|
[20012] | 205 | iconFile="${installDir}\resources\images\gems.ico"
|
---|
[19935] | 206 | iconIndex="0" />
|
---|
[17786] | 207 |
|
---|
[19935] | 208 | <shortcut
|
---|
| 209 | file="${startmenu.path}\Uninstall.lnk"
|
---|
| 210 | execute="${installDir}\Uninstall.bat"
|
---|
| 211 | workingDirectory="${installDir}"
|
---|
[20012] | 212 | iconFile="${installDir}\resources\images\uninstall.ico"
|
---|
[19935] | 213 | iconIndex="0" />
|
---|
| 214 |
|
---|
| 215 | <shortcut
|
---|
| 216 | file="${startmenu.path}\Documentation\README.lnk"
|
---|
| 217 | execute="${installDir}\README.txt" />
|
---|
| 218 |
|
---|
| 219 | <shortcut
|
---|
| 220 | file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
|
---|
| 221 | execute="${installDir}\documentation\manual\manual.pdf" />
|
---|
| 222 |
|
---|
| 223 | <shortcut
|
---|
| 224 | file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
|
---|
| 225 | execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
|
---|
[20012] | 226 |
|
---|
| 227 | <shortcut
|
---|
| 228 | file="${startmenu.path}\Documentation\Greenstone Wiki.url"
|
---|
| 229 | url="http://wiki.greenstone.org" />
|
---|
| 230 |
|
---|
| 231 | <shortcut
|
---|
| 232 | file="${startmenu.path}\Documentation\Greenstone Website.url"
|
---|
| 233 | url="http://www.greenstone.org" />
|
---|
[19935] | 234 |
|
---|
| 235 | </target>
|
---|
[17814] | 236 |
|
---|
[19935] | 237 | <!-- util target to extract the given component -->
|
---|
| 238 | <!-- pass in ${component.name} as a param -->
|
---|
| 239 | <target name="extract-component">
|
---|
| 240 | <!-- extract the component into place -->
|
---|
| 241 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="${component.name}.lzma"/></patternset></unzip>
|
---|
| 242 | <!-- if windows -->
|
---|
| 243 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ${component.name}.lzma"/></exec>
|
---|
| 244 | <!-- /if -->
|
---|
| 245 | <!-- if linux|mac -->
|
---|
| 246 | <sevenzip task="decode" input="${basedir}/${component.name}.lzma" output="${basedir}/${component.name}.comp"/>
|
---|
| 247 | <!-- /if -->
|
---|
| 248 | <delete file="${component.name}.lzma"/>
|
---|
| 249 | <unzip src="${basedir}/${component.name}.comp" dest="${installDir}"/>
|
---|
| 250 | <delete file="${component.name}.comp"/>
|
---|
[17786] | 251 | </target>
|
---|
| 252 |
|
---|
[14982] | 253 | </project>
|
---|