Merge branch 'master' of git.evergreen-ils.org:Evergreen into social
[evergreen-equinox.git] / Open-ILS / xul / staff_client / Makefile.am
index 396de5a..d210ef2 100644 (file)
@@ -9,7 +9,7 @@ export STAFF_CLIENT_STAMP_ID = $$(/bin/cat build/STAMP_ID)
 
 # from http://closure-compiler.googlecode.com/files/compiler-latest.zip  FIXME: Autotools this?
 export CLOSURE_COMPILER_JAR = ~/closure-compiler/compiler.jar
-XULRUNNER_VERSION=1.9.2.16
+XULRUNNER_VERSION=1.9.2.17
 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/
@@ -19,13 +19,15 @@ CHROME_LOCALES = $$(ls -1 chrome/locale)
 SKIN_CSS = $$(ls -1 server/skin/*css | sed -e "s/.css/_custom.css/")
 UPDATESDIR=@localstatedir@/updates
 
-SVN=svn # Because some people might need to override this to 'git svn' or something
+GIT_BRANCH=$$(git rev-parse --abbrev-ref HEAD || echo master)
+GIT_TAG=$$(git rev-parse --short HEAD) # For auto-tagging builds
 
 export NSIS_EXTRAOPTS
 export NSIS_WICON=$$(if [ -f client/evergreen.ico ]; then echo '-DWICON'; fi)
 export NSIS_AUTOUPDATE=$$([ -f client/defaults/preferences/autoupdate.js ] && echo '-DAUTOUPDATE')
 export NSIS_DEV=$$([ -f client/defaults/preferences/developers.js ] && echo '-DDEVELOPER')
 export NSIS_PERMACHINE=$$([ -f client/defaults/preferences/aa_per_machine.js ] && echo '-DPERMACHINE')
+export NSIS_EXTRAS=$$([ -f extras.nsi ] && echo '-DEXTRAS')
 # Url taken from http://nsis.sourceforge.net/AccessControl_plug-in
 NSIS_ACCESSCONTROL=http://nsis.sourceforge.net/mediawiki/images/4/4a/AccessControl.zip
 
@@ -112,18 +114,18 @@ localize_manifest:
 
 # The default "automatic" BUILD ID is acceptable.
 
-# The version from the README usually conforms to that documentation, unless it is trunk.
-# If we are in trunk, we probably have svn kicking around, ask it for the revision and build an appropriate version string.
+# The version from the README usually conforms to that documentation, unless it is master.
+# If we are in master, we probably have git kicking around, ask it for the revision and build an appropriate version string.
 
 # Neither really applies to the STAMP, though.
 # The method below gives the same format STAMPS as previous instructions provided. If README has version 1.2.3.4 then STAMP_ID will become rel_1_2_3_4.
-# Trunk VERSION will end up with 0trunk.release, trunk STAMP ID will be 0trunk_release.
+# Master VERSION will end up with 0branch.release, master STAMP ID will be 0branch_release.
 stamp:
        @/bin/date +"%Y%m%d.%H%M%S" > build/BUILD_ID
        @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "Stamping with Build ID: ${STAFF_CLIENT_BUILD_ID}" ; echo ${STAFF_CLIENT_BUILD_ID} > build/BUILD_ID ) ; fi
        @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
        @sed -n -e '1 s/^.* \([^ ]*\)$$/\1/p' @top_srcdir@/README > build/VERSION
-       @if [ "${STAFF_CLIENT_VERSION}" == "trunk" ]; then echo "0trunk.$$(${SVN} info | sed -n -e 's/Last Changed Rev: \([0-9][0-9]*\)/\1/p')" > build/VERSION; fi 
+       @if [ "${STAFF_CLIENT_VERSION}" == "master" ]; then echo "0${GIT_BRANCH}.${GIT_TAG}" > build/VERSION; fi 
        @if [ -n "${STAFF_CLIENT_VERSION}" ]; then ( echo "Stamping with Version: ${STAFF_CLIENT_VERSION}" ; echo ${STAFF_CLIENT_VERSION} > build/VERSION ) ; fi
        @if [ -z "${STAFF_CLIENT_VERSION}" ]; then ( echo "No Version" ; echo "none" > build/VERSION ) ; fi
        @sed -e 's/\./_/g' -e 's/^\([0-9_]*\)$$/rel_&/' build/VERSION > build/STAMP_ID
@@ -253,9 +255,23 @@ generic-client: client_app
 # https://developer.mozilla.org/en/XULRunner/Deploying_XULRunner_1.8
 # for their respective platforms in regards to XULRunner deployment
 
+nsis_check:
+       @echo 'Checking for makensis'
+       @type -P makensis > /dev/null || ( echo 'MAKENSIS NOT FOUND: Cannot continue. Do you need to install the NSIS package?' && exit 1 )
+
+unzip_check:
+       @echo 'Checking for unzip'
+       @type -P unzip > /dev/null || ( echo 'UNZIP NOT FOUND: Cannot continue.' && exit 1 )
+
+branding_check:
+       @echo 'Checking for branding'
+       @[ -f xulrunner-stub.exe ] || echo 'xulrunner-stub.exe not found'
+       @[ -f build/evergreen.ico ] || echo 'build/evergreen.ico not found'
+       @if [ ! -f xulrunner-stub.exe -o ! -f build/evergreen.ico ]; then echo 'Branding incomplete. Did you forget to run "make rigbeta" or "make rigrelease"?'; echo 'You will need to "make rebuild" afterwards.'; exit 1; fi
+
 # Note that I decided to use win/lin channels for ease of coding platform specific updates
 
-win-xulrunner: client_app
+win-xulrunner: unzip_check branding_check client_app
        @echo 'Preparing Windows xulrunner'
        @if [ ! -f ${XULRUNNER_WINFILE} ]; then wget ${XULRUNNER_URL}${XULRUNNER_WINFILE}; fi
        @unzip -q ${XULRUNNER_WINFILE} -dclient
@@ -273,10 +289,10 @@ linux-xulrunner: client_app
 
 # Build a windows installer.
 
-win-client: win-xulrunner
+win-client: nsis_check win-xulrunner
        @if [ "${NSIS_AUTOUPDATE}${NSIS_PERMACHINE}" -a ! -d AccessControl ]; then echo 'Fetching AccessControl Plugin'; wget ${NSIS_ACCESSCONTROL} -O AccessControl.zip; unzip AccessControl.zip; fi
        @echo 'Building installer'
-       @makensis -V2 -DPRODUCT_VERSION="${STAFF_CLIENT_VERSION}" ${NSIS_WICON} ${NSIS_AUTOUPDATE} ${NSIS_DEV} ${NSIS_PERMACHINE} ${NSIS_EXTRAOPTS} windowssetup.nsi
+       @makensis -V2 -DPRODUCT_VERSION="${STAFF_CLIENT_VERSION}" ${NSIS_WICON} ${NSIS_AUTOUPDATE} ${NSIS_DEV} ${NSIS_PERMACHINE} ${NSIS_EXTRAS} ${NSIS_EXTRAOPTS} windowssetup.nsi
        @echo 'Done'
 
 # For linux, just build a tar.bz2 archive