Some hamfisted attempts to fix the current unhappy network.js i18n;
[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 server/locale)
9
10 install-exec-local: build
11
12 build: build_dir chrome2remote generated open-ils stamp
13         @echo To test the staff client:
14         @echo "  cd build/"
15         @echo "  xulrunner application.ini"
16
17 build_dir:
18         @echo ' * Creating and populating build/ '
19         mkdir -p build/
20         cp -R chrome build/
21         cp -R server build/
22         cp -R defaults build/
23         cp -R components build/
24         cp application.ini build/
25         cp -R build/chrome/content/util/ build/server/
26         cp -R build/chrome/content/auth/ build/server/
27         cp build/chrome/content/main/constants.js build/server/main/constants.js
28         cp build/chrome/content/main/simple_auth.xul build/server/main/simple_auth.xul
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         sed -i 's/chrome:\/\/open_ils_staff_client\/locale\//\/xul\/server\/locale\/<\!--#echo var=locale-->\//' build/server/auth/verify_credentials.xul
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 -r chrome/locale/$$loc build/server/locale/. ; \
40         done;
41
42 stamp:
43         @/bin/date +"%Y%m%d.%H%M%S" > build/BUILD_ID
44         @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
45         @if [ -z "${STAFF_CLIENT_BUILD_ID}" ]; then ( echo "No Build ID for versioning" ; echo "none" > build/BUILD_ID ) ; fi
46         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^Version=.\*/Version=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
47         @if [ -n "${STAFF_CLIENT_BUILD_ID}" ]; then sed -i s/^BuildID=.\*/BuildID=${STAFF_CLIENT_BUILD_ID}/ build/application.ini ; fi
48         @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
49         @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
50         @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
51         @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
52         @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
53         @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
54
55 generated:
56         @echo ' * Grabbing lang.dtd from the OPAC code '
57         cp @top_srcdir@/Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/
58
59 open-ils:
60         @echo ' * Grabbing more OPAC code and legacy code and custom code'
61         cp @top_srcdir@/Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
62         cp $(OPENSRF_JSLIBS)/*.js build/chrome/content/OpenILS/util/
63         external/prune_dirs.sh build/
64
65