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