otherwise this bad boy keeps growing and growing
[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 bundle
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/simple_auth.xul build/server/main/simple_auth.xul
30         @cp build/chrome/content/main/bindings.xml build/server/main/bindings.xml
31         @cp build/chrome/content/OpenILS/data.js build/server/OpenILS/data.js
32         @cp build/chrome/content/OpenILS/global_util.js build/server/OpenILS/global_util.js
33         @external/prune_dirs.sh build/
34
35 # Convert chrome to remote for server localization
36 chrome2remote:
37         @sed -i 's/chrome:\/\/open_ils_staff_client\/locale\//\/xul\/server\/locale\/<\!--#echo var=locale-->\//' build/server/main/simple_auth.xul
38         @for loc in $(CHROME_LOCALES); do \
39                 cp -fr chrome/locale/$$loc build/server/locale/. ; \
40         done;
41
42 # Update the manifest for our installed locales
43 localize_manifest:
44         @for loc in $(CHROME_LOCALES) ; do \
45                 if [ "$$loc" != "en-US" ]; then ( echo "locale open_ils_staff_client $$loc locale/$$loc/" >> build/chrome/chrome.manifest ) ; fi; \
46         done;
47
48 stamp:
49         @/bin/date +"%Y%m%d.%H%M%S" > build/BUILD_ID
50         @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
51         @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
52         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^Version=.\*/Version=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
53         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^BuildID=.\*/BuildID=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
54         @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
55         @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
56         @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
57         @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
58         @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
59         @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
60
61 bundle:
62         @rm -f build/build.tar
63         @tar cf build.tar build/
64         @mv build.tar build/
65
66 generated:
67         @echo ' * Grabbing lang.dtd from the OPAC code '
68         @cp @top_srcdir@/Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/
69
70 open-ils:
71         @echo ' * Grabbing more OPAC code and legacy code and custom code'
72         @cp @top_srcdir@/Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
73         @cp $(OPENSRF_JSLIBS)/*.js build/chrome/content/OpenILS/util/
74         @external/prune_dirs.sh build/
75
76 custom_skins:
77         @for skin in $(SKIN_CSS); do \
78                 if [ ! -f "$$skin" ]; then ( touch build/"$$skin" ); fi \
79         done;