simple auth was buggy; due to chrome/remote restrictions in xulrunner 1.9? made separ...
[Evergreen.git] / Open-ILS / xul / staff_client / Makefile.am
1 #---------------------------------------------------------
2 # Makefile.am for xul/staff_client
3 ## Process this file with automake to generate Makefile.in
4 #---------------------------------------------------------
5
6 export STAFF_CLIENT_BUILD_ID = $$(/bin/cat build/BUILD_ID)
7 OPENSRF_JSLIBS = "$(OPENSRF_LIBS)/javascript"
8 CHROME_LOCALES = $$(ls -1 chrome/locale)
9 SKIN_CSS = $$(ls -1 server/skin/*css | sed -e "s/.css/_custom.css/")
10
11 install-exec-local: build
12
13 build: build_dir chrome2remote localize_manifest generated custom_skins open-ils stamp 
14         @echo To test the staff client:
15         @echo "  cd build/"
16         @echo "  xulrunner application.ini"
17
18 build_dir:
19         @echo ' * Creating and populating build/ '
20         @mkdir -p build/
21         @cp -fR chrome build/
22         @cp -fR server build/
23         @cp -fR defaults build/
24         @cp -fR components build/
25         @cp application.ini build/
26         @cp -fR build/chrome/content/util/ build/server/
27         @cp -fR build/chrome/content/auth/ build/server/
28         @cp build/chrome/content/main/constants.js build/server/main/constants.js
29         @cp build/chrome/content/main/bindings.xml build/server/main/bindings.xml
30         @cp build/chrome/content/OpenILS/data.js build/server/OpenILS/data.js
31         @cp build/chrome/content/OpenILS/global_util.js build/server/OpenILS/global_util.js
32         @external/prune_dirs.sh build/
33
34 # Convert chrome to remote for server localization
35 chrome2remote:
36         @for loc in $(CHROME_LOCALES); do \
37                 cp -fr chrome/locale/$$loc build/server/locale/. ; \
38         done;
39
40 # Update the manifest for our installed locales
41 localize_manifest:
42         @for loc in $(CHROME_LOCALES) ; do \
43                 if [ "$$loc" != "en-US" ]; then ( echo "locale open_ils_staff_client $$loc locale/$$loc/" >> build/chrome/chrome.manifest ) ; fi; \
44         done;
45
46 stamp:
47         @/bin/date +"%Y%m%d.%H%M%S" > build/BUILD_ID
48         @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
49         @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
50         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^Version=.\*/Version=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
51         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^BuildID=.\*/BuildID=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
52         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.css' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
53         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.xul' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
54         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.html' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
55         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.xhtml' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
56         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.js' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
57         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then find build/ -name '*.xml' -exec sed -i s/xul\\\/server/xul\\\/${STAFF_CLIENT_BUILD_ID}\\\/server/g {} \; ; fi
58
59 bundle:
60         @rm -f build/build.tar
61         @tar cf build.tar build/
62         @mv build.tar build/
63
64 generated:
65         @echo ' * Grabbing lang.dtd from the OPAC code '
66         @cp @top_srcdir@/Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/
67
68 open-ils:
69         @echo ' * Grabbing more OPAC code and legacy code and custom code'
70         @cp @top_srcdir@/Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
71         @cp $(OPENSRF_JSLIBS)/*.js build/chrome/content/OpenILS/util/
72         @external/prune_dirs.sh build/
73
74 custom_skins:
75         @for skin in $(SKIN_CSS); do \
76                 if [ ! -f "$$skin" ]; then ( touch build/"$$skin" ); fi \
77         done;