Add a basic, ugly language picker to the SlimPAC (another part of #1)
[Evergreen.git] / Open-ILS / src / Makefile.am
1 # Copyright (C) 2008 Equinox Software, Inc.
2 # Kevin Beswick <kevinbeswick00@gmail.com>
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 ## Process this file with automake to generate Makefile.in
15
16
17 export INCDIR = "$(INCLUDEDIR)/openils/"
18 export STAFF_CLIENT_BUILD_ID = `/bin/cat @top_srcdir@/Open-ILS/xul/staff_client/build/BUILD_ID`
19 export DEF_LDFLAGS = -L. -L$(TMP) -L$(OPENSRF_LIBS)
20 export DEF_CFLAGS = -D_LARGEFILE64_SOURCE -pipe -g -Wall -O2 -fPIC -I@top_srcdir@/include -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS)  -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(OPENSRF_HEADERS)
21 export DEF_LDLIBS = -lopensrf 
22
23
24 # Establish some installation directories and such
25 prefix=@prefix@
26 exec_prefix=@exec_prefix@
27 datadir=@localstatedir@/data
28 circrulesdir=@localstatedir@/circ
29 catalogscriptdir=@localstatedir@/catalog
30 penaltyrulesdir=@localstatedir@/penalty
31 examples = @top_srcdir@/Open-ILS/examples
32 jsbackend = @srcdir@/javascript/backend
33 supportscr = @srcdir@/support-scripts
34 webdir = $(WEBDIR)
35 opacjsdir = $(DESTDIR)$(WEBDIR)/opac/common/js
36 jsdojodir = $(DESTDIR)$(WEBDIR)/js/dojo
37 jsdojoosrfdir = $(DESTDIR)$(WEBDIR)/js/dojo/opensrf
38 opacextrasdir = $(DESTDIR)$(WEBDIR)/opac/extras/xsl/
39 reportsdir = $(DESTDIR)$(WEBDIR)/reports/
40
41 # Collect files to be used by multiple targets
42
43 autojsbinscripts = @srcdir@/extras/fieldmapper.pl \
44          @srcdir@/extras/locale_html_options.pl \
45          @srcdir@/extras/org_tree_js.pl \
46          @srcdir@/extras/org_lasso_js.pl \
47          @srcdir@/extras/org_tree_html_options.pl \
48          @srcdir@/extras/org_tree_proximity.pl \
49          @srcdir@/extras/autogen.sh \
50          @srcdir@/support-scripts/offline-blocked-list.pl 
51
52 # Decide which entities to build
53
54 #----------------------------
55 # Build ILS CORE
56 #----------------------------
57
58 if BUILDILSCORE
59
60 #Add directories to build
61 OILSCORE_DIRS = c-apps extras 
62 #Add manual (non-automake) install targets for simplicity of installing.
63 OILSCORE_INST = ilscore-install
64
65 core_data = @srcdir@/extras/ils_events.xml \
66             $(examples)/hold_notification_template.example
67
68 sysconf_DATA = $(examples)/opensrf.xml.example \
69                $(examples)/opensrf_core.xml.example \
70                $(examples)/fm_IDL.xml \
71                $(examples)/oils_sip.xml.example \
72                $(examples)/lib_ips.txt.example
73
74 core_scripts =   $(examples)/oils_ctl.sh \
75                  $(supportscr)/fine_generator.pl \
76                  $(supportscr)/hold_targeter.pl \
77                  $(supportscr)/reshelving_complete.srfsh \
78                  $(supportscr)/thaw_expired_frozen_holds.srfsh \
79                  $(supportscr)/long-overdue-status-update.pl \
80                  $(srcdir)/extras/openurl_map.pl 
81          
82 installautojs = $(autojsbinscripts)
83
84 #circ-rules-install
85 circrules_SCRIPTS = $(jsbackend)/circ/circ_duration.js \
86                     $(jsbackend)/circ/circ_groups.js \
87                     $(jsbackend)/circ/circ_item_config.js \
88                     $(jsbackend)/circ/circ_lib.js \
89                     $(jsbackend)/circ/circ_permit_copy.js \
90                     $(jsbackend)/circ/circ_permit_hold.js \
91                     $(jsbackend)/circ/circ_permit_patron.js \
92                     $(jsbackend)/circ/circ_permit_renew.js 
93 penaltyrules_SCRIPTS = $(jsbackend)/penalty/patron_penalty.js
94 catalogscript_SCRIPTS = $(jsbackend)/catalog/biblio_descriptor.js \
95                         $(jsbackend)/catalog/biblio_fingerprint.js \
96                         $(jsbackend)/catalog/fixed_fields.js \
97                         $(jsbackend)/catalog/phys_char.js \
98                         $(jsbackend)/catalog/record_type.js
99
100 endif
101
102 #--------------------
103 # Build ILS WEB
104 #--------------------
105
106 if BUILDILSWEB
107 OILSWEB_DIRS = apachemods
108 OILSWEB_INST = webcore-install offline-install cgi-bootstrap
109
110 #webcore-install
111
112 reports_SCRIPTS = @top_srcdir@/Open-ILS/xul/staff_client/server/admin/adminlib.js
113 opacjs_SCRIPTS = $(OPENSRF_LIBS)/javascript/DojoSRF.js \
114                  $(OPENSRF_LIBS)/javascript/JSON_v0.js \
115                  $(OPENSRF_LIBS)/javascript/JSON_v1.js \
116                  $(OPENSRF_LIBS)/javascript/md5.js \
117                  $(OPENSRF_LIBS)/javascript/opensrf.js \
118                  $(OPENSRF_LIBS)/javascript/opensrf_xhr.js \
119                  $(OPENSRF_LIBS)/javascript/opensrf_xmpp.js \
120                  @top_srcdir@/Open-ILS/xul/staff_client/chrome//content//util/date.js
121 jsdojo_SCRIPTS = $(OPENSRF_LIBS)/javascript/DojoSRF.js
122 jsdojoosrf_SCRIPTS = $(OPENSRF_LIBS)/javascript/md5.js \
123                      $(OPENSRF_LIBS)/javascript/JSON_v1.js \
124                      $(OPENSRF_LIBS)/javascript/opensrf.js \
125                      $(OPENSRF_LIBS)/javascript/opensrf_xhr.js \
126                      $(OPENSRF_LIBS)/javascript/opensrf_xmpp.js
127
128 installautojs = $(autojsbinscripts)
129
130
131 endif
132
133
134 #---------------------
135 # Build ILS Reporter
136 #---------------------
137
138 if BUILDILSREPORTER
139 OILSREP_INST = reporter-install
140 #reporter-install
141 reporter_scripts = @srcdir@/reporter/clark-kent.pl \
142                    @srcdir@/reporter/find_orphaned_reports.pl
143 reporter_data = @srcdir@/reporter/report-fail \
144                @srcdir@/reporter/report-success
145 endif
146
147 #------------------------------
148 # Build ILS XUL CLIENT/SERVER
149 #------------------------------
150
151 if BUILDILSCLIENT
152 OILSCLIENT_DIRS = ../xul/staff_client
153 OILSSERVER_INST = server-xul
154 endif
155
156 #------------------------------
157 # Build EVERGREEN PYTHON
158 #------------------------------
159
160 if BUILDEGPYTHON
161 OILSPYTHON_DIR = python
162 endif
163
164 #------------------------------
165 # Build EVERGREEN JAVA
166 #------------------------------
167
168 if BUILDEGJAVA
169 OILSJAVA_DIR = java
170 endif
171
172 bin_SCRIPTS = $(core_scripts) $(reporter_scripts) $(installautojs) @srcdir@/extras/eg_config
173 data_DATA = $(core_data) $(reporter_data)
174
175 # Take care of which subdirectories to build, and which extra files to include in a distibution.
176
177 SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIRS) $(OILSCLIENT_DIRS) $(OILSPYTHON_DIR) $(OILSJAVA_DIR)
178
179 EXTRA_DIST = @srcdir@/perlmods @srcdir@/templates @top_srcdir@/Open-ILS/xsl @srcdir@/cgi-bin
180
181 # Install header files
182
183 oilsincludedir = $(DESTDIR)@includedir@/openils
184 headsdir = @top_srcdir@/Open-ILS/include/openils
185 oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h $(headsdir)/oils_event.h $(headsdir)/oils_idl.h $(headsdir)/oils_utils.h
186
187 # Install everything that did not get installed by autotools
188
189 install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSREP_INST) $(OILSSERVER_INST)
190
191 uninstall-hook:
192         rm -R $(perldir)
193         rm -R $(TEMPLATEDIR)
194         rm -R $(XSLDIR)
195         rm -R $(CGIDIR)
196         rm -R $(webdir)
197         rm -R $(opacextrasdir)
198
199
200 #perl-install and string-templates-install      
201 ilscore-install:
202         @echo $@
203         @echo "Installing Perl modules"
204         mkdir -p $(perldir)
205         mkdir -p $(TEMPLATEDIR)
206         cp -r @srcdir@/perlmods/* $(perldir)
207         cp -r @srcdir@/templates/marc $(TEMPLATEDIR)
208         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@libdir@/perl5/OpenILS/WWW/Web.pm'
209         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@libdir@/perl5/OpenILS/WWW/Method.pm'
210         @echo "Installing string templates to $(TEMPLATEDIR)"
211         mkdir -p $(TEMPLATEDIR)
212         mkdir -p $(datadir)/overdue/
213         cp -r @srcdir@/templates/strings $(TEMPLATEDIR)
214         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
215         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
216         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
217         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
218         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
219         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
220         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
221         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
222         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
223         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
224         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
225         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
226         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
227         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/offline-blocked-list.pl'
228
229 webcore-install:
230         mkdir -p $(WEBDIR)
231         mkdir -p $(WEBDIR)/opac/extras/slimpac/
232         mkdir -p $(WEBDIR)/standalone/
233         mkdir -p $(opacextrasdir)
234         mkdir -p $(XSLDIR)
235         cp -r @top_srcdir@/Open-ILS/web/ @localstatedir@
236         cp @top_srcdir@/Open-ILS/xsl/*.xsl $(opacextrasdir)
237         cp @top_srcdir@/Open-ILS/xsl/*.xsl $(XSLDIR)
238         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/mresult.xml
239         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/rresult.xml
240         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/rdetail.xml
241         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/advanced.xml
242         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/myopac.xml
243         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/cnbrowse.xml
244         rm  $(DESTDIR)$(WEBDIR)/reports/fm_IDL.xml
245         cp $(DESTDIR)@sysconfdir@/fm_IDL.xml $(DESTDIR)$(WEBDIR)/reports/
246
247
248 offline-install:
249         @echo "Installing offline CGIs to $(CGIDIR)/offline";
250         mkdir -p $(TMP)
251         mkdir -p $(CGIDIR)/offline;
252         mkdir -p $(datadir)/offline;
253         perl -pe "s{##CONFIG##}{@sysconfdir@}" < @srcdir@/offline/offline.pl > $(TMP)/offline.pl;
254         cp @srcdir@/offline/offline-config.pl @sysconfdir@
255         cp $(TMP)/offline.pl $(DESTDIR)$(CGIDIR)/offline/
256         chmod +x $(DESTDIR)$(CGIDIR)/offline/offline.pl
257
258 cgi-bootstrap:
259         @echo "Installing cgi's to $(CGIDIR)"
260         mkdir -p $(TMP)/cgi-bin
261         mkdir -p $(CGIDIR)
262         for i in @srcdir@/cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{@sysconfdir@}" < $$i > $(TMP)/$$i; done
263         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
264         cp -r @srcdir@/cgi-bin/support $(CGIDIR)
265         cp @srcdir@/cgi-bin/setup.pl @sysconfdir@/live-db-setup.pl
266         chmod 755 $(DESTDIR)$(CGIDIR)/*cgi
267
268 server-xul:
269         @echo $@
270         mkdir -p $(WEBDIR)
271         mkdir -p $(WEBDIR)/xul/
272         @echo "BUILD_ID = $(STAFF_CLIENT_BUILD_ID)"
273         @echo "Copying xul into $(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)"
274         mkdir -p "$(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)"
275         cp -R @top_srcdir@/Open-ILS/xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
276
277 reporter-install:
278         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
279         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
280
281