Commit c762c461 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Updated Mac OS X DMG creation to be cleaner. Changed location of builds

in the process.  Fixes for upgrades breaking existing configs.


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9658 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2ecb0f1a
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
${java.home} ${java.home}
</webRoot> </webRoot>
<classesDir> <classesDir>
dafasdfdsa XXXXXXXXX
</classesDir> </classesDir>
</development> </development>
]]> ]]>
...@@ -1619,21 +1619,27 @@ ...@@ -1619,21 +1619,27 @@
</target> </target>
<!-- Mac installer ========================================================================= --> <!-- Mac installer ========================================================================= -->
<property name="mac.pkg.dir" value="${basedir}/macpkg"/> <property name="target.osx" value="${work.dir}/osx" />
<property name="mac.dmg.dir" value="${basedir}/Openfire"/> <property name="mac.pkg.dir" value="${target.osx}/macpkg"/>
<property name="mac.dmg.file" value="${basedir}/openfire.dmg"/> <property name="mac.dmg.dir" value="${target.osx}/Openfire"/>
<property name="mac.template" value="${basedir}/build/osx/template"/> <property name="mac.dmg.file" value="${release.dest.dir}/openfire.dmg"/>
<property name="mac.template" value="${target.osx}/template"/>
<property name="mac.prefpane.build" value="${target.osx}/prefPane"/>
<target name="mac.delete"> <target name="mac.delete">
<delete dir="${mac.pkg.dir}"/> <delete dir="${mac.pkg.dir}" failonerror="false"/>
<delete dir="${mac.dmg.dir}"/> <delete dir="${mac.dmg.dir}" failonerror="false"/>
<delete file="${mac.dmg.file}"/> <delete file="${mac.dmg.file}" failonerror="false"/>
<delete dir="${mac.template}"/> <delete dir="${mac.template}" failonerror="false"/>
<delete dir="${mac.prefpane.build}" failonerror="false"/>
</target> </target>
<target name="mac.prefpane"> <target name="mac.prefpane">
<!-- install will put it in macpkg/Library/PreferencePanes/ as specified in the target settings --> <!-- install will put it in macpkg/Library/PreferencePanes/ as specified in the target settings -->
<exec executable="/usr/bin/xcodebuild" dir="${basedir}/build/osx/openfirePrefPane/" failonerror="true"> <copy todir="${mac.prefpane.build}" >
<fileset dir="${basedir}/build/osx/openfirePrefPane" />
</copy>
<exec executable="/usr/bin/xcodebuild" dir="${mac.prefpane.build}" failonerror="true">
<arg value="-configuration"/> <arg value="-configuration"/>
<arg value="Deployment"/> <arg value="Deployment"/>
<arg value="-target"/> <arg value="-target"/>
...@@ -1647,6 +1653,7 @@ ...@@ -1647,6 +1653,7 @@
<copy todir="${mac.pkg.dir}/usr/local/openfire"> <copy todir="${mac.pkg.dir}/usr/local/openfire">
<fileset dir="${target.dir}/openfire"> <fileset dir="${target.dir}/openfire">
<exclude name="**/openfired"/> <exclude name="**/openfired"/>
<exclude name="**/openfirectl"/>
<exclude name="**/redhat"/> <exclude name="**/redhat"/>
<exclude name="**/embedded-db*"/> <exclude name="**/embedded-db*"/>
<exclude name="**/redhat-postinstall.sh"/> <exclude name="**/redhat-postinstall.sh"/>
...@@ -1658,7 +1665,7 @@ ...@@ -1658,7 +1665,7 @@
<mkdir dir="${mac.dmg.dir}"/> <mkdir dir="${mac.dmg.dir}"/>
<mkdir dir="${mac.pkg.dir}/Library/PreferencePanes"/> <mkdir dir="${mac.pkg.dir}/Library/PreferencePanes"/>
<copy todir="${mac.pkg.dir}/Library/PreferencePanes"> <copy todir="${mac.pkg.dir}/Library/PreferencePanes">
<fileset dir="${basedir}/build/osx/openfirePrefPane/build/UninstalledProducts/"/> <fileset dir="${mac.prefpane.build}/build/UninstalledProducts/"/>
</copy> </copy>
<chmod perm="o+x"> <chmod perm="o+x">
<fileset dir="${mac.pkg.dir}/Library/PreferencePanes/Openfire.prefPane/Contents/MacOS/"> <fileset dir="${mac.pkg.dir}/Library/PreferencePanes/Openfire.prefPane/Contents/MacOS/">
...@@ -1679,22 +1686,43 @@ ...@@ -1679,22 +1686,43 @@
<!-- Create a Mac OS X installer --> <!-- Create a Mac OS X installer -->
<target name="mac.pkg" depends="mac.prepare"> <target name="mac.pkg" depends="mac.prepare">
<exec executable="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"> <tstamp>
<format property="copyrightyear" pattern="yyyy"/>
</tstamp>
<copy todir="${target.osx}" file="${basedir}/build/osx/Info.plist"/>
<replace file="${target.osx}/Info.plist">
<replacefilter token="%VERSION%" value="${version}"/>
<replacefilter token="%VERSIONMAJOR%" value="${version.major}"/>
<replacefilter token="%VERSIONMINOR%" value="${version.minor}"/>
<replacefilter token="%COPYRIGHT%" value="${copyrightyear}"/>
</replace>
<copy todir="${target.osx}" file="${basedir}/build/osx/Description.plist"/>
<exec executable="/Developer/Tools/packagemaker">
<arg value="-build"/> <arg value="-build"/>
<arg value="-proj"/> <arg value="-f"/>
<arg value="${basedir}/build/osx/openfire.pmproj"/> <arg value="${mac.pkg.dir}"/>
<arg value="-i"/>
<arg value="${target.osx}/Info.plist"/>
<arg value="-d"/>
<arg value="${target.osx}/Description.plist"/>
<arg value="-r"/>
<arg value="${basedir}/build/osx/resources"/>
<!--<arg value="-proj"/>
<arg value="${basedir}/build/osx/openfire.pmproj"/> -->
<arg value="-p"/> <arg value="-p"/>
<arg value="${mac.template}/Openfire.pkg"/> <arg value="${mac.template}/Openfire.pkg"/>
<arg value="-ds"/>
<arg value="-v"/> <arg value="-v"/>
</exec> </exec>
</target> </target>
<target name="installer.mac" depends="mac.pkg" description="Creates a Mac OS X package"> <target name="installer.mac" depends="mac.pkg" description="Creates a Mac OS X package">
<mkdir dir="${release.dest.dir}"/>
<exec executable="hdiutil" failonerror="true"> <exec executable="hdiutil" failonerror="true">
<arg line="create -srcfolder '${mac.template}' -volname 'Openfire' -fs HFS+ -fsargs '-c c=64,a=16,e=16' -format UDRW '${basedir}/tmp.dmg'"/> <arg line="create -srcfolder '${mac.template}' -volname 'Openfire' -fs HFS+ -fsargs '-c c=64,a=16,e=16' -format UDRW '${target.osx}/tmp.dmg'"/>
</exec> </exec>
<exec executable="hdiutil" failonerror="true"> <exec executable="hdiutil" failonerror="true">
<arg line="attach '${basedir}/tmp.dmg' -readwrite -noverify -noautoopen -mountpoint '${mac.dmg.dir}'"/> <arg line="attach '${target.osx}/tmp.dmg' -readwrite -noverify -noautoopen -noidme -mountpoint '${mac.dmg.dir}'"/>
</exec> </exec>
<exec executable="osascript" dir="${basedir}/build/osx/" failonerror="true"> <exec executable="osascript" dir="${basedir}/build/osx/" failonerror="true">
<arg value="dmg_openfire.scpt"/> <arg value="dmg_openfire.scpt"/>
...@@ -1710,9 +1738,9 @@ ...@@ -1710,9 +1738,9 @@
<arg line="detach ${mac.dmg.dir} -quiet -force"/> <arg line="detach ${mac.dmg.dir} -quiet -force"/>
</exec> </exec>
<exec executable="hdiutil" failonerror="true"> <exec executable="hdiutil" failonerror="true">
<arg line="convert ${basedir}/tmp.dmg -format UDZO -imagekey zlib-level=9 -o ${mac.dmg.file}"/> <arg line="convert ${target.osx}/tmp.dmg -format UDZO -imagekey zlib-level=9 -o ${mac.dmg.file}"/>
</exec> </exec>
<delete file="${basedir}/tmp.dmg"/> <delete file="${target.osx}/tmp.dmg"/>
</target> </target>
<!-- Debian package ========================================================================= --> <!-- Debian package ========================================================================= -->
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionDescription</key>
<string>Openfire is a leading Open Source, cross-platform IM server based on the XMPP (Jabber) protocol.</string>
<key>IFPkgDescriptionTitle</key>
<string>Openfire XMPP Server</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>%VERSION%, Copyright @ %COPYRIGHT% Jive Software</string>
<key>CFBundleIdentifier</key>
<string>com.jivesoftware.openfire</string>
<key>CFBundleShortVersionString</key>
<string>%VERSION%</string>
<key>IFMajorVersion</key>
<integer>%VERSIONMAJOR%</integer>
<key>IFMinorVersion</key>
<integer>%VERSIONMINOR%</integer>
<key>IFPkgFlagAllowBackRev</key>
<false/>
<key>IFPkgFlagAuthorizationAction</key>
<string>AdminAuthorization</string>
<key>IFPkgFlagBackgroundAlignment</key>
<string>topleft</string>
<key>IFPkgFlagBackgroundScaling</key>
<string>proportional</string>
<key>IFPkgFlagDefaultLocation</key>
<string>/</string>
<key>IFPkgFlagFollowLinks</key>
<true/>
<key>IFPkgFlagInstallFat</key>
<false/>
<key>IFPkgFlagInstalledSize</key>
<integer>12920</integer>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFlagOverwritePermissions</key>
<false/>
<key>IFPkgFlagRelocatable</key>
<false/>
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
<key>IFPkgFlagUpdateInstalledLanguages</key>
<false/>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
<key>IFPkgRelocatedPath</key>
<string>/</string>
</dict>
</plist>
#!/bin/sh #!/bin/sh
OPENFIRE_HOME=/usr/local/openfire/ OPENFIRE_HOME=/usr/local/openfire/
OPENFIRE_GID=`cat /private/tmp/openfiregid` OPENFIRE_GID=`cat /private/tmp/openfiregid`
rm /private/tmp/openfiregid rm /private/tmp/openfiregid
......
#!/bin/sh #!/bin/sh
if [ -f /tmp/openfire.xml ]; then if [ -f /tmp/openfireInstallBackup/openfire.xml ]; then
mv /tmp/openfire.xml /usr/local/openfire/conf/ /bin/mv /tmp/openfireInstallBackup/openfire.xml /usr/local/openfire/conf/openfire.xml
fi fi
if [ -f /tmp/security ]; then if [ -f /tmp/openfireInstallBackup/keystore ]; then
mv /tmp/security /usr/local/openfire/resources/ /bin/mv /tmp/openfireInstallBackup/keystore /usr/local/openfire/resources/security/keystore
fi fi
if [ -f /tmp/embedded-db ]; then if [ -f /tmp/openfireInstallBackup/truststore ]; then
mv /tmp/embedded-db /usr/local/openfire/embedded-db /bin/mv /tmp/openfireInstallBackup/truststore /usr/local/openfire/resources/security/truststore
fi fi
if [ -f /tmp/enterprise ]; then if [ -f /tmp/openfireInstallBackup/client.truststore ]; then
mv /tmp/enterprise /usr/local/openfire/enterprise /bin/mv /tmp/openfireInstallBackup/client.truststore /usr/local/openfire/resources/security/client.truststore
fi
if [ -f /tmp/plugins ]; then
mv /tmp/plugins /usr/local/openfire/plugins
fi fi
OPENFIRE_HOME=/usr/local/openfire/ OPENFIRE_HOME=/usr/local/openfire/
......
#!/bin/sh #!/bin/sh
if [ -f /usr/local/openfire ]; then if [ -d /usr/local/openfire ]; then
# stop openfire # stop openfire
/bin/launchctl unload /Library/LaunchDaemons/org.jivesoftware.openfire.plist /bin/launchctl unload /Library/LaunchDaemons/org.jivesoftware.openfire.plist
# preserve these files, they should never be upgraded # remove existing tmp storage
cp /usr/local/openfire/conf/openfire.xml /tmp/ /bin/rm -rf /tmp/openfireInstallBackup
cp -r /usr/local/openfire/resources/security /tmp/
cp -r /usr/local/openfire/embedded-db /tmp/
cp -r /usr/local/openfire/enterprise /tmp/
cp -r /usr/local/openfire/plugins /tmp/
fi # create tmp storage location and assorted pieces
/bin/mkdir -p /tmp/openfireInstallBackup
# preserve these files, they should never be upgraded
if [ -f /usr/local/openfire/conf/openfire.xml ]; then
/bin/cp /usr/local/openfire/conf/openfire.xml /tmp/openfireInstallBackup/openfire.xml
fi
if [ -f /usr/local/openfire/resources/security/keystore ]; then
/bin/cp /usr/local/openfire/resources/security/keystore /tmp/openfireInstallBackup/keystore
fi
if [ -f /usr/local/openfire/resources/security/truststore ]; then
/bin/cp /usr/local/openfire/resources/security/truststore /tmp/openfireInstallBackup/truststore
fi
if [ -f /usr/local/openfire/resources/security/client.truststore ]; then
/bin/cp /usr/local/openfire/resources/security/client.truststore /tmp/openfireInstallBackup/client.truststore
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment