build/i18n/Makefile.in:
[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/org_tree_js.pl \
45          @srcdir@/extras/org_lasso_js.pl \
46          @srcdir@/extras/org_tree_html_options.pl \
47          @srcdir@/extras/org_tree_proximity.pl \
48          @srcdir@/extras/autogen.sh \
49          @srcdir@/support-scripts/offline-blocked-list.pl 
50
51 # Decide which entities to build
52
53 #----------------------------
54 # Build ILS CORE
55 #----------------------------
56
57 if BUILDILSCORE
58
59 #Add directories to build
60 OILSCORE_DIRS = c-apps extras 
61 #Add manual (non-automake) install targets for simplicity of installing.
62 OILSCORE_INST = ilscore-install
63
64 core_data = @srcdir@/extras/ils_events.xml \
65             $(examples)/hold_notification_template.example
66
67 sysconf_DATA = $(examples)/opensrf.xml.example \
68                $(examples)/opensrf_core.xml.example \
69                $(examples)/fm_IDL.xml \
70                $(examples)/oils_sip.xml.example \
71                $(examples)/lib_ips.txt.example
72
73 core_scripts =   $(examples)/oils_ctl.sh \
74                  $(supportscr)/fine_generator.pl \
75                  $(supportscr)/hold_targeter.pl \
76                  $(supportscr)/reshelving_complete.srfsh \
77                  $(supportscr)/thaw_expired_frozen_holds.srfsh \
78                  $(supportscr)/long-overdue-status-update.pl \
79                  $(srcdir)/extras/openurl_map.pl 
80          
81 installautojs = $(autojsbinscripts)
82
83 #circ-rules-install
84 circrules_SCRIPTS = $(jsbackend)/circ/circ_duration.js \
85                     $(jsbackend)/circ/circ_groups.js \
86                     $(jsbackend)/circ/circ_item_config.js \
87                     $(jsbackend)/circ/circ_lib.js \
88                     $(jsbackend)/circ/circ_permit_copy.js \
89                     $(jsbackend)/circ/circ_permit_hold.js \
90                     $(jsbackend)/circ/circ_permit_patron.js \
91                     $(jsbackend)/circ/circ_permit_renew.js 
92 penaltyrules_SCRIPTS = $(jsbackend)/penalty/patron_penalty.js
93 catalogscript_SCRIPTS = $(jsbackend)/catalog/biblio_descriptor.js \
94                         $(jsbackend)/catalog/biblio_fingerprint.js \
95                         $(jsbackend)/catalog/fixed_fields.js \
96                         $(jsbackend)/catalog/phys_char.js \
97                         $(jsbackend)/catalog/record_type.js
98
99 endif
100
101 #--------------------
102 # Build ILS WEB
103 #--------------------
104
105 if BUILDILSWEB
106 OILSWEB_DIRS = apachemods
107 OILSWEB_INST = webcore-install offline-install cgi-bootstrap
108
109 #webcore-install
110
111 reports_SCRIPTS = @top_srcdir@/Open-ILS/xul/staff_client/server/admin/adminlib.js
112 opacjs_SCRIPTS = $(OPENSRF_LIBS)/javascript/DojoSRF.js \
113                  $(OPENSRF_LIBS)/javascript/JSON_v0.js \
114                  $(OPENSRF_LIBS)/javascript/JSON_v1.js \
115                  $(OPENSRF_LIBS)/javascript/md5.js \
116                  $(OPENSRF_LIBS)/javascript/opensrf.js \
117                  $(OPENSRF_LIBS)/javascript/opensrf_xhr.js \
118                  $(OPENSRF_LIBS)/javascript/opensrf_xmpp.js \
119                  @top_srcdir@/Open-ILS/xul/staff_client/chrome//content//util/date.js
120 jsdojo_SCRIPTS = $(OPENSRF_LIBS)/javascript/DojoSRF.js
121 jsdojoosrf_SCRIPTS = $(OPENSRF_LIBS)/javascript/md5.js \
122                      $(OPENSRF_LIBS)/javascript/JSON_v1.js \
123                      $(OPENSRF_LIBS)/javascript/opensrf.js \
124                      $(OPENSRF_LIBS)/javascript/opensrf_xhr.js \
125                      $(OPENSRF_LIBS)/javascript/opensrf_xmpp.js
126
127 installautojs = $(autojsbinscripts)
128
129
130 endif
131
132
133 #---------------------
134 # Build ILS Reporter
135 #---------------------
136
137 if BUILDILSREPORTER
138 OILSREP_INST = reporter-install
139 #reporter-install
140 reporter_scripts = @srcdir@/reporter/clark-kent.pl \
141                    @srcdir@/reporter/find_orphaned_reports.pl
142 reporter_data = @srcdir@/reporter/report-fail \
143                @srcdir@/reporter/report-success
144 endif
145
146 #------------------------------
147 # Build ILS XUL CLIENT/SERVER
148 #------------------------------
149
150 if BUILDILSCLIENT
151 OILSCLIENT_DIRS = ../xul/staff_client
152 OILSSERVER_INST = server-xul
153 endif
154
155 #------------------------------
156 # Build EVERGREEN PYTHON
157 #------------------------------
158
159 if BUILDEGPYTHON
160 OILSPYTHON_DIR = python
161 endif
162
163 #------------------------------
164 # Build EVERGREEN JAVA
165 #------------------------------
166
167 if BUILDEGJAVA
168 OILSJAVA_DIR = java
169 endif
170
171 bin_SCRIPTS = $(core_scripts) $(reporter_scripts) $(installautojs) @srcdir@/extras/eg_config
172 data_DATA = $(core_data) $(reporter_data)
173
174 # Take care of which subdirectories to build, and which extra files to include in a distibution.
175
176 SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIRS) $(OILSCLIENT_DIRS) $(OILSPYTHON_DIR) $(OILSJAVA_DIR)
177
178 EXTRA_DIST = @srcdir@/perlmods @srcdir@/templates @top_srcdir@/Open-ILS/xsl @srcdir@/cgi-bin
179
180 # Install header files
181
182 oilsincludedir = $(DESTDIR)@includedir@/openils
183 headsdir = @top_srcdir@/Open-ILS/include/openils
184 oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h $(headsdir)/oils_event.h $(headsdir)/oils_idl.h $(headsdir)/oils_utils.h
185
186 # Install everything that did not get installed by autotools
187
188 install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSREP_INST) $(OILSSERVER_INST)
189
190 uninstall-hook:
191         rm -R $(perldir)
192         rm -R $(TEMPLATEDIR)
193         rm -R $(XSLDIR)
194         rm -R $(CGIDIR)
195         rm -R $(webdir)
196         rm -R $(opacextrasdir)
197
198
199 #perl-install and string-templates-install      
200 ilscore-install:
201         @echo $@
202         @echo "Installing Perl modules"
203         mkdir -p $(perldir)
204         mkdir -p $(TEMPLATEDIR)
205         cp -r @srcdir@/perlmods/* $(perldir)
206         cp -r @srcdir@/templates/marc $(TEMPLATEDIR)
207         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@libdir@/perl5/OpenILS/WWW/Web.pm'
208         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@libdir@/perl5/OpenILS/WWW/Method.pm'
209         @echo "Installing string templates to $(TEMPLATEDIR)"
210         mkdir -p $(TEMPLATEDIR)
211         mkdir -p $(datadir)/overdue/
212         cp -r @srcdir@/templates/strings $(TEMPLATEDIR)
213         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
214         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
215         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
216         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
217         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
218         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
219         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
220         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
221         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
222         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
223         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
224         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
225         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
226         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/offline-blocked-list.pl'
227
228 webcore-install:
229         mkdir -p $(WEBDIR)
230         mkdir -p $(WEBDIR)/opac/extras/slimpac/
231         mkdir -p $(WEBDIR)/standalone/
232         mkdir -p $(opacextrasdir)
233         mkdir -p $(XSLDIR)
234         cp -r @top_srcdir@/Open-ILS/web/ @localstatedir@
235         cp @top_srcdir@/Open-ILS/xsl/*.xsl $(opacextrasdir)
236         cp @top_srcdir@/Open-ILS/xsl/*.xsl $(XSLDIR)
237         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/mresult.xml
238         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/rresult.xml
239         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/rdetail.xml
240         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/advanced.xml
241         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/myopac.xml
242         ln -sf $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/index.xml $(DESTDIR)$(WEBDIR)/opac/skin/default/xml/cnbrowse.xml
243         cp $(DESTDIR)@sysconfdir@/fm_IDL.xml $(DESTDIR)$(WEBDIR)/reports/
244
245
246 offline-install:
247         @echo "Installing offline CGIs to $(CGIDIR)/offline";
248         mkdir -p $(TMP)
249         mkdir -p $(CGIDIR)/offline;
250         mkdir -p $(datadir)/offline;
251         perl -pe "s{##CONFIG##}{@sysconfdir@}" < @srcdir@/offline/offline.pl > $(TMP)/offline.pl;
252         cp @srcdir@/offline/offline-config.pl @sysconfdir@
253         cp $(TMP)/offline.pl $(DESTDIR)$(CGIDIR)/offline/
254         chmod +x $(DESTDIR)$(CGIDIR)/offline/offline.pl
255
256 cgi-bootstrap:
257         @echo "Installing cgi's to $(CGIDIR)"
258         mkdir -p $(TMP)/cgi-bin
259         mkdir -p $(CGIDIR)
260         for i in @srcdir@/cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{@sysconfdir@}" < $$i > $(TMP)/$$i; done
261         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
262         cp -r @srcdir@/cgi-bin/support $(CGIDIR)
263         cp @srcdir@/cgi-bin/setup.pl @sysconfdir@/live-db-setup.pl
264         chmod 755 $(DESTDIR)$(CGIDIR)/*cgi
265
266 server-xul:
267         @echo $@
268         mkdir -p $(WEBDIR)
269         mkdir -p $(WEBDIR)/xul/
270         @echo "BUILD_ID = $(STAFF_CLIENT_BUILD_ID)"
271         @echo "Copying xul into $(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)"
272         mkdir -p "$(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)"
273         cp -R @top_srcdir@/Open-ILS/xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
274
275 reporter-install:
276         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
277         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
278
279