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