]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/Makefile.am
Make developer-oriented preferences for the staff client optional, since some of...
[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
8 # from http://closure-compiler.googlecode.com/files/compiler-latest.zip  FIXME: Autotools this?
9 export CLOSURE_COMPILER_JAR = ~/closure-compiler/compiler.jar
10
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/")
14
15 #------------------------------
16 # Build ILS XUL CLIENT/SERVER
17 #------------------------------
18
19 if BUILDILSCLIENT
20 OILSSERVER_INST = server-xul
21 endif
22
23 install-exec-local: $(OILSSERVER_INST)
24
25 devbuild: build
26         @cp external/developers.js build/defaults/preferences/
27
28 build: build_dir chrome2remote localize_manifest generated custom_skins open-ils stamp 
29         @echo To test the staff client:
30         @echo "  cd build/"
31         @echo "  xulrunner application.ini"
32
33 build_dir:
34         @echo ' * Creating and populating build/ '
35         @mkdir -p build/
36         @cp -fR chrome build/
37         @cp -fR server 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/
48
49 # Convert chrome to remote for server localization
50 chrome2remote:
51         @for loc in $(CHROME_LOCALES); do \
52                 cp -fr chrome/locale/$$loc build/server/locale/. ; \
53         done;
54
55 # Update the manifest for our installed locales
56 localize_manifest:
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; \
59         done;
60
61 stamp:
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
73
74 bell:
75         @perl -e 'print "Ringing bell..." . chr(7) . "\n";'
76
77 bundle:
78         @rm -f build/build.tar
79         @tar cf build.tar build/
80         @mv build.tar build/
81
82 generated:
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/
85
86 open-ils:
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/
91
92 custom_skins:
93         @for skin in $(SKIN_CSS); do \
94                 if [ ! -f "$$skin" ]; then ( touch build/"$$skin" ); fi \
95         done;
96
97 server-xul: build
98         @echo $@
99         mkdir -p $(WEBDIR)
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}/"
105
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/`
115