tweak so that this Makefile can be called from parent Makefile
[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 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: evergreen.xpi
11         @echo
12         @echo How do makefiles work again?
13         @echo BUILD = ${BUILD}
14         touch application.ini
15
16 stamp: 
17         sed -i s/^Version=.\*/Version=${VERSION}/ application.ini 
18         sed -i s/^BuildID=.\*/BuildID=${BUILD}/ application.ini
19         sed -i s/^Name=.\*/Name=${PACKAGE}/ application.ini 
20         sed -i 's/<em:version>.*<\/em:version>/<em:version>${VERSION}<\/em:version>/' install.rdf 
21         sed -i 's/<em:name>.*<\/em:name>/<em:name>${PACKAGE}<\/em:name>/' install.rdf 
22         sed -i 's/<em:description>.*<\/em:description>/<em:description>${DESCRIPTION}<\/em:description>/' install.rdf 
23         sed -i "s/extVersion: '.\*'/extVersion: '${VERSION}'/" install.js 
24         sed -i "s/extFullName: '.\*'/extFullName: '${DESCRIPTION}'/" install.js 
25         sed -i 's/auth\.title ".*"/auth\.title "${DESCRIPTION}"/' chrome/locale/en-US/evergreen/auth.dtd 
26         sed -i 's/auth\.version ".*"/auth\.version "${PACKAGE} ${VERSION} ${BUILD}"/' chrome/locale/en-US/evergreen/auth.dtd 
27
28 generated:
29         @echo
30         @echo These things are installation specific.  The staff client is the last thing you should try to build.
31         (cd chrome/content/evergreen/util ; ${RETRIEVE_FIELDMAPPER} );
32         (cd chrome/content/evergreen/util ; ${RETRIEVE_ORG_TREE} );
33         (cd chrome/content/evergreen/conf ; ${RETRIEVE_CLIENT_CONFIG} );
34
35 open-ils:
36         cp ../../OpenSRF/src/javascript/*.js chrome/content/evergreen/OpenSRF/
37         cp ../../Open-ILS/src/javascript/util/*.js chrome/content/evergreen/Open-ILS/util/
38         cp ../../Open-ILS/src/javascript/widgets/*.js chrome/content/evergreen/Open-ILS/widgets/
39         cp ../../Open-ILS/src/javascript/widgets/menu/*.js chrome/content/evergreen/Open-ILS/widgets/menu/
40
41 patron:
42         (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 )
43         (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 )
44         (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 )
45         (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 )
46         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_items.dtd)
47         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_search_results.dtd)
48         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_checkout_items.dtd)
49         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/patron_holds.dtd)
50
51 circ:
52         (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 )
53         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/checkin_items.dtd)
54         (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 )
55         (cp chrome/locale/en-US/evergreen/paged_tree.dtd chrome/locale/en-US/evergreen/hold_capture_items.dtd)
56
57 evergreen.xpi: evergreen.jar
58         @echo
59         @echo make the xpi file
60         zip -r evergreen.xpi chrome/ defaults/ install.js install.rdf application.ini Makefile LICENSE README -x \*CVS\* > /dev/null
61
62 evergreen.jar: generated open-ils patron circ
63         @echo
64         @echo make the jar file
65         (cd chrome; zip -r evergreen.jar content/ locale/ skin/ -x \*CVS\* > /dev/null )
66
67 clean:
68         @echo
69         @echo delete derived files
70         rm -f evergreen.xpi
71         rm -f chrome/evergreen.jar
72         rm -f chrome/content/evergreen/patron/patron_items_overlay.xul chrome/locale/en-US/evergreen/patron_items.dtd
73         rm -f chrome/content/evergreen/patron/patron_search_results_overlay.xul chrome/locale/en-US/evergreen/patron_search_results.dtd
74         rm -f chrome/content/evergreen/patron/patron_checkout_items_overlay.xul chrome/locale/en-US/evergreen/patron_checkout_items.dtd
75         rm -f chrome/content/evergreen/patron/patron_holds_overlay.xul chrome/locale/en-US/evergreen/patron_holds.dtd
76         rm -f chrome/content/evergreen/circ/checkin_items_overlay.xul chrome/locale/en-US/evergreen/checkin_items.dtd
77         rm -f chrome/content/evergreen/circ/hold_capture_items_overlay.xul chrome/locale/en-US/evergreen/hold_capture_items.dtd
78         rm -f chrome/content/evergreen/conf/client_config.xml
79         rm -f chrome/content/evergreen/util/fieldmapper.js
80         rm -f chrome/content/evergreen/util/OrgTree.js
81         rm -f chrome/content/evergreen/OpenSRF/*js
82         rm -f chrome/content/evergreen/Open-ILS/util/*js
83         rm -f chrome/content/evergreen/Open-ILS/widgets/*js
84         rm -f chrome/content/evergreen/Open-ILS/widgets/menu/*js