30cdc27c63bf5e02564a7a9141f6e7afe35308bd
[Evergreen.git] / Evergreen / staff_client / Makefile
1 VERSION=0.0.9
2 PACKAGE=Evergreen
3 DESCRIPTION=Evergreen Staff Client almost-almost-Alpha
4 BUILD=2005072617
5
6 ILS_DIR=${PWD}/../..
7
8 RETRIEVE_FIELDMAPPER=wget -N http://gapines.org/js/util/fieldmapper.js
9 RETRIEVE_ORG_TREE=wget -N http://gapines.org/js/util/OrgTree.js
10 RETRIEVE_CLIENT_CONFIG=cp ${ILS_DIR}/OpenSRF/examples/math_xul_client/math/content/conf/client_config.xml .
11
12 all: evergreen.xpi
13         @echo
14         @echo How do makefiles work again?
15         @echo BUILD = ${BUILD}
16         touch application.ini
17
18 stamp: 
19         sed -i s/^Version=.\*/Version=${VERSION}/ application.ini 
20         sed -i s/^BuildID=.\*/BuildID=${BUILD}/ application.ini
21         sed -i s/^Name=.\*/Name=${PACKAGE}/ application.ini 
22         sed -i 's/<em:version>.*<\/em:version>/<em:version>${VERSION}<\/em:version>/' install.rdf 
23         sed -i 's/<em:name>.*<\/em:name>/<em:name>${PACKAGE}<\/em:name>/' install.rdf 
24         sed -i 's/<em:description>.*<\/em:description>/<em:description>${DESCRIPTION}<\/em:description>/' install.rdf 
25         sed -i "s/extVersion: '.\*'/extVersion: '${VERSION}'/" install.js 
26         sed -i "s/extFullName: '.\*'/extFullName: '${DESCRIPTION}'/" install.js 
27         sed -i 's/auth\.title ".*"/auth\.title "${DESCRIPTION}"/' chrome/locale/en-US/evergreen/auth.dtd 
28         sed -i 's/auth\.version ".*"/auth\.version "${PACKAGE} ${VERSION} ${BUILD}"/' chrome/locale/en-US/evergreen/auth.dtd 
29
30 generated:
31         @echo
32         @echo These things are installation specific.  The staff client is the last thing you should try to build.
33         (cd chrome/content/evergreen/util ; ${RETRIEVE_FIELDMAPPER} );
34         (cd chrome/content/evergreen/util ; ${RETRIEVE_ORG_TREE} );
35         (cd chrome/content/evergreen/conf ; ${RETRIEVE_CLIENT_CONFIG} );
36
37 open-ils:
38         cp ../../OpenSRF/src/javascript/*.js chrome/content/evergreen/OpenSRF/
39         cp ../../Open-ILS/src/javascript/util/*.js chrome/content/evergreen/Open-ILS/util/
40         cp ../../Open-ILS/src/javascript/widgets/*.js chrome/content/evergreen/Open-ILS/widgets/
41         cp ../../Open-ILS/src/javascript/widgets/menu/*.js chrome/content/evergreen/Open-ILS/widgets/menu/
42
43 patron:
44         (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_items/g | sed s/PagedTree/PatronItems/g > chrome/content/evergreen/patron/patron_items_overlay.xul )
45         (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_search_results/g | sed s/PagedTree/PatronSearchResults/g > chrome/content/evergreen/patron/patron_search_results_overlay.xul )
46         (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_checkout_items/g | sed s/PagedTree/PatronCheckoutItems/g > chrome/content/evergreen/patron/patron_checkout_items_overlay.xul )
47         (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_holds/g | sed s/PagedTree/PatronHolds/g > chrome/content/evergreen/patron/patron_holds_overlay.xul )
48         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_items.dtd)
49         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_search_results.dtd)
50         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_checkout_items.dtd)
51         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_holds.dtd)
52
53 circ:
54         (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/checkin_items/g | sed s/PagedTree/CheckinItems/g > chrome/content/evergreen/circ/checkin_items_overlay.xul )
55         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/checkin_items.dtd)
56         (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/hold_capture_items/g | sed s/PagedTree/HoldCaptureItems/g > chrome/content/evergreen/circ/hold_capture_items_overlay.xul )
57         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/hold_capture_items.dtd)
58
59 evergreen.xpi: evergreen.jar
60         @echo
61         @echo make the xpi file
62         zip -r evergreen.xpi chrome/ defaults/ install.js install.rdf application.ini Makefile LICENSE README -x \*CVS\* > /dev/null
63
64 evergreen.jar: generated open-ils patron circ
65         @echo
66         @echo make the jar file
67         (cd chrome; zip -r evergreen.jar content/ locale/ skin/ -x \*CVS\* > /dev/null )
68
69 clean:
70         @echo
71         @echo delete derived files
72         rm -f evergreen.xpi
73         rm -f chrome/evergreen.jar
74         rm -f chrome/content/evergreen/patron/patron_items_overlay.xul chrome/locale/en-US/evergreen/patron_items.dtd
75         rm -f chrome/content/evergreen/patron/patron_search_results_overlay.xul chrome/locale/en-US/evergreen/patron_search_results.dtd
76         rm -f chrome/content/evergreen/patron/patron_checkout_items_overlay.xul chrome/locale/en-US/evergreen/patron_checkout_items.dtd
77         rm -f chrome/content/evergreen/patron/patron_holds_overlay.xul chrome/locale/en-US/evergreen/patron_holds.dtd
78         rm -f chrome/content/evergreen/circ/checkin_items_overlay.xul chrome/locale/en-US/evergreen/checkin_items.dtd
79         rm -f chrome/content/evergreen/circ/hold_capture_items_overlay.xul chrome/locale/en-US/evergreen/hold_capture_items.dtd
80         rm -f chrome/content/evergreen/conf/client_config.xml
81         rm -f chrome/content/evergreen/util/fieldmapper.js
82         rm -f chrome/content/evergreen/util/OrgTree.js
83         rm -f chrome/content/evergreen/OpenSRF/*js
84         rm -f chrome/content/evergreen/Open-ILS/util/*js
85         rm -f chrome/content/evergreen/Open-ILS/widgets/*js
86         rm -f chrome/content/evergreen/Open-ILS/widgets/menu/*js