| | |
| | | <target name="install"> |
| | | <if> |
| | | <not> |
| | | <available file="${staf.install.dir}/bin/STAF.cfg"/> |
| | | <available file="${staf.install.dir}/${staf.name}/bin/STAF.cfg"/> |
| | | </not> |
| | | <then> |
| | | <mkdir dir="${tmp.dir}"/> |
| | | |
| | | <!-- Install STAF --> |
| | | <echo>Installing staf, please wait...</echo> |
| | | <mkdir dir="${staf.install.dir}"/> |
| | | <gunzip src="${archives.dir}/${staf.archive}" dest="${tmp.dir}"/> |
| | | <untar dest="${tmp.dir}"> |
| | | <fileset dir="${tmp.dir}"> |
| | | <include name="*.tar"/> |
| | | </fileset> |
| | | </untar> |
| | | <chmod file="${tmp.dir}/staf/STAFInst" perm="755"/> |
| | | <exec executable="${tmp.dir}/staf/STAFInst"> |
| | | <arg value="-source"/> |
| | | <arg value="${tmp.dir}/staf"/> |
| | | <arg value="-target"/> |
| | | <arg value="${staf.install.dir}"/> |
| | | <arg value="-acceptlicense"/> |
| | | </exec> |
| | | <delete dir="${repository.dir}/staf"/> |
| | | <mkdir dir="${staf.install.dir}/${staf.name}"/> |
| | | <if> |
| | | <equals arg1="${os.family}" arg2="windows"/> |
| | | <then> |
| | | <exec executable="${archives.dir}/${staf.archive}" |
| | | resultproperty="rc"> |
| | | <arg value="-i"/> |
| | | <arg value="silent"/> |
| | | <arg value="-DACCEPT_LICENSE=1"/> |
| | | <arg value="-DUSER_INSTALL_DIR=${staf.install.dir}/${staf.name}"/> |
| | | <arg value="-DREGISTER=0"/> |
| | | <arg value="-DUPDATE_ENVIRONMENT=User"/> |
| | | <arg value="-DSTART_ON_LOGIN=0"/> |
| | | <arg value="-DSCREATE_START_MENU_ICONS=0"/> |
| | | </exec> |
| | | </then> |
| | | <else> |
| | | <gunzip src="${archives.dir}/${staf.archive}" dest="${tmp.dir}"/> |
| | | <untar dest="${tmp.dir}"> |
| | | <fileset dir="${tmp.dir}"> |
| | | <include name="*.tar"/> |
| | | </fileset> |
| | | </untar> |
| | | <chmod file="${tmp.dir}/staf/STAFInst" perm="755"/> |
| | | <exec executable="${tmp.dir}/staf/STAFInst" |
| | | resultproperty="rc"> |
| | | <arg value="-source"/> |
| | | <arg value="${tmp.dir}/staf"/> |
| | | <arg value="-target"/> |
| | | <arg value="${staf.install.dir}/${staf.name}"/> |
| | | <arg value="-acceptlicense"/> |
| | | </exec> |
| | | <delete dir="${repository.dir}/staf"/> |
| | | </else> |
| | | </if> |
| | | |
| | | <!-- Install services --> |
| | | <echo>Installing services, please wait...</echo> |
| | | <mkdir dir="${staf.install.dir}/services"/> |
| | | <unzip src="${archives.dir}/${email.archive}" |
| | | dest="${staf.install.dir}/services"/> |
| | | <unzip src="${archives.dir}/${event.archive}" |
| | | dest="${staf.install.dir}/services"/> |
| | | <unzip src="${archives.dir}/${eventmanager.archive}" |
| | | dest="${staf.install.dir}/services"/> |
| | | <unzip src="${archives.dir}/${stax.archive}" |
| | | dest="${staf.install.dir}/services"/> |
| | | <unzip src="${archives.dir}/${http.archive}" |
| | | dest="${staf.install.dir}/services"/> |
| | | |
| | | <!-- Add DSML service extension --> |
| | | <mkdir dir="${staf.install.dir}/services/DSML"/> |
| | | <copy todir="${staf.install.dir}/services/DSML"> |
| | | <fileset dir="${basedir}/../staf-tests/shared/dsml" |
| | | includes="dsmlService.jar"/> |
| | | </copy> |
| | | |
| | | <delete includeemptydirs="true"> |
| | | <fileset dir="${tmp.dir}" includes="**/*"/> |
| | | </delete> |
| | | <fail message="STAF installation failed"> |
| | | <condition> |
| | | <and> |
| | | <not> |
| | | <equals arg1="${rc}" arg2="0"/> |
| | | </not> |
| | | </and> |
| | | </condition> |
| | | </fail> |
| | | </then> |
| | | <else> |
| | | <echo>Staf is already installed in [${staf.install.dir}]</echo> |
| | | <echo>Staf is already installed in [${staf.install.dir}/${staf.name}]</echo> |
| | | </else> |
| | | </if> |
| | | |
| | | <!-- Install services --> |
| | | <echo>Installing services, please wait...</echo> |
| | | <var name="list" value="${stax.archive},${email.archive}"/> |
| | | <var name="list" value="${list},${event.archive},${eventmanager.archive}"/> |
| | | <var name="list" value="${list},${http.archive}"/> |
| | | <for list="${list}" param="archive"> |
| | | <sequential> |
| | | <var name="name" unset="true"/> |
| | | |
| | | <propertyregex property="name" |
| | | input="@{archive}" |
| | | regexp="(.*)V(.*)\..*" |
| | | select="\1-v\2" |
| | | casesensitive="true"/> |
| | | |
| | | <if> |
| | | <not> |
| | | <available file="${staf.install.dir}/${name}"/> |
| | | </not> |
| | | <then> |
| | | <unzip src="${archives.dir}/@{archive}" |
| | | dest="${staf.install.dir}"> |
| | | <chainedmapper> |
| | | <flattenmapper/> |
| | | <globmapper from="*" to="${name}/*"/> |
| | | <mapper> |
| | | <globmapper from="*" to="*"/> |
| | | </mapper> |
| | | </chainedmapper> |
| | | </unzip> |
| | | </then> |
| | | <else> |
| | | <echo>${name} is already installed in [${staf.install.dir}/${name}]</echo> |
| | | </else> |
| | | </if> |
| | | </sequential> |
| | | </for> |
| | | |
| | | <!-- Add DSML service extension --> |
| | | <mkdir dir="${staf.install.dir}/DSML"/> |
| | | <copy todir="${staf.install.dir}/DSML"> |
| | | <fileset dir="${basedir}/../staf-tests/shared/dsml" |
| | | includes="dsmlService.jar"/> |
| | | </copy> |
| | | |
| | | <delete includeemptydirs="true"> |
| | | <fileset dir="${tmp.dir}" includes="**/*"/> |
| | | </delete> |
| | | </target> |
| | | |
| | | <!-- Uninstall STAF and services --> |
| | | <target name="uninstall"> |
| | | <if> |
| | | <available file="${staf.install.dir}/bin/STAF.cfg"/> |
| | | <available file="${staf.install.dir}/${staf.name}/bin/STAF.cfg"/> |
| | | <then> |
| | | <echo>Uninstalling staf, please wait...</echo> |
| | | <exec executable="${staf.install.dir}/STAFUninst"/> |
| | | <delete dir="${staf.install.dir}"/> |
| | | <exec executable="${staf.install.dir}/${staf.name}/STAFUninst"/> |
| | | <delete dir="${staf.install.dir}/${staf.name}"/> |
| | | </then> |
| | | <else> |
| | | <echo>Staf is not installed</echo> |
| | |
| | | <target name="start"> |
| | | <!-- Copy staf.cfg --> |
| | | <mkdir dir="${staf.config.dir}"/> |
| | | <copy file="${staf.config.stubs}" tofile="${staf.config.file}"> |
| | | <copy file="${staf.config.stubs}" tofile="${staf.config.file}" overwrite="true"> |
| | | <filterchain> |
| | | <expandproperties/> |
| | | </filterchain> |
| | |
| | | <socket port="${staf.port}" server="${host.name}"/> |
| | | </not> |
| | | <then> |
| | | <delete dir="${staf.install.dir}/logs"/> |
| | | |
| | | <var name="cp" value="${project.home}/resource/dsml/lib/activation.jar:${project.home}/resource/dsml/lib/j2ee.jar:${project.home}/resource/dsml/lib/jaxb-api.jar:${project.home}/resource/dsml/lib/jaxb-impl.jar:${project.home}/resource/dsml/lib/jaxb-xjc.jar:${project.home}/resource/dsml/lib/jaxb1-impl.jar:${project.home}/resource/dsml/lib/jsr173_1.0_api.jar:${project.home}/resource/dsml/lib/saaj-1.3.jar:${project.home}/resource/dsml/lib/saaj-impl-1.3.jar"/> |
| | | |
| | | <echo>Starting staf, please wait...</echo> |
| | | <exec dir="${staf.bin.dir}" |
| | | executable="${staf.daemon}" |
| | | spawn="true"> |
| | | <arg value="${staf.config.file}"/> |
| | | <env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/> |
| | | <env key="LD_LIBRARY_PATH" path="${staf.install.dir}/lib"/> |
| | | <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:${project.home}/ext/svnkit/svnkit.jar:."/> |
| | | <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/> |
| | | <env key="${var.path}" path="${java.path}/bin:${staf.install.dir}/${staf.name}/bin"/> |
| | | <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/> |
| | | <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar:${project.home}/ext/svnkit/svnkit.jar:${cp}:."/> |
| | | <env key="STAFCONVDIR" value="${staf.install.dir}/${staf.name}/codepage"/> |
| | | <env key="LANG" value="en_US.ISO8859-1"/> |
| | | <env key="LC_ALL" value="en_US.ISO8859-1"/> |
| | | <env key="STAFCODEPAGE" value="LATIN_1"/> |
| | |
| | | </exec> |
| | | |
| | | <echo>Waiting for service to become available...</echo> |
| | | <waitfor maxwait="3" |
| | | <waitfor maxwait="1" |
| | | maxwaitunit="minute" |
| | | checkevery="10" |
| | | checkeveryunit="second" |
| | |
| | | <socket server="${host.name}" port="${staf.port}"/> |
| | | </waitfor> |
| | | |
| | | <echo>STAF is now ready to serve requests</echo> |
| | | <if> |
| | | <isset property="timeout"/> |
| | | <then> |
| | | <fail>"STAF initialisation failed"</fail> |
| | | </then> |
| | | <else> |
| | | <echo>STAF is now ready to serve requests</echo> |
| | | </else> |
| | | </if> |
| | | </then> |
| | | <else> |
| | | <echo>Staf is already listening on port [${staf.port}]</echo> |
| | |
| | | <echo>Stopping staf, please wait...</echo> |
| | | <exec executable="${staf.executable}"> |
| | | <arg line="local shutdown shutdown"/> |
| | | <env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/> |
| | | <env key="${var.path}" path="${java.path}/bin:${staf.install.dir}/${staf.name}/bin"/> |
| | | <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/> |
| | | <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:."/> |
| | | <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/> |
| | | <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar:."/> |
| | | <env key="STAFCONVDIR" value="${staf.install.dir}/${staf.name}/codepage"/> |
| | | </exec> |
| | | |
| | | <echo>Waiting for service to shutdown gracefully...</echo> |
| | | <waitfor maxwait="3" |
| | | <waitfor maxwait="1" |
| | | maxwaitunit="minute" |
| | | checkevery="10" |
| | | checkeveryunit="second" |
| | |
| | | |
| | | <echo></echo> |
| | | <if> |
| | | <available file="${staf.install.dir}/bin/STAF.cfg"/> |
| | | <available file="${staf.install.dir}/${staf.name}/bin/STAF.cfg"/> |
| | | <then> |
| | | |
| | | <echo>Staf is installed in [${staf.install.dir}]</echo> |
| | | <echo>Staf is installed in [${staf.install.dir}/${staf.name}]</echo> |
| | | </then> |
| | | <else> |
| | | <echo>Staf is not installed</echo> |
| | | </else> |
| | | </if> |
| | | |
| | | <echo></echo> |
| | | <if> |
| | | <socket port="${staf.port}" server="${host.name}"/> |
| | | <then> |
| | |
| | | <echo>Staf is not running</echo> |
| | | </else> |
| | | </if> |
| | | |
| | | <echo></echo> |
| | | <var name="list" value="${stax.archive},${email.archive}"/> |
| | | <var name="list" value="${list},${event.archive},${eventmanager.archive}"/> |
| | | <var name="list" value="${list},${http.archive}"/> |
| | | <for list="${list}" param="archive"> |
| | | <sequential> |
| | | <var name="shortname" unset="true"/> |
| | | <var name="name" unset="true"/> |
| | | |
| | | <propertyregex property="shortname" |
| | | input="@{archive}" |
| | | regexp="(.*)V.*\..*" |
| | | select="\1" |
| | | casesensitive="true"/> |
| | | |
| | | <propertyregex property="name" |
| | | input="@{archive}" |
| | | regexp="(.*)V(.*)\..*" |
| | | select="\1-v\2" |
| | | casesensitive="true"/> |
| | | |
| | | <if> |
| | | <not> |
| | | <available file="${staf.install.dir}/${name}"/> |
| | | </not> |
| | | <then> |
| | | <echo>${shortname} is not installed</echo> |
| | | </then> |
| | | <else> |
| | | <echo>${shortname} is installed in [${staf.install.dir}/${name}]</echo> |
| | | </else> |
| | | </if> |
| | | </sequential> |
| | | </for> |
| | | </target> |
| | | |
| | | <!-- Display STAF gui --> |
| | | <target name="gui"> |
| | | <exec dir="${staf.install.dir}" |
| | | <exec dir="${staf.install.dir}/${staf.name}" |
| | | executable="${java.path}/bin/java" |
| | | spawn="true"> |
| | | <env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/> |
| | | <env key="${var.path}" path="${java.path}$/bin:${staf.install.dir}/${staf.name}/bin"/> |
| | | <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/> |
| | | <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:."/> |
| | | <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/> |
| | | <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar:."/> |
| | | <env key="STAFCONVDIR" value="${staf.install.dir}/${staf.name}/codepage"/> |
| | | <arg value="-classpath"/> |
| | | <arg value="${staf.install.dir}/services/stax/STAXMon.jar${path.separator}${staf.lib.dir}/JSTAF.jar"/> |
| | | <arg value="${staf.install.dir}/${stax.name}/STAXMon.jar:${staf.lib.dir}/JSTAF.jar"/> |
| | | <arg value="com.ibm.staf.service.stax.STAXMonitor"/> |
| | | </exec> |
| | | </target> |
| | | |
| | | <!-- Display jvmlogs --> |
| | | <target name="jvmlogs"> |
| | | <exec dir="${staf.install.dir}" |
| | | <exec dir="${staf.install.dir}/${staf.name}" |
| | | executable="${java.path}/bin/java" |
| | | spawn="true"> |
| | | <env key="${var.path}" path="${java.path}${file.separator}bin${path.separator}${staf.install.dir}${file.separator}bin"/> |
| | | <env key="${var.path}" path="${java.path}/bin:${staf.install.dir}/${staf.name}/bin"/> |
| | | <env key="LD_LIBRARY_PATH" path="${staf.lib.dir}"/> |
| | | <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar${path.separator}:."/> |
| | | <env key="STAFCONVDIR" value="${staf.install.dir}/codepage"/> |
| | | <env key="CLASSPATH" path="${staf.lib.dir}/JSTAF.jar:."/> |
| | | <env key="STAFCONVDIR" value="${staf.install.dir}/${staf.name}/codepage"/> |
| | | <arg value="-classpath"/> |
| | | <arg value="${staf.lib.dir}${path.separator}${staf.lib.dir}/JSTAF.jar"/> |
| | | <arg value="com.ibm.staf.STAFJVMLogViewer"/> |