merging admin interface from the dojo-admin branch
[Evergreen.git] / Open-ILS / src / Makefile
1 # vim:noet:ts=4
2
3 export LDFLAGS                  += -L . -L$(TMP) -L $(OPENSRF_LIBS)
4 export CFLAGS                   += -pipe -g -Wall -O2 -fPIC -I../../include -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) \
5                                 -D_LARGEFILE64_SOURCE -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(OPENSRF_HEADERS)
6
7 export INCDIR = "$(INCLUDEDIR)/openils/"
8
9 export STAFF_CLIENT_BUILD_ID = `/bin/cat ../xul/staff_client/build/BUILD_ID`
10
11 all:  c_apps client-xul mod_xmlent python-build
12
13 install:        perl-install python-install web-install server-xul string-templates-install xsl-install c_apps-install circ_rules-install offline-install storage-bootstrap cgi-bootstrap
14
15 web-install:    webcore-install autojs-install mod_xmlent-install offline-install reporter-install
16
17 circ_rules-install:
18         @echo $@
19         mkdir -p $(CIRCRULESDIR)
20         mkdir -p $(PENALTYRULESDIR)
21         mkdir -p $(CATALOGSCRIPTDIR)
22         cp javascript/backend/circ/*.js $(CIRCRULESDIR)
23         cp javascript/backend/penalty/*.js $(PENALTYRULESDIR)
24         cp javascript/backend/catalog/*.js $(CATALOGSCRIPTDIR)
25         cp support-scripts/fine_generator.pl $(BINDIR) 
26         cp support-scripts/hold_targeter.pl $(BINDIR) 
27         cp support-scripts/reshelving_complete.srfsh $(BINDIR) 
28         cp support-scripts/thaw_expired_frozen_holds.srfsh $(BINDIR) 
29         cp support-scripts/long-overdue-status-update.pl $(BINDIR) 
30
31
32 # -----------------------------------------------------------------------------------
33 # Web stuff
34 # -----------------------------------------------------------------------------------
35 mod_xmlent:
36         @echo $@
37         make -C apachemods mod_xmlent.so
38
39 oils_cgi:
40         @echo $@
41         make -C apachemods oils_cgi.so
42
43 oils_cgi-install:
44         @echo $@
45         make -C apachemods oils_cgi-install
46
47 mod_xmlent-install:
48         @echo $@
49         make -C apachemods mod_xmlent-install
50
51 client-xul:
52         @echo $@
53         @echo "Building staff client"
54         make -C ../xul/staff_client 
55
56 server-xul:
57         @echo $@
58         mkdir -p ${WEBDIR}
59         @echo "Creating ${WEBDIR}/xul/"
60         mkdir -p ${WEBDIR}/xul/
61         @echo "BUILD_ID = ${STAFF_CLIENT_BUILD_ID}"
62         @echo "Copying xul into ${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
63         mkdir -p "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
64         cp -R ../xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
65
66 webcore-install:
67         @echo $@
68         echo "Copying web into $(WEBDIR)"
69         mkdir -p $(ADMINDIR)
70         cp -r ../admin/* $(ADMINDIR)
71         mkdir -p $(WEBDIR)
72         mkdir -p $(WEBDIR)/opac/extras/xsl/
73         cp -r ../web/* $(WEBDIR)
74         cp $(OPENSRF_LIBS)/javascript/* $(WEBDIR)/opac/common/js/
75         # dojo-ified opensrf libs
76         cp $(OPENSRF_LIBS)/javascript/opensrf*js $(WEBDIR)/js/opensrf/
77         cp $(OPENSRF_LIBS)/javascript/OpenSRF.js $(WEBDIR)/js/
78         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
79         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
80         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
81         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/advanced.xml
82         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/myopac.xml
83         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/cnbrowse.xml
84         cp ../xul/staff_client/chrome//content//util/date.js $(WEBDIR)/opac/common/js/
85         cp ../xsl/*.xsl $(WEBDIR)/opac/extras/xsl/
86         ln -sf $(ETCDIR)/fm_IDL.xml $(WEBDIR)/reports/
87         cp ../xul/staff_client/server/admin/adminlib.js $(WEBDIR)/reports/
88         mkdir -p $(WEBDIR)/opac/extras/slimpac/
89         
90
91 libfieldmapper: 
92         make -C apachemods libfieldmapper.so
93
94 libfieldmapper-install: 
95         make -C apachemods libfieldmapper-install
96
97 c_apps:
98         @echo $@
99         make -C c-apps
100         make -C extras oils_requestor
101
102 c_apps-install:
103         @echo $@
104         make -C c-apps install
105         make -C extras oils_requestor-install
106
107 autojs-install:
108         @echo $@
109         cp extras/fieldmapper.pl $(BINDIR)
110         cp extras/org_tree_js.pl $(BINDIR)
111         cp extras/org_lasso_js.pl $(BINDIR)
112         cp extras/org_tree_html_options.pl $(BINDIR)
113         cp extras/org_tree_proximity.pl $(BINDIR)
114         cp extras/autogen.sh $(BINDIR)
115         cp support-scripts/offline-blocked-list.pl $(BINDIR) # this should probably be somewhere else
116 # -----------------------------------------------------------------------------------
117
118 marcdumper:
119         @echo $@
120         make -C extras/marcdumper
121
122 marcdumper-install:
123         @echo $@
124         make -C extras/marcdumper install
125
126 # -----------------------------------------------------------------------------------
127
128 perl-install:
129         @echo $@
130         @echo "Installing Perl modules to $(PERLDIR)"
131         mkdir -p $(PERLDIR)
132         mkdir -p $(DATADIR)
133         mkdir -p $(BINDIR)
134         cp extras/ils_events.xml $(DATADIR)
135         cp -r perlmods/* $(PERLDIR)
136         cp ../examples/opensrf.xml.example $(ETCDIR)
137         cp ../examples/opensrf_core.xml.example $(ETCDIR)
138         cp ../examples/fm_IDL.xml $(ETCDIR)
139         cp ../examples/oils_sip.xml.example $(ETCDIR)
140         cp ../examples/hold_notification_template.example $(DATADIR)
141         cp ../examples/oils_ctl.sh $(BINDIR)
142         cp ../examples/lib_ips.txt.example $(ETCDIR)
143         mkdir -p $(TEMPLATEDIR)
144         cp -r templates/marc $(TEMPLATEDIR)
145
146 # ------------------------------------------------------------------------------
147
148 python-build:
149         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python build; fi;
150
151 # -----------------------------------------------------------------------------------
152
153 python-install:
154         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python install; fi;
155
156 # -----------------------------------------------------------------------------------
157
158 reporter-install:
159         @echo $@
160         @echo "Installing Reporter email templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
161         cp reporter/clark-kent.pl $(BINDIR)
162         cp reporter/find_orphaned_reports.pl $(BINDIR)
163         cp reporter/report-fail $(DATADIR)
164         cp reporter/report-success $(DATADIR)
165         mkdir -p $(REPORTERDIR)
166
167 # -----------------------------------------------------------------------------------
168 offline-install:
169         @echo "Installing offline CGIs to $(CGIDIR)/offline";
170         mkdir -p $(CGIDIR)/offline;
171         mkdir -p $(DATADIR)/offline;
172         perl -pe "s{##CONFIG##}{$(ETCDIR)}" < offline/offline.pl > $(TMP)/offline.pl;
173         cp offline/offline-config.pl $(ETCDIR)
174         cp $(TMP)/offline.pl $(CGIDIR)/offline/
175         chmod +x $(CGIDIR)/offline/offline.pl
176
177 # -----------------------------------------------------------------------------------
178
179 cgi-bootstrap:
180         @echo "Installing cgi's to $(CGIDIR)"
181         mkdir -p $(TMP)/cgi-bin
182         mkdir -p $(CGIDIR)
183         for i in cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{$(ETCDIR)}" < $$i > $(TMP)/$$i; done
184         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
185         cp -r cgi-bin/support $(CGIDIR)
186         cp cgi-bin/setup.pl $(ETCDIR)/live-db-setup.pl
187         chmod 755 $(CGIDIR)/*cgi
188
189 storage-bootstrap:
190         @echo $@
191         @echo ""
192         @echo "WARNING!"
193         @echo ""
194         @echo "storage-bootstrap will DESTROY all data within all of the ILS tables in your database."
195         @echo "The database this script will touch has a DBI DSN of"
196         @echo "    dbi:$(DBDRVR):host=$(DBHOST);dbname=$(DBNAME);port=$(DBPORT)"
197         @echo "Type control-c to avoid destroying all of the data.  Type enter to continue..."
198         @echo ""
199         @read X;
200         ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBPORT) $(DBNAME) $(DBUSER) $(DBPW) $(DBVER)
201
202 # -----------------------------------------------------------------------------------
203
204
205 string-templates-install:
206         @echo "Installing string templates to $(TEMPLATEDIR)"
207         mkdir -p $(TEMPLATEDIR)
208         cp -r templates/strings $(TEMPLATEDIR)
209
210 xsl-install:    
211         @echo "Installing XSL files to $(XSLDIR)"
212         mkdir -p $(XSLDIR)
213         cp ../xsl/*.xsl $(XSLDIR)
214 #       mkdir -p $(WEBDIR)/xsl/
215 #       cp ../xsl/*.xsl $(WEBDIR)/xsl/
216
217 clean:
218         @echo $@
219         make -C extras clean
220         make -C apachemods clean
221         make -C c-apps clean
222         if [ -n "$(EG_PYTHON_INSTALL)" ]; then echo $@; make -C python clean --all; fi;
223