[15023] | 1 | <?xml version="1.0"?>
|
---|
| 2 | <!--
|
---|
| 3 | This is the build.xml run by AntInstaller for the installer
|
---|
| 4 | -->
|
---|
| 5 |
|
---|
| 6 | <project name="Installation" default="" basedir="${basedir}">
|
---|
| 7 |
|
---|
| 8 | <!-- this is required to pick up the properties generated during the install pages -->
|
---|
| 9 | <property file="${basedir}/ant.install.properties"/>
|
---|
| 10 |
|
---|
| 11 | <path id="project.classpath">
|
---|
| 12 | <pathelement path="${antinstaller.jar}"/>
|
---|
| 13 | </path>
|
---|
| 14 |
|
---|
| 15 | <!-- custom tasks -->
|
---|
| 16 | <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
|
---|
[15381] | 17 | <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
|
---|
| 18 | <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
|
---|
[15023] | 19 |
|
---|
[15095] | 20 | <!-- create a local installDir String -->
|
---|
| 21 | <path id="installDir.path">
|
---|
| 22 | <pathelement location="${installDir}"/>
|
---|
| 23 | </path>
|
---|
| 24 | <property name="installDir.local" refid="installDir.path"/>
|
---|
[16631] | 25 |
|
---|
| 26 | <!-- load windows properties -->
|
---|
| 27 | <winprops/>
|
---|
[15095] | 28 |
|
---|
| 29 |
|
---|
[15356] | 30 | <target name="install-core-components">
|
---|
[15023] | 31 |
|
---|
| 32 | <!-- create the installation directory -->
|
---|
| 33 | <echo message="Creating Installation directory"/>
|
---|
| 34 | <echo>basedir: ${basedir}</echo>
|
---|
| 35 | <echo>installDir: ${installDir}</echo>
|
---|
| 36 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
| 37 | <mkdir dir="${installDir}"/>
|
---|
| 38 |
|
---|
| 39 | <!-- install binaries -->
|
---|
| 40 | <echo message="Installing Executable Binaries (bin)"/>
|
---|
| 41 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="bin/**/*"/></patternset></unzip>
|
---|
| 42 | <echo/>
|
---|
| 43 |
|
---|
| 44 | <echo message="Installing Documentation (docs)"/>
|
---|
| 45 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="docs/**/*"/></patternset></unzip>
|
---|
| 46 | <echo/>
|
---|
| 47 |
|
---|
| 48 | <echo message="Installing GLI (gli)"/>
|
---|
| 49 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gli/**/*"/></patternset></unzip>
|
---|
| 50 | <echo/>
|
---|
| 51 |
|
---|
| 52 | <echo message="Installing gs2build (gs2build)"/>
|
---|
| 53 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gs2build/**/*"/></patternset></unzip>
|
---|
| 54 | <echo/>
|
---|
| 55 |
|
---|
| 56 | <echo message="Installing Libraries (lib)"/>
|
---|
| 57 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="lib/**/*"/></patternset></unzip>
|
---|
| 58 | <echo/>
|
---|
| 59 |
|
---|
| 60 | <echo message="Installing Web Content (web)"/>
|
---|
| 61 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="web/**/*"/></patternset></unzip>
|
---|
| 62 | <echo/>
|
---|
| 63 |
|
---|
| 64 | <echo message="Installing Resources (resources)"/>
|
---|
| 65 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="resources/**/*"/></patternset></unzip>
|
---|
| 66 | <echo/>
|
---|
| 67 |
|
---|
| 68 | <echo message="Installing Windows Utility Commands (winutil)"/>
|
---|
| 69 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="winutil/**/*"/></patternset></unzip>
|
---|
| 70 | <echo/>
|
---|
| 71 |
|
---|
| 72 |
|
---|
| 73 | <echo message="Installing Top Level Files"/>
|
---|
| 74 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 75 | <patternset>
|
---|
[15812] | 76 | <include name="greenstone3-build.xml"/>
|
---|
[15023] | 77 | <include name="build.properties"/>
|
---|
| 78 | <include name="gs3-server.bat"/>
|
---|
| 79 | <include name="gs3-setup.bat"/>
|
---|
| 80 | <include name="LICENSE.txt"/>
|
---|
| 81 | <include name="README.txt"/>
|
---|
| 82 | <include name="server.jar"/>
|
---|
| 83 | </patternset>
|
---|
| 84 | </unzip>
|
---|
| 85 | <echo/>
|
---|
[15812] | 86 |
|
---|
| 87 | <!-- rename greenstone3-build.xml back to build.xml -->
|
---|
| 88 | <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
|
---|
| 89 |
|
---|
[15023] | 90 | <!-- change the tomcat ports in build.properties -->
|
---|
| 91 | <echo message="Changing tomcat ports in build.properties"/>
|
---|
| 92 | <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
|
---|
| 93 | <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
|
---|
[15356] | 94 | <echo message="Changing tomcat ports in resources/tomcat/server.xml"/>
|
---|
| 95 | <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
[15812] | 96 |
|
---|
| 97 | <!-- set gsdlhome in gs2build setup.bat -->
|
---|
| 98 | <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
|
---|
| 99 | <rsr file="${installDir}/gs2build/setup.bat" pattern="@gsdlhome@" replacement="${installDir.local}\gs2build" />
|
---|
[15023] | 100 |
|
---|
[15812] | 101 |
|
---|
[15023] | 102 | <!-- copy the greenstone3.xml file to tomcat -->
|
---|
| 103 | <echo message="Copying greenstone3.xml to tomcat directory"/>
|
---|
| 104 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
[15095] | 105 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
|
---|
[15023] | 106 |
|
---|
| 107 | <!-- set up global properties -->
|
---|
| 108 | <echo message="Setting up global properties"/>
|
---|
| 109 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
[15095] | 110 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
|
---|
| 111 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
|
---|
| 112 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
|
---|
[15023] | 113 |
|
---|
| 114 | <!-- set up log4j properties-->
|
---|
| 115 | <echo message="Setting up log4j properties"/>
|
---|
| 116 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
[15095] | 117 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
|
---|
[15023] | 118 |
|
---|
| 119 | <!-- delete unneeded files -->
|
---|
| 120 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 121 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 122 |
|
---|
| 123 | </target>
|
---|
| 124 |
|
---|
| 125 | <!-- Source -->
|
---|
[15356] | 126 | <target name="install-source-code">
|
---|
[15023] | 127 | <echo message="Installing Source Code (src)"/>
|
---|
| 128 | <mkdir dir="${installDir}/src"/>
|
---|
| 129 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 130 | <patternset>
|
---|
| 131 | <include name="src/**/*"/>
|
---|
| 132 | </patternset>
|
---|
| 133 | </unzip>
|
---|
| 134 | </target>
|
---|
| 135 |
|
---|
[15356] | 136 | <target name="install-tomcat">
|
---|
| 137 |
|
---|
| 138 | <echo message="Installing Apache Tomcat"/>
|
---|
| 139 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/tomcat/**/*"/></patternset></unzip>
|
---|
| 140 |
|
---|
| 141 | <!-- change the tomcat ports in tomcats server.xml -->
|
---|
| 142 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
|
---|
| 143 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
|
---|
| 144 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
|
---|
| 145 |
|
---|
| 146 | </target>
|
---|
| 147 | <target name="install-ant">
|
---|
| 148 | <echo message="Installing Apache Ant"/>
|
---|
| 149 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/ant/**/*"/></patternset></unzip>
|
---|
| 150 | </target>
|
---|
| 151 |
|
---|
[15023] | 152 | <target name="cleanuptarget">
|
---|
| 153 | </target>
|
---|
| 154 |
|
---|
[15381] | 155 | <target name="install-start-menu-shortcuts">
|
---|
[15023] | 156 |
|
---|
[16631] | 157 | <mkdir dir="${win32.personal.programs_menu}\Greenstone-@version@\Documentation"/>
|
---|
[15381] | 158 |
|
---|
| 159 | <shortcut
|
---|
| 160 | file="${win32.personal.programs_menu}\Greenstone-@version@\Greenstone3 Server.lnk"
|
---|
[15691] | 161 | execute="${installDir}\gs3-server.bat"
|
---|
[15381] | 162 | workingDirectory="${installDir}"
|
---|
[15691] | 163 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
[15381] | 164 | iconIndex="0" />
|
---|
[15691] | 165 |
|
---|
| 166 | <shortcut
|
---|
| 167 | file="${win32.personal.programs_menu}\Greenstone-@version@\Greenstone Librarian Interface (GLI).lnk"
|
---|
[16284] | 168 | execute="${installDir}\gli\gli.bat"
|
---|
[15691] | 169 | workingDirectory="${installDir}\gli"
|
---|
| 170 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
| 171 | iconIndex="0" />
|
---|
[15381] | 172 |
|
---|
[15691] | 173 | <shortcut
|
---|
| 174 | file="${win32.personal.programs_menu}\Greenstone-@version@\Greenstone Editor for Metadata Sets (GEMS).lnk"
|
---|
| 175 | execute="${installDir}\gli\gems4gs3.bat"
|
---|
| 176 | workingDirectory="${installDir}\gli"
|
---|
| 177 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
| 178 | iconIndex="0" />
|
---|
| 179 |
|
---|
| 180 | <shortcut
|
---|
[16631] | 181 | file="${win32.personal.programs_menu}\Greenstone-@version@\Documentation\README.lnk"
|
---|
[15691] | 182 | execute="${installDir}\README.txt" />
|
---|
| 183 |
|
---|
| 184 | <shortcut
|
---|
[16631] | 185 | file="${win32.personal.programs_menu}\Greenstone-@version@\Documentation\Greenstone3 Users' Guide.lnk"
|
---|
[15691] | 186 | execute="${installDir}\documentation\manual\manual.pdf" />
|
---|
| 187 |
|
---|
| 188 | <shortcut
|
---|
[16631] | 189 | file="${win32.personal.programs_menu}\Greenstone-@version@\Documentation\Greenstone2 Users' Guide.lnk"
|
---|
[15691] | 190 | execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
|
---|
| 191 |
|
---|
| 192 |
|
---|
[15381] | 193 | </target>
|
---|
| 194 |
|
---|
[15023] | 195 | </project>
|
---|