You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jitsi/resources/install/build.xml

1169 lines
51 KiB

<?xml version="1.0"?>
<!--
Installation procedure.
The install scripts are located inside the resources/install directory . The
files are separated in subdirectories according to distribution - generic,
linux, windows, macosx.
1. For building any of the distributions you must fill in the
path to the installation of IzPack. For instructions on how to install
izPack please referer to http://www.izforge.com/izpack/. And uncomment the
taskdef of izpack in this file.
2. When building the linux installation package you must set the
linux.jre.path variable to point to a location containing an extracted jre
so that it could be bundled inside the installation package.
3. When building the windows installation package you must set the
windows.jre.file variable. This is the path to an installation file of a
jre (online or offline one). The 7zip software package
(http://www.7-zip.org) must also be installed.
4. When changing the application version things you must do:
- generic
- there is app-version variable in the izpack installer xml
- linux
- there is app-version variable in the izpack installer xml
- windows
- there is app-version variable in the izpack installer xml
- you must change the installer jar name in the launcher.ini file
-->
<project name="sip-communicator-installer" basedir="." default="ant-usage">
<import file="../../build.xml"/>
<!-- Load installer properties -->
<!-- USERS NEED TO UPDATE THIS FILE -->
<property file="${inst.resrc}/installers.properties"/>
<target name="load-properties" depends="version">
<!-- load properties on demand here so it can evaluate
and sip-communicator.version property from property file-->
<property file="${inst.resrc}/ant-build-config.properties"/>
</target>
<!-- define the izpack task in a separate target so that we don't get an
error when izpack properties are not set-->
<target name="define-izpack-task">
<taskdef name="izpack" classpath="${izpack.dir}/lib/compiler.jar"
classname="com.izforge.izpack.ant.IzPackTask"/>
</target>
<!-- if application.home.dirname is set we are going to change application
home directory so we will generate new exe file, so we must define
jmsooth task
-->
<target name="define-jsmooth-task" if="application.home.dirname">
<taskdef name="jsmoothgen"
classname="net.charabia.jsmoothgen.ant.JSmoothGen"
classpath="${inst.resrc}/windows/jsmoothgen-ant.jar"/>
</target>
<target name="windows-generate-exe" depends="define-jsmooth-task"
if="application.home.dirname">
<copy file="${inst.resrc}/windows/run.exe.jsmooth"
tofile="${inst.resrc}/windows/tmp.run.exe.jsmooth"/>
<replace file="${inst.resrc}/windows/tmp.run.exe.jsmooth">
<replacetoken><![CDATA[<name>felix.config.properties</name>]]></replacetoken>
<replacevalue><![CDATA[<name>net.java.sip.communicator.SC_HOME_DIR_NAME</name>
<value>_APP_NAME_</value>
</javaProperties>
<javaProperties>
<name>felix.config.properties</name>]]></replacevalue>
</replace>
<replace file="${inst.resrc}/windows/tmp.run.exe.jsmooth"
token="_APP_NAME_" value="${application.name}"/>
<jsmoothgen project="${inst.resrc}/windows/tmp.run.exe.jsmooth"
skeletonroot="${inst.resrc}/windows/skeletons"/>
<delete file="${inst.resrc}/windows/tmp.run.exe.jsmooth"/>
</target>
<target name="-prepare-debian-sh"
depends="-prepare-debian-sh-copy,-prepare-debian-sh-homedir"/>
<target name="-prepare-debian-sh-copy">
<!-- Put correct version in the sip-communicator executable file -->
<copy file="${inst.resrc}/debian/sip-communicator.sh.tmpl"
tofile="${inst.resrc}/debian/sip-communicator.sh"
overwrite="true"/>
<replace file="${inst.resrc}/debian/sip-communicator.sh"
token="_SC_VERSION_"
value="${sip-communicator.version}"/>
</target>
<target name="-prepare-debian-sh-homedir" if="application.home.dirname">
<replace file="${inst.resrc}/debian/sip-communicator.sh"
token="net.java.sip.communicator.launcher.SIPCommunicator"
value="-Dnet.java.sip.communicator.SC_HOME_DIR_NAME=${application.home.dirname} net.java.sip.communicator.launcher.SIPCommunicator"/>
</target>
<!-- Put here the Windows release directory -->
<property name="windows.app.dir" value="${sc.basedir}/${release}/windows"/>
<!-- Put here the Linux release directory -->
<property name="linux.app.dir" value="${sc.basedir}/${release}/linux"/>
<!-- Put here the Generic release directory -->
<property name="generic.app.dir" value="${sc.basedir}/${release}/generic"/>
<!-- The path to the dpkg-scanpackages tool -->
<property name="dpkg-scanpackages" value="/usr/bin/dpkg-scanpackages"/>
<!-- The path to the dpkg-buildpackage tool -->
<property name="dpkg-buildpackage" value="/usr/bin/dpkg-buildpackage"/>
<!-- The path to the dh_testdir tool -->
<property name="dh_testdir" value="/usr/bin/dh_testdir"/>
<!-- change the 7zip executable corresponding the OS
7-zip is used to create windows self-extract installer binary
In order to work 7-zip must be installed and tobe in the path
For Debian linux use : apt-get install p7zip
For other go to : http://www.7-zip.org/
-->
<condition property="7zip.executable" value="7z">
<os family="windows"/>
</condition>
<condition property="7zip.executable" value="7z">
<equals arg1="${os.name}" arg2="linux"
casesensitive="false" trim="true"/>
</condition>
<!-- Put here the release directory -->
<property name="macosx.app.dir" value="${release}/macosx"/>
<!-- Put here the resource directory -->
<property name="macosx.resrc.dir" value="${inst.resrc}/macosx"/>
<!-- The release directory for Debian packages -->
<property name="debian.dir" value="${release}/debian"/>
<property name="debian.binary.dir" value="${debian.dir}/binary"/>
<!-- Can we build debian packages? -->
<condition property="dpkg.build.present">
<and>
<available file="${dpkg-buildpackage}"/>
<available file="${dh_testdir}"/>
</and>
</condition>
<!-- Can we deploy debian packages? -->
<condition property="dpkg.scan.present">
<available file="${dpkg-scanpackages}"/>
</condition>
<!-- default Ant target does nothing except print helpful options -->
<target name="ant-usage"
description="simply execute 'ant' to discover the most useful targets.">
<echo message="Useful ant commands for the SIP Communicator Build Installer..." />
<echo message="'ant build-installation-generic' for building generic installator jar" />
<echo message="'ant build-installation-linux' for building linux instalation file" />
<echo message="'ant build-installation-windows' for building windows instalation file" />
<echo message="'ant build-installation-wix' for building Windows MSI instalation file using WiX and mt.exe" />
<echo message="'ant build-installation-wix-64' for building Windows x64 MSI instalation file using WiX and mt.exe" />
</target>
<target name="clean-install-generic">
<delete dir="${generic.app.dir}"/>
<mkdir dir="${generic.app.dir}"/>
</target>
<target name="build-installation-generic"
depends="clean-install-generic,define-izpack-task,load-properties">
<propertyfile file="${generic.app.dir}/versionupdate.properties"
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="${link.download.generic}"/>
</propertyfile>
<filter token="VERSION" value="${sip-communicator.version}" />
<filter token="BUILDDATE" value="${build.date}" />
<filter token="PKG_NAME" value="${package.name}" />
<filter token="APP_NAME" value="${application.name}" />
<filter token="APP_EMAIL" value="${application.email}" />
<filter token="APP_WEB" value="${application.web}" />
<filter token="DEST_DIR" value="${release}" />
<filter token="WelcomeText1" value="${installer.welcome.wtext1}" />
<filter token="WelcomeText2" value="${installer.welcome.wtext2}" />
<filter token="WelcomeText3" value="${installer.welcome.wtext3}" />
<copy
tofile="${generic.app.dir}/tmp-installer-generic.xml"
file="${inst.resrc}/generic/installer-generic.xml"
filtering="yes"
/>
<copy
tofile="${generic.app.dir}/tmp-windows_shortcut_specification.xml"
file="${inst.resrc}/windows/windows_shortcut_specification.xml"
filtering="yes"
/>
<copy
tofile="${generic.app.dir}/tmp-linux_shortcut_specification.xml"
file="${inst.resrc}/linux/linux_shortcut_specification.xml"
filtering="yes"
/>
<izpack
input="${generic.app.dir}/tmp-installer-generic.xml"
output="${generic.app.dir}/${package.name}-${sip-communicator.version}.jar"
installerType="standard"
izPackDir="${izpack.dir}/"
basedir="${sc.basedir}"/>
<delete quiet="yes" failonerror="false">
<fileset dir="${generic.app.dir}">
<include name="tmp-*"/>
</fileset>
</delete>
</target>
<target name="clean-install-linux">
<delete dir="${linux.app.dir}"/>
<mkdir dir="${linux.app.dir}"/>
<mkdir dir="${linux.app.dir}/tmp"/>
</target>
<target name="build-installation-linux"
depends="clean-install-linux,define-izpack-task,load-properties">
<propertyfile file="${linux.app.dir}/versionupdate.properties"
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="${link.download.linux}"/>
</propertyfile>
<filter token="VERSION" value="${sip-communicator.version}" />
<filter token="BUILDDATE" value="${build.date}" />
<filter token="PKG_NAME" value="${package.name}" />
<filter token="APP_NAME" value="${application.name}" />
<filter token="APP_EMAIL" value="${application.email}" />
<filter token="APP_WEB" value="${application.web}" />
<filter token="DEST_DIR" value="${release}" />
<filter token="WelcomeText1" value="${installer.welcome.wtext1}" />
<filter token="WelcomeText2" value="${installer.welcome.wtext2}" />
<filter token="WelcomeText3" value="${installer.welcome.wtext3}" />
<copy todir="${linux.app.dir}/tmp" filtering="yes" >
<fileset dir="${inst.resrc}/linux">
<include name="setup.sh"/>
<include name="inst_path"/>
</fileset>
</copy>
<!-- copy the jre -->
<copy todir="${linux.app.dir}/tmp/jre">
<fileset dir="${linux.jre.path}">
<include name="**/*"/>
</fileset>
</copy>
<copy
tofile="${linux.app.dir}/tmp/tmp-installer-linux.xml"
file="${inst.resrc}/linux/installer-linux.xml"
filtering="yes"
/>
<copy
tofile="${linux.app.dir}/tmp-linux_shortcut_specification.xml"
file="${inst.resrc}/linux/linux_shortcut_specification.xml"
filtering="yes"
/>
<!-- Prepare felix.client.run.properties and put some specific bundles -->
<copy file="${lib}/felix.client.run.properties"
tofile="${inst.resrc}/linux/felix.client.run.properties"
overwrite="true"/>
<replace file="${inst.resrc}/linux/felix.client.run.properties"
token="reference:file:sc-bundles/swingnotification.jar \">
<replacevalue><![CDATA[reference:file:sc-bundles/galagonotification.jar \
reference:file:sc-bundles/swingnotification.jar \]]></replacevalue>
</replace>
<!-- create izpack installer jar file -->
<izpack input="${linux.app.dir}/tmp/tmp-installer-linux.xml"
output="${linux.app.dir}/tmp/${package.name}-${sip-communicator.version}-linux.jar"
installerType="standard"
basedir="${sc.basedir}"
izPackDir="${izpack.dir}/"/>
<!-- Create self extract linux binary-->
<tar tarfile="${linux.app.dir}/tmp/install.tar"
basedir="${linux.app.dir}/tmp"/>
<gzip zipfile="${linux.app.dir}/tmp/install.tar.gz"
src="${linux.app.dir}/tmp/install.tar"/>
<concat destfile="${linux.app.dir}/${package.name}-${sip-communicator.version}-linux.bin"
binary="true">
<fileset dir="${inst.resrc}/linux/">
<include name="sfx-header"/>
</fileset>
<fileset dir="${linux.app.dir}/tmp">
<include name="install.tar.gz"/>
</fileset>
</concat>
<chmod file="${linux.app.dir}/${package.name}-${sip-communicator.version}-linux.bin" perm="+x"/>
<!-- Delete the temp directory-->
<delete dir="${linux.app.dir}/tmp"/>
<delete file="${inst.resrc}/linux/felix.client.run.properties"/>
<delete quiet="yes" failonerror="false">
<fileset dir="${linux.app.dir}">
<include name="tmp-*"/>
</fileset>
</delete>
</target>
<target name="clean-install-windows">
<delete dir="${windows.app.dir}"/>
<mkdir dir="${windows.app.dir}"/>
<mkdir dir="${windows.app.dir}/tmp"/>
<mkdir dir="${windows.app.dir}/tmp/jre"/>
</target>
<target name="build-installation-windows"
depends="clean-install-windows,define-izpack-task,load-properties">
<propertyfile file="${windows.app.dir}/versionupdate.properties"
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="${link.download.windows}"/>
</propertyfile>
<filter token="VERSION" value="${sip-communicator.version}" />
<filter token="BUILDDATE" value="${build.date}" />
<filter token="PKG_NAME" value="${package.name}" />
<filter token="APP_NAME" value="${application.name}" />
<filter token="APP_EMAIL" value="${application.email}" />
<filter token="APP_WEB" value="${application.web}" />
<filter token="DEST_DIR" value="${release}" />
<filter token="WelcomeText1" value="${installer.welcome.wtext1}" />
<filter token="WelcomeText2" value="${installer.welcome.wtext2}" />
<filter token="WelcomeText3" value="${installer.welcome.wtext3}" />
<copy
tofile="${windows.app.dir}/tmp-windows_shortcut_specification.xml"
file="${inst.resrc}/windows/windows_shortcut_specification.xml"
filtering="yes"
/>
<!-- Copy with replacing some parameters in text files -->
<copy todir="${windows.app.dir}/tmp" filtering="yes">
<fileset dir="${inst.resrc}/windows">
<include name="launcher.ini"/>
</fileset>
</copy>
<!-- Copy other needed files to tmp folder -->
<copy todir="${windows.app.dir}/tmp">
<fileset dir="${inst.resrc}/windows">
<include name="setup-sip-communicator.exe"/>
</fileset>
</copy>
<!-- copy the windows jre file -->
<copy file="${windows.jre.file}"
tofile="${windows.app.dir}/tmp/jre/jre-windows.exe"/>
<copy
tofile="${windows.app.dir}/tmp/tmp-installer-windows.xml"
file="${inst.resrc}/windows/installer-windows.xml"
filtering="yes"
/>
<izpack
input="${windows.app.dir}/tmp/tmp-installer-windows.xml"
output="${windows.app.dir}/tmp/sip-communicator-windows.jar"
installerType="standard"
basedir="${sc.basedir}"
izPackDir="${izpack.dir}/"/>
<zip destfile="${windows.app.dir}/${package.name}-${sip-communicator.version}-windows.zip"
basedir="${windows.app.dir}/tmp"/>
<exec dir="${windows.app.dir}/tmp" executable="${7zip.executable}" failifexecutionfails="false">
<arg line="a -y data.7z *"/>
</exec>
<copy
tofile="${windows.app.dir}/tmp/7zip.conf"
file="${inst.resrc}/windows/7zip.conf"
filtering="yes"
/>
<concat destfile="${windows.app.dir}/${package.name}-${sip-communicator.version}.exe"
binary="true">
<fileset dir="${inst.resrc}/windows">
<include name="7zS.sfx"/>
</fileset>
<fileset dir="${windows.app.dir}/tmp">
<include name="7zip.conf"/>
</fileset>
<fileset dir="${windows.app.dir}/tmp">
<include name="data.7z"/>
</fileset>
</concat>
<!-- Delete the temp directory-->
<delete dir="${windows.app.dir}/tmp"/>
<delete quiet="yes" failonerror="false">
<fileset dir="${windows.app.dir}">
<include name="tmp-*"/>
</fileset>
</delete>
</target>
<target name="build-installation-wix"
depends="load-properties">
<property name="windows_native_path" value="${sc.basedir}\lib\native\windows"/>
<property name="windows.jre.arch.file" value="${windows.jre.file}"/>
<property name="windows.download.link" value="${link.download.windows32}"/>
<property name="windows.package.name" value="${package.name}-${sip-communicator.version}-x86.exe"/>
<property name="windows.arch" value="32"/>
<antcall target="build-installation-wix-base" />
</target>
<target name="build-installation-wix-64"
depends="load-properties">
<property name="windows_native_path" value="${sc.basedir}\lib\native\windows-64"/>
<property name="windows.jre.arch.file" value="${windows.jre64.file}"/>
<property name="windows.download.link" value="${link.download.windows64}"/>
<property name="windows.package.name" value="${package.name}-${sip-communicator.version}-x64.exe"/>
<property name="windows.arch" value="64"/>
<antcall target="build-installation-wix-base" />
</target>
<target name="build-installation-wix-base"
depends="clean-install-windows,windows-generate-exe">
<!--
This versionupdate.properties file isn't of interest to the MSI but
is necessary for the site.
-->
<propertyfile file="${windows.app.dir}/versionupdate.properties">
<entry key="last_version" value="${sip-communicator.version}" />
<entry key="download_link"
value="${windows.download.link}" />
<entry key="changes_html" value="updates/index.html" />
</propertyfile>
<!--
Prepare for the execution of heat.exe (which is part of the
preparation for the execution of candle.exe).
-->
<property name="light.dir" value="${windows.app.dir}/tmp/light" />
<mkdir dir="${light.dir}" />
<copy todir="${light.dir}" overwrite="true">
<fileset dir="${inst.resrc}/windows">
<include name="run.bat" />
<include name="run.exe" />
<include name="sc-logo.ico" />
<include name="up2date.exe" />
</fileset>
</copy>
<mkdir dir="${light.dir}/lib" />
<copy todir="${light.dir}/lib" overwrite="true">
<fileset dir="${sc.basedir}/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${sc.basedir}/lib/os-specific/windows">
<include name="*.jar" />
<exclude name="jmf.jar"/>
<exclude name="sound.jar"/>
</fileset>
<fileset dir="${sc.basedir}/lib">
<include name="felix.client.run.properties" />
</fileset>
<fileset dir="${sc.basedir}/resources/install">
<include name="logging.properties" />
</fileset>
</copy>
<mkdir dir="${light.dir}/lib/bundle" />
<copy todir="${light.dir}/lib/bundle" overwrite="true">
<fileset dir="${sc.basedir}/lib/bundle">
<include name="*.jar" />
<exclude name="junit.jar" />
</fileset>
</copy>
<mkdir dir="${light.dir}/native" />
<copy todir="${light.dir}/native" overwrite="true">
<fileset dir="${windows_native_path}">
<include name="*" />
</fileset>
</copy>
<mkdir dir="${light.dir}/sc-bundles" />
<copy todir="${light.dir}/sc-bundles" overwrite="true">
<fileset dir="${sc.basedir}/sc-bundles">
<include name="*.jar" />
<exclude name="*slick.jar" />
</fileset>
<fileset dir="${sc.basedir}/sc-bundles/os-specific/windows">
<include name="*.jar" />
<exclude name="*slick.jar" />
</fileset>
</copy>
<!--
Start OS-specific bundles in felix.client.run.properties such as the
Address Book ContactSourceService implementations at level 69.
-->
<replace file="${light.dir}/lib/felix.client.run.properties"
token="#felix.auto.start.69=">
<replacevalue><![CDATA[felix.auto.start.69=reference:file:sc-bundles/msoutlook.jar]]></replacevalue>
</replace>
<!--
This update-location.properties file is the only of interest to the
MSI i.e. it gets installed on the user machine.
-->
<copy
file="${inst.resrc}/windows/update-location.properties"
todir="${light.dir}"
overwrite="true" />
<!-- Execute heat.exe -->
<exec
executable="C:\Program Files\WiX\heat.exe"
dir="${light.dir}"
failonerror="true">
<arg value="dir" />
<arg value="." />
<arg value="-nologo" />
<arg value="-ag" />
<arg value="-ke" />
<arg value="-out" />
<arg value="${windows.app.dir}\tmp\heat.wxs" />
<arg value="-sfrag" />
</exec>
<xslt
in="${windows.app.dir}/tmp/heat.wxs"
out="${windows.app.dir}/tmp/component-defines.wxi"
style="${inst.resrc}/windows/heat-component-defines.xsl" />
<xslt
in="${windows.app.dir}/tmp/heat.wxs"
out="${windows.app.dir}/tmp/component-refs.wxi"
style="${inst.resrc}/windows/heat-component-refs.xsl" />
<condition property="windows.is.64"
value="yes"
else="no">
<equals arg1="${windows.arch}" arg2="64" />
</condition>
<!-- Finish the preparation for the execution of candle.exe -->
<filter token="APP_EMAIL" value="${application.email}" />
<filter token="APP_NAME" value="${application.name}" />
<filter token="APP_WEB" value="${application.web}" />
<filter token="WelcomeText1" value="${installer.welcome.wtext1}" />
<filter token="WelcomeText2" value="${installer.welcome.wtext2}" />
<filter token="WelcomeText3" value="${installer.welcome.wtext3}" />
<filter token="WINDOWS_JRE_FILE" value="${windows.jre.arch.file}" />
<filter token="WINDOWS_IS_64" value="${windows.is.64}" />
<filter token="WIX_PRODUCT_ID" value="${wix.product.id}" />
<filter token="WIX_UPGRADE_CODE" value="${wix.upgrade.code}" />
<copy
todir="${windows.app.dir}/tmp"
overwrite="true"
filtering="yes">
<fileset dir="${inst.resrc}/windows">
<include name="en-us.wxl" />
<include name="installer-windows.wxs" />
<include name="SCRegistrySpec.wxi" />
<include name="windows_shortcut_specification.wxi" />
</fileset>
</copy>
<!-- Execute candle.exe -->
<exec
executable="C:\Program Files\WiX\candle.exe"
dir="${windows.app.dir}/tmp"
failonerror="true">
<arg value="-nologo" />
<arg value="-ext" />
<arg value="WixUIExtension" />
<arg value="-ext" />
<arg value="WixUtilExtension" />
<arg value="installer-windows.wxs" />
</exec>
<!-- Finish the preparation for the execution of light.exe -->
<copy todir="${light.dir}" overwrite="true">
<fileset dir="${inst.resrc}/doc">
<include name="License.rtf" />
</fileset>
<fileset dir="${inst.resrc}/windows">
<include name="wix-*.jpg" />
</fileset>
</copy>
<!-- Execute light.exe -->
<exec
executable="C:\Program Files\WiX\light.exe"
dir="${light.dir}"
failonerror="true">
<arg value="-nologo" />
<arg value="-ext" />
<arg value="WixUIExtension" />
<arg value="-ext" />
<arg value="WixUtilExtension" />
<arg value="-cultures:en-us" />
<arg value="-loc" />
<arg value="${windows.app.dir}\tmp\en-us.wxl" />
<arg value="-out" />
<arg value="${windows.app.dir}\tmp\setup.msi" />
<arg value="${windows.app.dir}\tmp\installer-windows.wixobj" />
</exec>
<!-- Bootstrap the MSI into an EXE -->
<copy
file="${inst.resrc}/windows/setup.exe"
todir="${windows.app.dir}/tmp"
overwrite="true" />
<exec
executable="msistuff.exe"
dir="${windows.app.dir}/tmp"
failonerror="true">
<arg value="setup.exe" />
<arg value="/v" />
<arg value="200" />
<arg value="/n" />
<arg value="${application.name}" />
<arg value="/o" />
<arg value="INSTALL" />
<arg value="/d" />
<arg value="setup.msi" />
<arg value="/b" />
<arg value="setup.msi" />
</exec>
<copy
file="${windows.app.dir}/tmp/setup.exe"
tofile="${windows.app.dir}/${windows.package.name}"
overwrite="true" />
<!--exec
executable="C:\Program Files\WiX\setupbld.exe"
dir="${light.dir}"
failonerror="true">
<arg value="-out" />
<arg value="${windows.app.dir}\${windows.package.name}" />
<arg value="-mps" />
<arg value="${windows.app.dir}\tmp\setup.msi" />
<arg value="-setup" />
<arg value="C:\Program Files\WiX\setup.exe" />
</exec-->
<exec executable="mt.exe" dir="${windows.app.dir}" failonerror="true">
<arg value="-manifest" />
<arg value="${inst.resrc}\windows\setup.exe.manifest" />
<arg value="-outputresource:${windows.package.name};#1" />
</exec>
<delete dir="${light.dir}" />
<delete dir="${windows.app.dir}/tmp" />
</target>
<!-- - - - - - - - - - - BUILDING RELEASE PACKAGES - - - - - - - - - - - -->
<!-- Internal target called by the "clean target" - removes the macosx-specific file -->
<!-- we only execute if at least one (in this case the first) of the links we are
deleting exist as otherwise we see a bunch of warnings on every compile. -->
<available file="${macosx.resrc.dir}/logging.properties" property="macResourcesExist"/>
<target name="clean-macosx" if="macResourcesExist">
<delete failonerror="false" file="${macosx.resrc.dir}/logging.properties"/>
<delete failonerror="false" file="${macosx.resrc.dir}/felix.client.run.properties"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Resources/Java/libAEGetURLEventHandlerAgent.jnilib"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Growl.framework/Headers"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Growl.framework/Resources"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Growl.framework/Growl"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Growl.framework/Versions/Current"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Headers"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Resources/fr_CA.lproj"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Resources"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Sparkle"/>
<symlink action="delete" failonerror="false"
link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Versions/Current"/>
</target>
<target name="macosx" depends="load-properties"
description="Create an .app package for MACOSX">
<taskdef name="jarbundler"
classname="net.sourceforge.jarbundler.JarBundler"/>
<mkdir dir="${macosx.app.dir}"/>
<property name="macosx.stubfile"
value="${macosx.resrc.dir}/JavaApplicationStub"/>
<condition property="macosx.stubfile"
value="/System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub">
<equals arg1="${os.name}"
arg2="Mac OS X"
casesensitive="false"
trim="true"/>
</condition>
<!-- Prepare the logging.properties file for macosx -->
<copy file="${inst.resrc}/logging.properties"
tofile="${macosx.resrc.dir}/logging.properties"
overwrite="true"/>
<replace file="${macosx.resrc.dir}/logging.properties"
token="java.util.logging.FileHandler.pattern = %h/.sip-communicator/log"
value="java.util.logging.FileHandler.pattern = log"/>
<!-- Prepare the felix.client.run.properties file for macosx -->
<copy file="${lib}/felix.client.run.properties"
tofile="${macosx.resrc.dir}/felix.client.run.properties"
overwrite="true"/>
<replace file="${macosx.resrc.dir}/felix.client.run.properties"
token="org.osgi.framework.system.packages.extra="
value="org.osgi.framework.system.packages.extra= org.growl4j;"/>
<replace file="${macosx.resrc.dir}/felix.client.run.properties"
token="reference:file:sc-bundles/swingnotification.jar \">
<replacevalue><![CDATA[reference:file:sc-bundles/growlnotification.jar \
reference:file:sc-bundles/swingnotification.jar \]]></replacevalue>
</replace>
<!-- Remove the reference to the updatechecker bundle -->
<replace file="${macosx.resrc.dir}/felix.client.run.properties"
token="reference:file:sc-bundles/updatechecker.jar"
value=""/>
<replaceregexp file="${macosx.resrc.dir}/felix.client.run.properties"
match="^org.osgi.framework.storage=\$\{user.home\}/.sip-communicator/sip-communicator.bin"
replace="org.osgi.framework.storage=$\{user.home\}/Library/Application Support/${application.name}/sip-communicator.bin"
flags="m"/>
<!-- We copy macosx-specific bundles from
sc-bundles/os-specific/macosx to sc-bundles -->
<copy todir="${bundles.dest}">
<fileset dir="${bundles.dest.mac}">
<include name="**/*.jar"/>
</fileset>
</copy>
<!-- Delete the old .app if it exists -->
<delete dir="${macosx.app.dir}/${application.name}.app"
quiet="yes" failonerror="false"/>
<!-- Sparkle needs the build number. If it is not
available, we use the normal build label -->
<condition property="sparkle.build"
value="${sparkle}"
else="${build.label}">
<isset property="sparkle"/>
</condition>
<condition property="jvmarg"
value="-client -Xmx256m"
else="" >
<os arch="i386" />
</condition>
<!-- This creates the .app for MacOSX -->
<jarbundler dir="${macosx.app.dir}"
name="${application.name}"
shortname="${application.name}"
signature="sipc"
mainclass="net.java.sip.communicator.launcher.SIPCommunicator"
icon="resources/images/logo/sc_logo_128x128.icns"
jvmversion="1.5+"
version="${sip-communicator.version}"
build="${sparkle.build}"
infostring="SIP Communicator"
bundleid="org.sip-communicator"
stubfile="${macosx.stubfile}"
extraclasspath="/System/Library/Java"
workingdirectory="$APP_PACKAGE/Contents/Resources/Java"
vmoptions="-agentlib:AEGetURLEventHandlerAgent ${jvmarg}">
<javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
<javaproperty name="apple.awt.brushMetalRounded" value="true"/>
<javaproperty name="apple.awt.showGrowBox" value="true"/>
<javaproperty name="java.library.path"
value="$JAVAROOT/lib/native/mac:${system.DYLD_LIBRARY_PATH}"/>
<javaproperty name="jna.library.path"
value="$JAVAROOT/lib/native/mac:${system.DYLD_LIBRARY_PATH}"/>
<javaproperty name="net.java.sip.communicator.SC_HOME_DIR_NAME"
value="${application.name}"/>
<!-- Tell felix to run sip-communicator -->
<javaproperty name="felix.config.properties"
value="file:felix.client.run.properties"/>
<!-- Tell java.util.logging about our logging preferences -->
<javaproperty name="java.util.logging.config.file"
value="logging.properties"/>
<jarfileset dir=".">
<include name="lib/*.jar" />
<include name="lib/os-specific/mac/*.jar" />
<include name="lib/bundle/*.jar" />
<exclude name="lib/bundle/junit.jar" />
<include name="lib/native/mac/*.jnilib" />
<include name="lib/native/mac/*.dylib" />
<exclude name="lib/native/mac/libsparkle_init.dylib" />
<include name="${bundles.dest}/*.jar" />
<exclude name="${bundles.dest}/*-slick.jar" />
<exclude name="${bundles.dest}/sparkle.jar" />
<exclude name="${bundles.dest}/updatechecker.jar" />
<include name="resources/images/logo/sc_logo_128x128.icns" />
</jarfileset>
<javafilelist dir="${macosx.resrc.dir}"
files="logging.properties"/>
<javafilelist dir="${macosx.resrc.dir}"
files="felix.client.run.properties"/>
</jarbundler>
<!-- Install the Growl Framework in the application package -->
<mkdir dir="${macosx.app.dir}/${application.name}.app/Contents/Frameworks"/>
<unzip src="${macosx.resrc.dir}/Growl.framework.zip"
dest="${macosx.app.dir}/${application.name}.app/Contents/Frameworks"/>
<!-- Ant unzip tasks does not preserve symlinks, so we recreate them -->
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Growl.framework/Versions/Current"
resource="./A"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Growl.framework/Headers"
resource="./Versions/Current/Headers"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Growl.framework/Resources"
resource="./Versions/Current/Resources"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Growl.framework/Growl"
resource="./Versions/Current/Growl"/>
<!-- Add the url types in the Info.plist file -->
<replace file="${macosx.app.dir}/${application.name}.app/Contents/Info.plist">
<replacetoken><![CDATA[<key>CFBundleName</key>]]></replacetoken>
<replacevalue><![CDATA[<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>sip URI</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sip</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>xmpp URI</string>
<key>CFBundleURLSchemes</key>
<array>
<string>xmpp</string>
</array>
</dict>
</array>
<key>CFBundleName</key>]]></replacevalue>
</replace>
<symlink resource="lib/native/mac/libAEGetURLEventHandlerAgent.jnilib"
link="${macosx.app.dir}/${application.name}.app/Contents/Resources/Java/libAEGetURLEventHandlerAgent.jnilib"/>
</target>
<!-- Create a MacOSX application package with Sparkle support.
Executed only if the sparkle label property is set, i.e. if the
package is built from CruiseControl -->
<target name="macosx-sparkle" depends="macosx"
if="sparkle"
description="Create an .app package for MACOSX with Sparkle support">
<!-- Add the sparkle bundle path in the felix.client.run.properties file -->
<echo file="${macosx.app.dir}/${application.name}.app/Contents/Resources/Java/felix.client.run.properties"
append="true">felix.auto.start.71= reference:file:sc-bundles/sparkle.jar
</echo>
<!-- Add the Sparkle bundle and JNI to the application package -->
<copy file="${bundles.dest}/sparkle.jar"
todir="${macosx.app.dir}/${application.name}.app/Contents/Resources/Java/sc-bundles/"/>
<copy file="lib/native/mac/libsparkle_init.dylib"
todir="${macosx.app.dir}/${application.name}.app/Contents/Resources/Java/lib/native/mac/"/>
<!-- Add public key file to the application bundle -->
<copy file="${macosx.resrc.dir}/sparkle_dsa_pub.pem"
todir="${macosx.app.dir}/${application.name}.app/Contents/Resources/"/>
<!-- Add the Sparkle properties in the Info.plist file -->
<replace file="${macosx.app.dir}/${application.name}.app/Contents/Info.plist">
<replacetoken><![CDATA[<key>CFBundleName</key>]]></replacetoken>
<replacevalue><![CDATA[<key>SUCheckAtStartup</key>
<string>YES</string>
<key>SUScheduledCheckInterval</key>
<string>86400</string>
<key>SUPublicDSAKeyFile</key>
<string>sparkle_dsa_pub.pem</string>
<key>SUFeedURL</key>
<string>_DOWNLOAD_LINK_</string>
<key>SUShowReleaseNotes</key>
<string>YES</string>
<key>CFBundleName</key>]]></replacevalue>
</replace>
<!-- Now replace the download link-->
<replace file="${macosx.app.dir}/${application.name}.app/Contents/Info.plist">
<replacefilter token="_DOWNLOAD_LINK_" value="${link.updates.macosx}"/>
</replace>
<!-- Install the Sparkle Framework in the application package -->
<mkdir dir="${macosx.app.dir}/${application.name}.app/Contents/Frameworks"/>
<unzip src="${macosx.resrc.dir}/Sparkle.framework.zip"
dest="${macosx.app.dir}/${application.name}.app/Contents/Frameworks"/>
<!-- Ant unzip tasks does not preserve symlinks, so we recreate them -->
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Versions/Current"
resource="./A"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Headers"
resource="./Versions/Current/Headers"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Resources"
resource="./Versions/Current/Resources"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Sparkle"
resource="./Versions/Current/Sparkle"/>
<symlink link="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Resources/fr_CA.lproj"
resource="./fr.lproj"/>
<!-- Restore the file permissions to the Sparke relaunch tool -->
<chmod file="${macosx.app.dir}/${application.name}.app/Contents/Frameworks/Sparkle.framework/Resources/relaunch"
perm="ugo+rx">
</chmod>
</target>
<!-- Create the DMG - This only works on MacOSX (need hdiutil) -->
<target name="dmg" depends="macosx-sparkle"
if="is.running.macos"
description="Create a .dmg package for MACOSX (only works on MACOSX)">
<property name="macosx.dmg.name"
value="${package.name}-${sip-communicator.version}.dmg"/>
<property name="macosx.dmg.tmpname"
value="${package.name}-tmp.dmg"/>
<delete file="${macosx.app.dir}/${macosx.dmg.name}"
quiet="yes" failonerror="false"/>
<!-- Create a temporary Disk Image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="create"/>
<arg value="-srcfolder"/>
<arg value="${macosx.app.dir}/${application.name}.app"/>
<arg value="-volname"/>
<arg value="${application.name}"/>
<arg value="-ov"/>
<arg value="${macosx.app.dir}/${macosx.dmg.tmpname}"/>
<arg value="-format"/>
<arg value="UDRW"/>
</exec>
<!-- Attach the temporary image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="attach"/>
<arg value="${macosx.app.dir}/${macosx.dmg.tmpname}"/>
<arg value="-mountroot"/>
<arg value="${release}/"/>
</exec>
<!-- Copy the background, icon and DS_Store files -->
<mkdir dir="${release}/${application.name}/.background"/>
<copy file="${macosx.resrc.dir}/dmg-background.png"
tofile="${release}/${application.name}/.background/background.png"
overwrite="true"/>
<copy file="${macosx.resrc.dir}/dmg-VolumeIcon.icns"
tofile="${release}/${application.name}/.VolumeIcon.icns"
overwrite="true"/>
<copy file="${macosx.resrc.dir}/dmg-DS_Store"
tofile="${release}/${application.name}/.DS_Store"
overwrite="true"/>
<exec executable="/Developer/Tools/SetFile" os="Mac OS X">
<arg value="-a"/>
<arg value="C"/>
<arg value="${release}/${application.name}"/>
</exec>
<!-- Add a symbolic link to the Applications directory -->
<symlink link="${release}/${application.name}" resource="/Applications"/>
<!-- Detach the temporary image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="detach"/>
<arg value="${release}/${application.name}"/>
</exec>
<!-- Compress it to a new image -->
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="convert"/>
<arg value="${macosx.app.dir}/${macosx.dmg.tmpname}"/>
<arg value="-format"/>
<arg value="UDZO"/>
<arg value="-o"/>
<arg value="${macosx.app.dir}/${macosx.dmg.name}"/>
</exec>
<!-- Delete the temporary image -->
<delete file="${macosx.app.dir}/${macosx.dmg.tmpname}"
quiet="yes" failonerror="false"/>
</target>
<!-- Outputs a warning notifying the user that a dpkg tool is missing. -->
<target name="dpkg-build-warning" unless="dpkg.build.present">
<echo message="Either the ${dpkg-buildpackage} tool or the debhelper tools was not found on your system."/>
<echo message="Try installing the 'dpkg-dev' and 'debhelper' packages"/>
</target>
<!-- Create a Debian package - This needs dpkg utilities -->
<target name="deb" depends="load-properties,dpkg-build-warning,-prepare-debian-sh"
if="dpkg.build.present"
description="Create a .deb package for Debian (needs dpkg utilities)">
<!-- Prepare the changelog file -->
<copy file="${inst.resrc}/debian/changelog.tmpl"
tofile="${inst.resrc}/debian/changelog"
overwrite="true"/>
<replace file="${inst.resrc}/debian/changelog"
token="_VERSION_"
value="${sip-communicator.version}"/>
<replace file="${inst.resrc}/debian/changelog"
token="_PACKAGE_NAME_"
value="${package.name}"/>
<get src="http://bluejimp.com/sip-communicator/changelogs/extended-changelog-${label}.txt"
dest="changelog-${label}.txt" ignoreerrors="true"/>
<loadfile property="latest.changelog"
srcFile="changelog-${label}.txt" failonerror="false"/>
<!-- Load a default value if file with changelogs is missing -->
<condition property="latest.changelog" value="Nightly builds">
<not>
<isset property="latest.changelog"/>
</not>
</condition>
<replace file="${inst.resrc}/debian/changelog"
token="_CHANGES_"
value="${latest.changelog}"/>
<delete file="changelog-${label}.txt"/>
<!-- Prepare the control file -->
<copy file="${inst.resrc}/debian/control.tmpl"
tofile="${inst.resrc}/debian/control"
overwrite="true"/>
<replace file="${inst.resrc}/debian/control"
token="_PACKAGE_NAME_"
value="${package.name}"/>
<!-- Prepare the rules file -->
<copy file="${inst.resrc}/debian/rules.tmpl"
tofile="${inst.resrc}/debian/rules"
overwrite="true"/>
<replace file="${inst.resrc}/debian/rules"
token="_PACKAGE_NAME_"
value="${package.name}"/>
<chmod file="${inst.resrc}/debian/rules" perm="+x"/>
<!-- Put the current date in the changelog -->
<tstamp>
<format property="date"
pattern="EEE, d MMM yyyy HH:mm:ss Z"
locale="en,US"/>
</tstamp>
<replace file="${inst.resrc}/debian/changelog"
token="_DATE_"
value="${date}"/>
<!-- Prepare felix.client.run.properties and put some specific bundles -->
<copy file="${lib}/felix.client.run.properties"
tofile="${inst.resrc}/debian/felix.client.run.properties"
overwrite="true"/>
<replace file="${inst.resrc}/debian/felix.client.run.properties"
token="reference:file:sc-bundles/swingnotification.jar \">
<replacevalue><![CDATA[reference:file:sc-bundles/galagonotification.jar \
reference:file:sc-bundles/swingnotification.jar \]]></replacevalue>
</replace>
<!-- Build i386 binary package -->
<exec executable="${dpkg-buildpackage}" dir="${inst.resrc}">
<arg value="-rfakeroot"/>
<arg value="-tc"/>
<arg value="-us"/>
<arg value="-uc"/>
<arg value="-b"/>
<arg value="-d"/>
<arg value="-ai386"/>
</exec>
<!-- Build amd64 binary package -->
<exec executable="${dpkg-buildpackage}" dir="${inst.resrc}">
<arg value="-rfakeroot"/>
<arg value="-tc"/>
<arg value="-us"/>
<arg value="-uc"/>
<arg value="-b"/>
<arg value="-d"/>
<arg value="-aamd64"/>
</exec>
<mkdir dir="${debian.dir}"/>
<move todir="${debian.dir}">
<fileset dir="${sc.basedir}/resources">
<include name="${package.name}*"/>
</fileset>
</move>
<!-- Only i386 for now -->
<propertyfile file="${debian.dir}/versionupdate.properties"
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="${link.download.debian}"/>
</propertyfile>
<!--
Copy changelogs before deleting them, this changelogs are used from
tools like Update Manager in Ubuntu distribution.
-->
<copy file="${inst.resrc}/debian/changelog"
tofile="${debian.dir}/${package.name}_${sip-communicator.version}_i386.changelog"/>
<copy file="${inst.resrc}/debian/changelog"
tofile="${debian.dir}/${package.name}_${sip-communicator.version}_amd64.changelog"/>
<!-- Delete the temporary files -->
<delete quiet="yes" failonerror="false">
<fileset dir="${inst.resrc}/debian/">
<include name="changelog"/>
<include name="control"/>
<include name="rules"/>
<include name="sip-communicator.sh"/>
<include name="felix.client.run.properties"/>
</fileset>
</delete>
</target>
<!-- Outputs a warning notifying the user that dpkg-scanpackages is not installed. -->
<target name="dpkg-scan-warning" unless="dpkg.scan.present">
<echo message="The ${dpkg-scanpackages} tool was not found on your system."/>
<echo message="Try installing the 'dpkg-dev' package "/>
</target>
<!-- Prepare to deploy the Debian package - This needs dpkg utilities -->
<target name="deb-rel" depends="deb,dpkg-scan-warning"
if="dpkg.scan.present"
description="Prepare to deploy Debian package (needs dpkg utilities)">
<mkdir dir="${debian.binary.dir}"/>
<move todir="${debian.binary.dir}">
<fileset dir="${debian.dir}">
<include name="sip-communicator*386*"/>
</fileset>
</move>
<exec executable="${dpkg-scanpackages}"
dir="${debian.dir}"
output="${debian.binary.dir}/dpkg-scanpackages.out"
errorproperty="dpkg-scanpackages.err">
<arg value="binary"/>
<arg value="/dev/null"/>
</exec>
<exec executable="/bin/gzip"
dir="${debian.dir}"
input="${debian.binary.dir}/dpkg-scanpackages.out"
output="${debian.binary.dir}/Packages.gz">
<arg value="-9c"/>
</exec>
<!-- Delete the temporary file -->
<delete file="${debian.binary.dir}/dpkg-scanpackages.out"
quiet="yes" failonerror="false"/>
</target>
</project>