From 382cb45063f25b0e8ae5324b955b6deb4f0b01aa Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Mon, 27 May 2013 15:33:03 +0000
Subject: [PATCH] Fix for OpenDJ-909 : ControlPanel.app exits during startup. There are a number of issues with the Mac Apps, and this commit fixes most of them, but we should also change the icon name and picture once we have a logo for OpenDJ. The version and revision numbers are now automatically set when packaging. The -client JVM option is deprecated and thus removed. And we properly set the ServerRoot to allow ControlPanel to work when double clicking the icon. Note that Mac App are dependant on the JavaApplicationStub that only supports Java6. We fine for now, since OpenDJ is built with target 1.6, but we will need to redo the Apps when/if we switch to 1.7 by default.
---
opends/build.xml | 31 +++++++++++++++++++++++++------
opends/resource/mac/Uninstall.app/Contents/Info.plist | 6 ++++--
opends/resource/mac/ControlPanel.app/Contents/Info.plist | 6 ++++--
opends/resource/mac/QuickSetup.app/Contents/Info.plist | 6 ++++--
4 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/opends/build.xml b/opends/build.xml
index 9c9d090..d5ecc91 100644
--- a/opends/build.xml
+++ b/opends/build.xml
@@ -201,6 +201,7 @@
compilation. -->
<presetdef name="javac">
<javac optimize="true" includeantruntime="false"
+ source="1.6" target="1.6"
debug="on" debuglevel="${build.debuglevel}"
deprecation="true" fork="true"
memoryInitialSize="${MEM}" memoryMaximumSize="${MEM}">
@@ -1147,10 +1148,10 @@
</classpath>
</manifestclasspath>
<jar jarfile="${pdir}/lib/bootstrap.jar">
- <manifest>
+ <manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Class-Path" value="${manifest.classpath}" />
- </manifest>
+ </manifest>
</jar>
<!-- Create buildinfo files -->
@@ -1213,6 +1214,12 @@
<copy todir="${pdir}/QuickSetup.app">
<fileset dir="${resource.dir}/mac/QuickSetup.app" />
</copy>
+ <replace file="${pdir}/QuickSetup.app/Contents/Info.plist"
+ token="@version@"
+ value="${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}"/>
+ <replace file="${pdir}/QuickSetup.app/Contents/Info.plist"
+ token="@revision@"
+ value="${REVISION_NUMBER}"/>
<chmod perm="755">
<fileset dir="${pdir}">
<include name="QuickSetup.app/Contents/MacOS/JavaApplicationStub" />
@@ -1221,6 +1228,12 @@
<copy todir="${pdir}/Uninstall.app">
<fileset dir="${resource.dir}/mac/Uninstall.app" />
</copy>
+ <replace file="${pdir}/Uninstall.app/Contents/Info.plist"
+ token="@version@"
+ value="${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}"/>
+ <replace file="${pdir}/Uninstall.app/Contents/Info.plist"
+ token="@revision@"
+ value="${REVISION_NUMBER}"/>
<chmod perm="755">
<fileset dir="${pdir}">
<include name="Uninstall.app/Contents/MacOS/JavaApplicationStub" />
@@ -1229,6 +1242,12 @@
<copy todir="${pdir}/bin/ControlPanel.app">
<fileset dir="${resource.dir}/mac/ControlPanel.app" />
</copy>
+ <replace file="${pdir}/bin/ControlPanel.app/Contents/Info.plist"
+ token="@version@"
+ value="${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}"/>
+ <replace file="${pdir}/bin/ControlPanel.app/Contents/Info.plist"
+ token="@revision@"
+ value="${REVISION_NUMBER}"/>
<chmod perm="755">
<fileset dir="${pdir}/bin">
<include name="ControlPanel.app/Contents/MacOS/JavaApplicationStub" />
@@ -1355,7 +1374,7 @@
<mkdir dir="${build.dir}/deb/control" />
<taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask"/>
-
+
<copy todir="${build.dir}/deb/control">
<fileset dir="resource/debian/control"/>
<filterset begintoken="[[" endtoken="]]">
@@ -1371,11 +1390,11 @@
<copy file="resource/debian/control/preinst" tofile="${build.dir}/deb/control" />
<copy file="resource/debian/control/postinst" tofile="${build.dir}/deb/control" />
- <copy file="resource/debian/control/prerm" tofile="${build.dir}/deb/control" />
+ <copy file="resource/debian/control/prerm" tofile="${build.dir}/deb/control" />
<copy file="resource/debian/control/postrm" tofile="${build.dir}/deb/control" />
<replace dir="${build.dir}/deb/control/" token="@prefix@" value="${prefix}" />
-
+
<deb destfile="${package.dir}/${SHORT_NAME}_${VERSION_NUMBER_STRING}-${release}_all.deb"
control="${build.dir}/deb/control">
<tarfileset dir="${package.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}"
@@ -2704,7 +2723,7 @@
<target name="clean-ivy-cache" depends="install-ivy" description="--> clean the ivy cache">
<ivy:cleancache/>
- </target>
+ </target>
<import file="build-svr4.xml"/>
<import file="build-pkg.xml"/>
diff --git a/opends/resource/mac/ControlPanel.app/Contents/Info.plist b/opends/resource/mac/ControlPanel.app/Contents/Info.plist
index f7e18f3..ed7ce1d 100644
--- a/opends/resource/mac/ControlPanel.app/Contents/Info.plist
+++ b/opends/resource/mac/ControlPanel.app/Contents/Info.plist
@@ -6,8 +6,10 @@
<string>OpenDJ Control Panel</string>
<key>CFBundleIdentifier</key>
<string>org.opends.guitools.controlpanel.ControlPanelLauncher</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@version@</string>
<key>CFBundleVersion</key>
- <string>2.3.0</string>
+ <string>@revision@</string>
<key>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleExecutable</key>
@@ -25,7 +27,7 @@
<key>Java</key>
<dict>
<key>VMOptions</key>
- <string>-client</string>
+ <string>-Dorg.opends.server.ServerRoot=$APP_PACKAGE/../..</string>
<key>MainClass</key>
<string>org.opends.guitools.controlpanel.ControlPanelLauncher</string>
<key>JVMVersion</key>
diff --git a/opends/resource/mac/QuickSetup.app/Contents/Info.plist b/opends/resource/mac/QuickSetup.app/Contents/Info.plist
index 3261fb5..c6fdfa0 100644
--- a/opends/resource/mac/QuickSetup.app/Contents/Info.plist
+++ b/opends/resource/mac/QuickSetup.app/Contents/Info.plist
@@ -6,8 +6,10 @@
<string>OpenDJ QuickSetup</string>
<key>CFBundleIdentifier</key>
<string>org.opends.quicksetup.installer.SetupLauncher</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@version@</string>
<key>CFBundleVersion</key>
- <string>2.3.0</string>
+ <string>@revision@</string>
<key>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleExecutable</key>
@@ -25,7 +27,7 @@
<key>Java</key>
<dict>
<key>VMOptions</key>
- <string>-client</string>
+ <string>-Dorg.opends.server.ServerRoot=$APP_PACKAGE/..</string>
<key>MainClass</key>
<string>org.opends.quicksetup.installer.SetupLauncher</string>
<key>JVMVersion</key>
diff --git a/opends/resource/mac/Uninstall.app/Contents/Info.plist b/opends/resource/mac/Uninstall.app/Contents/Info.plist
index 97c2b6b..9faa476 100644
--- a/opends/resource/mac/Uninstall.app/Contents/Info.plist
+++ b/opends/resource/mac/Uninstall.app/Contents/Info.plist
@@ -6,8 +6,10 @@
<string>OpenDJ Uninstall</string>
<key>CFBundleIdentifier</key>
<string>org.opends.guitools.uninstaller.UninstallLauncher</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@version@</string>
<key>CFBundleVersion</key>
- <string>2.3.0</string>
+ <string>@revision@</string>
<key>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleExecutable</key>
@@ -25,7 +27,7 @@
<key>Java</key>
<dict>
<key>VMOptions</key>
- <string>-client</string>
+ <string>-Dorg.opends.server.ServerRoot=$APP_PACKAGE/..</string>
<key>MainClass</key>
<string>org.opends.guitools.uninstaller.UninstallLauncher</string>
<key>JVMVersion</key>
--
Gitblit v1.10.0