Add make targets for an OS X staff client. The Makefile can be run on Linux but has
authorJames Fournie <jfournie@sitka.bclibraries.ca>
Wed, 4 May 2011 19:37:31 +0000 (12:37 -0700)
committerJames Fournie <jfournie@sitka.bclibraries.ca>
Mon, 1 Aug 2011 22:38:58 +0000 (15:38 -0700)
the added benefit of creating a DMG file if run on OS X.

OS X uses a different icon file format so the windows ico was converted.

Note that building the osx-client requires curl (wget is not installed
by default on macs)

Update capability is not yet complete

Open-ILS/xul/staff_client/Info.plist [new file with mode: 0644]
Open-ILS/xul/staff_client/Makefile.am
Open-ILS/xul/staff_client/evergreen-icon-mac.icns [new file with mode: 0644]

diff --git a/Open-ILS/xul/staff_client/Info.plist b/Open-ILS/xul/staff_client/Info.plist
new file mode 100644 (file)
index 0000000..b9aaf72
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleExecutable</key>
+       <string>xulrunner</string>
+       <key>CFBundleGetInfoString</key>
+       <string>Evergreen Staff Client BUILD_ID</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>Evergreen Staff Client</string>
+    <key>CFBundleIconFile</key>
+    <string>evergreen-icon-mac.icns</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleShortVersionString</key>
+       <string>BUILD_ID</string>
+       <key>CFBundleVersion</key>
+       <string>BUILD_ID.BUILD_ID</string>
+       <key>NSAppleScriptEnabled</key>
+       <true/>
+</dict>
+</plist>
index f51e4dc..6bf7b71 100644 (file)
@@ -14,6 +14,11 @@ XULRUNNER_WINFILE=xulrunner-$(XULRUNNER_VERSION).en-US.win32.zip
 XULRUNNER_LINUXFILE=xulrunner-$(XULRUNNER_VERSION).en-US.linux-i686.tar.bz2
 XULRUNNER_URL=http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/$(XULRUNNER_VERSION)/runtimes/
 
+# mac stuff
+XULRUNNER_OSXFILE=xulrunner-$(XULRUNNER_VERSION).en-US.mac-i386.sdk.tar.bz2
+XULRUNNER_SDK=http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/$(XULRUNNER_VERSION)/sdk/
+OSX_APP_FILE="Evergreen\ ${STAFF_CLIENT_VERSION}.app"
+
 OPENSRF_JSLIBS = "$(OPENSRF_LIBS)/javascript"
 CHROME_LOCALES = $$(ls -1 chrome/locale)
 SKIN_CSS = $$(ls -1 server/skin/*css | sed -e "s/.css/_custom.css/")
@@ -303,6 +308,34 @@ linux-client: linux-xulrunner
        @cd client; tar cjf ../evergreen_staff_client.tar.bz2 *; cd ..
        @echo 'Done'
 
+# For OS X we need to use the SDK since the runtime pkg isn't really useful for our purposes
+osx-xulrunner: client_app
+       @echo 'Preparing OS X xulrunner'
+       @if [ ! -f ${XULRUNNER_OSXFILE} ]; then curl -O ${XULRUNNER_SDK}${XULRUNNER_OSXFILE}; fi;
+       @tar xjf ${XULRUNNER_OSXFILE} --exclude='xulrunner-sdk/idl/' --exclude='xulrunner-sdk/include' --exclude='xulrunner-sdk/host' --exclude='xulrunner-sdk/lib' --exclude='xulrunner-sdk/sdk'
+       @if [ -f client/defaults/preferences/autoupdate.js ]; then echo 'pref("app.update.channel","mac");' >> client/defaults/preferences/autochannel.js; fi;
+
+# this will work on linux, it builds the .app directory/bundle
+osx-client: osx-xulrunner
+       @echo 'Building Evergreen.app directory structure for OS X within client/'
+       @mkdir -p "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework/Versions"
+       @mkdir -p "${OSX_APP_FILE}/Contents/MacOS"
+       @mv client "${OSX_APP_FILE}/Contents/Resources"
+       @cp evergreen-icon-mac.icns "${OSX_APP_FILE}/Contents/Resources/evergreen-icon-mac.icns"
+       @mv xulrunner-sdk/bin "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework/Versions/${XULRUNNER_VERSION}"
+       @rmdir xulrunner-sdk
+       @ln -sf "${XULRUNNER_VERSION}" "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework/Versions/Current"
+       @sed s/BUILD_ID/${STAFF_CLIENT_STAMP_ID}/g Info.plist > "${OSX_APP_FILE}/Contents/Info.plist" 
+       @cp "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework/Versions/Current/xulrunner" "${OSX_APP_FILE}/Contents/MacOS/"
+       @cd "${OSX_APP_FILE}/Contents/Frameworks/XUL.framework"; ln -sf Versions/Current/libxpcom.dylib; ln -sf Versions/Current/XUL; ln -sf Versions/Current/xulrunner-bin
+       @mkdir client
+       @mv "${OSX_APP_FILE}" client
+       @echo "Compressing and packaging"
+       @if [ -f /usr/bin/hdiutil ]; then echo "Using hdiutil to create DMG"; cd client; ln -sf "/Applications"; cd - ; fi;
+       @if [ -f /usr/bin/hdiutil ]; then hdiutil create -ov -volname "Evergreen" -format UDZO -imagekey zlib-level=9 -srcfolder client Evergreen.dmg; fi;
+       @if [ ! -f /usr/bin/hdiutil ]; then echo "hdiutil does not exist, falling back on zip"; cd client; zip -y -q -9 -r ../Evergreen-Mac.zip *; fi;
+       @echo 'Done'
+
 # For running the updates script with the correct updates directory, optionally building clients as well
 
 updates updates-client win-updates win-updates-client linux-updates linux-updates-client generic-updates generic-updates-client extension-updates:
diff --git a/Open-ILS/xul/staff_client/evergreen-icon-mac.icns b/Open-ILS/xul/staff_client/evergreen-icon-mac.icns
new file mode 100644 (file)
index 0000000..00508ff
Binary files /dev/null and b/Open-ILS/xul/staff_client/evergreen-icon-mac.icns differ