From 53a0bd89fe11176c309b6bcf7f812e3bb60b1283 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 24 Aug 2010 19:04:20 +0000 Subject: [PATCH] Staff Client Build/Update Enhancements patch from Thomas Berezansky Among other things, allows cross-compilation of Windows installers from Unix environments via NSIS, and enables Mozilla's upgrade mechanism for performing upgrades without needing to download and execute external files. See https://bugs.launchpad.net/evergreen/+bug/616452/ for more details. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17330 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Makefile.am | 3 +- Open-ILS/examples/apache/eg.conf | 23 ++ Open-ILS/src/Makefile.am | 2 +- Open-ILS/updates/Makefile.am | 25 ++ Open-ILS/updates/check | 36 ++ Open-ILS/updates/download | 11 + Open-ILS/updates/manualupdate.html | 57 +++ Open-ILS/updates/update.rdf | 8 + Open-ILS/updates/updatedetails.html | 10 + Open-ILS/xul/staff_client/Makefile.am | 176 +++++++++- .../chrome/content/auth/controller.js | 8 +- .../chrome/content/main/constants.js | 5 + .../staff_client/chrome/content/main/main.js | 39 ++- .../staff_client/chrome/content/main/main.xul | 10 +- .../defaults/preferences/autoupdate.js | 29 ++ .../xul/staff_client/external/make_updates.sh | 327 ++++++++++++++++++ Open-ILS/xul/staff_client/install.rdf | 3 +- Open-ILS/xul/staff_client/update.rdf | 27 ++ Open-ILS/xul/staff_client/windowssetup.nsi | 212 ++++++++++++ configure.ac | 27 ++ 20 files changed, 1010 insertions(+), 28 deletions(-) create mode 100644 Open-ILS/updates/Makefile.am create mode 100755 Open-ILS/updates/check create mode 100755 Open-ILS/updates/download create mode 100755 Open-ILS/updates/manualupdate.html create mode 100755 Open-ILS/updates/update.rdf create mode 100644 Open-ILS/updates/updatedetails.html create mode 100644 Open-ILS/xul/staff_client/defaults/preferences/autoupdate.js create mode 100755 Open-ILS/xul/staff_client/external/make_updates.sh create mode 100644 Open-ILS/xul/staff_client/update.rdf create mode 100644 Open-ILS/xul/staff_client/windowssetup.nsi diff --git a/Makefile.am b/Makefile.am index e669bc6441..35a79cd8f7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,7 @@ export ETCDIR=@sysconfdir@ export WEBDIR=@localstatedir@/web export CGIDIR=@localstatedir@/cgi-bin export TEMPLATEDIR=@localstatedir@/templates +export UPDATESDIR=@localstatedir@/updates export datadir=@localstatedir@/data export circrulesdir=@localstatedir@/circ @@ -38,5 +39,5 @@ export DBI_LIBS = @DBI_LIBS@ export OPENSRF_HEADERS = @OPENSRF_HEADERS@ export OPENSRF_LIBS = @OPENSRF_LIBS@ -SUBDIRS = Open-ILS/src Open-ILS/web Open-ILS/xul/staff_client +SUBDIRS = Open-ILS/src Open-ILS/web Open-ILS/updates Open-ILS/xul/staff_client diff --git a/Open-ILS/examples/apache/eg.conf b/Open-ILS/examples/apache/eg.conf index 17eb787bc7..b1de058e0f 100644 --- a/Open-ILS/examples/apache/eg.conf +++ b/Open-ILS/examples/apache/eg.conf @@ -65,6 +65,29 @@ Alias /cgi-bin/ "/openils/var/cgi-bin/" +# ---------------------------------------------------------------------------------- +# Updates folder +# ---------------------------------------------------------------------------------- +Alias /updates/ "/openils/var/updates/pub/" + + + ForceType cgi-script + + + ForceType cgi-script + + + ForceType cgi-script + + + ForceType cgi-script + + AllowOverride None + Options None + Allow from all + Options ExecCGI + + # ---------------------------------------------------------------------------------- # OPTIONAL: Set how long the client will cache our content. Change to suit diff --git a/Open-ILS/src/Makefile.am b/Open-ILS/src/Makefile.am index 690bd4f3e5..e957845f56 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -153,7 +153,7 @@ oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h # Install everything that did not get installed by autotools -install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSREP_INST) +install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSUPDATES_INST) $(OILSREP_INST) uninstall-hook: rm -R $(perldir) diff --git a/Open-ILS/updates/Makefile.am b/Open-ILS/updates/Makefile.am new file mode 100644 index 0000000000..1b9fe85b23 --- /dev/null +++ b/Open-ILS/updates/Makefile.am @@ -0,0 +1,25 @@ +#--------------------------------------------------------- +# Makefile.am for updates +## Process this file with automake to generate Makefile.in +#--------------------------------------------------------- + +if BUILDILSUPDATES +OILSUPDATES_INST = updates-install + +endif + +install-exec-local: updates-install + +uninstall-hook: + rm -R $(UPDATESDIR) + +updates-install: + $(MKDIR_P) $(DESTDIR)$(UPDATESDIR) + $(MKDIR_P) $(DESTDIR)$(UPDATESDIR)/patch + $(MKDIR_P) $(DESTDIR)$(UPDATESDIR)/pub + $(MKDIR_P) $(DESTDIR)$(UPDATESDIR)/archives + cp @top_srcdir@/Open-ILS/updates/check $(DESTDIR)$(UPDATESDIR)/pub + cp @top_srcdir@/Open-ILS/updates/download $(DESTDIR)$(UPDATESDIR)/pub + cp @top_srcdir@/Open-ILS/updates/manualupdate.html $(DESTDIR)$(UPDATESDIR)/pub + cp @top_srcdir@/Open-ILS/updates/update.rdf $(DESTDIR)$(UPDATESDIR)/pub + cp @top_srcdir@/Open-ILS/updates/updatedetails.html $(DESTDIR)$(UPDATESDIR)/pub diff --git a/Open-ILS/updates/check b/Open-ILS/updates/check new file mode 100755 index 0000000000..86038bc678 --- /dev/null +++ b/Open-ILS/updates/check @@ -0,0 +1,36 @@ +#!/bin/bash +echo "Content-Type: text/xml" +cat < + +HEAD +UPDATE_LOC=$(dirname $PWD) +PATH_INFO=${PATH_INFO#/} +CHANNEL=${PATH_INFO%%/*} +PATH_INFO=${PATH_INFO#*/} +VERSION=${PATH_INFO%%/*} +if [ ! -f "$UPDATE_LOC/patch/$CHANNEL/VERSION" ]; then + CHANNEL="" +else + CHANNEL="$CHANNEL/" +fi +if [ -f "$UPDATE_LOC/patch/${CHANNEL}VERSION" ]; then + URLBASE="http://$HTTP_HOST$(dirname $SCRIPT_NAME)/${CHANNEL}" + CURVERSION=$(cat $UPDATE_LOC/patch/${CHANNEL}VERSION) + [ -f "$UPDATE_LOC/patch/${CHANNEL}DETAILS" ] && DETAILSURL=$(cat $UPDATE_LOC/${CHANNEL}DETAILS) + [ -n "$DETAILSURL" ] && DETAILSURL=" detailsURL=\"$DETAILSURL\"" + if [ -n "$CURVERSION" -a "$VERSION" != "$CURVERSION" ]; then + if [ -f "$UPDATE_LOC/pub/${CHANNEL}$CURVERSION.mar" -a -f "$UPDATE_LOC/patch/${CHANNEL}$CURVERSION.patchline" ]; then + echo "" + sed -e "s|URL=\"|URL=\"$URLBASE|" "$UPDATE_LOC/patch/${CHANNEL}$CURVERSION.patchline" + if [ -f "$UPDATE_LOC/pub/${CHANNEL}$VERSION-$CURVERSION.mar" -a -f "$UPDATE_LOC/patch/${CHANNEL}$VERSION-$CURVERSION.patchline" ]; then + sed -e "s|URL=\"|URL=\"$URLBASE|" "$UPDATE_LOC/patch/${CHANNEL}$VERSION-$CURVERSION.patchline" + fi + echo "" + fi + fi +fi +cat <