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