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)
26 @cp external/developers.js build/defaults/preferences/
28 build: build_dir chrome2remote localize_manifest generated custom_skins open-ils stamp
29 @echo To test the staff client:
31 @echo " xulrunner application.ini"
34 @echo ' * Creating and populating build/ '
38 @cp -fR defaults build/
39 @cp -fR components build/
40 @cp application.ini build/
41 @cp -fR build/chrome/content/util/ build/server/
42 @cp -fR build/chrome/content/auth/ build/server/
43 @cp build/chrome/content/main/constants.js build/server/main/constants.js
44 @cp build/chrome/content/main/bindings.xml build/server/main/bindings.xml
45 @cp build/chrome/content/OpenILS/data.js build/server/OpenILS/data.js
46 @cp build/chrome/content/OpenILS/global_util.js build/server/OpenILS/global_util.js
47 @external/prune_dirs.sh build/
49 # Convert chrome to remote for server localization
51 @for loc in $(CHROME_LOCALES); do \
52 cp -fr chrome/locale/$$loc build/server/locale/. ; \
55 # Update the manifest for our installed locales
57 @for loc in $(CHROME_LOCALES) ; do \
58 if [ "$$loc" != "en-US" ]; then ( echo "locale open_ils_staff_client $$loc locale/$$loc/" >> build/chrome/chrome.manifest ) ; fi; \
62 @/bin/date +"%Y%m%d.%H%M%S" > build/BUILD_ID
63 @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
64 @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
65 @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^Version=.\*/Version=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
66 @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^BuildID=.\*/BuildID=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
67 @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
68 @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
69 @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
70 @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
71 @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
72 @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
75 @perl -e 'print "Ringing bell..." . chr(7) . "\n";'
78 @rm -f build/build.tar
79 @tar cf build.tar build/
83 @echo ' * Grabbing lang.dtd from the OPAC code '
84 @cp @top_srcdir@/Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/
87 @echo ' * Grabbing more OPAC code and legacy code and custom code'
88 @cp @top_srcdir@/Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
89 @cp $(OPENSRF_JSLIBS)/*.js build/chrome/content/OpenILS/util/
90 @external/prune_dirs.sh build/
93 @for skin in $(SKIN_CSS); do \
94 if [ ! -f "$$skin" ]; then ( touch build/"$$skin" ); fi \
100 mkdir -p $(WEBDIR)/xul/
101 @echo "BUILD_ID = $(STAFF_CLIENT_BUILD_ID)"
102 @echo "Copying xul into $(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)"
103 mkdir -p "$(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)"
104 cp -R @top_srcdir@/Open-ILS/xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
106 compress-javascript: build
107 @echo "Size of build/ before compression = " `du -sh build/`
108 @echo " * Running Google's Closure Compiler against javascript. Errors in build/compression.err"
109 @external/closure_compiler.sh $(CLOSURE_COMPILER_JAR) 2>> build/compression.err
110 @echo `find build/ -name '*.js~' -size 0 -print | wc -l` compression failures
111 @find build/ -name '*.js~' -size 0 -exec rm {} \; # remove the output files for those that did not compile
112 @echo `find build/ -name '*.js~' -print | wc -l` compression successes
113 @find build/ -name '*.js~' -exec perl -e '$$a = "{}"; chop $$a; `mv $$a~ $$a`;' \;
114 @echo "Size of build/ (minus compression.err) after compression = " `du -sh --exclude compression.err build/`