1 #---------------------------------------------------------
2 # Makefile.am for xul/staff_client
3 ## Process this file with automake to generate Makefile.in
4 #---------------------------------------------------------
6 export STAFF_CLIENT_BUILD_ID = $$(/bin/cat build/BUILD_ID)
8 # from http://closure-compiler.googlecode.com/files/compiler-latest.zip FIXME: Autotools this?
9 export CLOSURE_COMPILER_JAR = ~/closure-compiler/compiler.jar
11 OPENSRF_JSLIBS = "$(OPENSRF_LIBS)/javascript"
12 CHROME_LOCALES = $$(ls -1 chrome/locale)
13 SKIN_CSS = $$(ls -1 server/skin/*css | sed -e "s/.css/_custom.css/")
15 #------------------------------
16 # Build ILS XUL CLIENT/SERVER
17 #------------------------------
20 OILSSERVER_INST = server-xul
23 install-exec-local: $(OILSSERVER_INST)
25 build: build_dir chrome2remote localize_manifest generated custom_skins open-ils stamp
26 @echo To test the staff client:
28 @echo " xulrunner application.ini"
31 @echo ' * Creating and populating build/ '
35 @cp -fR defaults build/
36 @cp -fR components build/
37 @cp application.ini build/
38 @cp -fR build/chrome/content/util/ build/server/
39 @cp -fR build/chrome/content/auth/ build/server/
40 @cp build/chrome/content/main/constants.js build/server/main/constants.js
41 @cp build/chrome/content/main/bindings.xml build/server/main/bindings.xml
42 @cp build/chrome/content/OpenILS/data.js build/server/OpenILS/data.js
43 @cp build/chrome/content/OpenILS/global_util.js build/server/OpenILS/global_util.js
44 @external/prune_dirs.sh build/
46 # Convert chrome to remote for server localization
48 @for loc in $(CHROME_LOCALES); do \
49 cp -fr chrome/locale/$$loc build/server/locale/. ; \
52 # Update the manifest for our installed locales
54 @for loc in $(CHROME_LOCALES) ; do \
55 if [ "$$loc" != "en-US" ]; then ( echo "locale open_ils_staff_client $$loc locale/$$loc/" >> build/chrome/chrome.manifest ) ; fi; \
59 @/bin/date +"%Y%m%d.%H%M%S" > build/BUILD_ID
60 @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
61 @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
62 @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^Version=.\*/Version=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
63 @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^BuildID=.\*/BuildID=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
64 @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
65 @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
66 @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
67 @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
68 @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
69 @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
72 @perl -e 'print "Ringing bell..." . chr(7) . "\n";'
75 @rm -f build/build.tar
76 @tar cf build.tar build/
80 @echo ' * Grabbing lang.dtd from the OPAC code '
81 @cp @top_srcdir@/Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/
84 @echo ' * Grabbing more OPAC code and legacy code and custom code'
85 @cp @top_srcdir@/Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
86 @cp $(OPENSRF_JSLIBS)/*.js build/chrome/content/OpenILS/util/
87 @external/prune_dirs.sh build/
90 @for skin in $(SKIN_CSS); do \
91 if [ ! -f "$$skin" ]; then ( touch build/"$$skin" ); fi \
97 mkdir -p $(WEBDIR)/xul/
98 @echo "BUILD_ID = $(STAFF_CLIENT_BUILD_ID)"
99 @echo "Copying xul into $(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)"
100 mkdir -p "$(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)"
101 cp -R @top_srcdir@/Open-ILS/xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
103 compress-javascript: build
104 @echo "Size of build/ before compression = " `du -sh build/`
105 @echo " * Running Google's Closure Compiler against javascript. Errors in build/compression.err"
106 @external/closure_compiler.sh $(CLOSURE_COMPILER_JAR) 2>> build/compression.err
107 @echo `find build/ -name '*.js~' -size 0 -print | wc -l` compression failures
108 @find build/ -name '*.js~' -size 0 -exec rm {} \; # remove the output files for those that did not compile
109 @echo `find build/ -name '*.js~' -print | wc -l` compression successes
110 @find build/ -name '*.js~' -exec perl -e '$$a = "{}"; chop $$a; `mv $$a~ $$a`;' \;
111 @echo "Size of build/ (minus compression.err) after compression = " `du -sh --exclude compression.err build/`