LP#1796945 Reporter cloning and creation fixes
[working/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 STAFF_CLIENT_BUILD_ID = `/bin/cat @top_srcdir@/Open-ILS/xul/staff_client/build/BUILD_ID`
18 export DEF_LDFLAGS = -L. -L$(TMP) -L$(OPENSRF_LIBS)
19 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)
20 export DEF_LDLIBS = -lopensrf 
21
22
23 # Establish some installation directories and such
24 prefix=@prefix@
25 exec_prefix=@exec_prefix@
26 datadir=@localstatedir@/data
27 examples = @top_srcdir@/Open-ILS/examples
28 supportscr = @srcdir@/support-scripts
29
30 # Collect files to be used by multiple targets
31
32 autojsbinscripts = @srcdir@/extras/autogen.sh
33
34 # Decide which entities to build
35
36 sysconf_DATA = $(examples)/action_trigger_filters.json.example \
37                $(examples)/opensrf.xml.example \
38                $(examples)/opensrf_core.xml.example \
39                $(examples)/fm_IDL.xml \
40                $(examples)/oils_sip.xml.example \
41                $(examples)/lib_ips.txt.example \
42                $(examples)/oils_yaz.xml.example \
43                $(examples)/kpac.xml.example \
44                $(examples)/oils_z3950.xml.example \
45                $(examples)/marc_stream_importer.conf.example
46
47 #----------------------------
48 # Build ILS CORE
49 #----------------------------
50
51 if BUILDILSCORE
52
53 #Add directories to build
54 OILSCORE_DIRS = c-apps extras perlmods
55 #Add manual (non-automake) install targets for simplicity of installing.
56 OILSCORE_INST = ilscore-install
57
58 core_data = @srcdir@/extras/ils_events.xml \
59             $(examples)/hold_notification_template.example
60
61 core_scripts =   $(examples)/oils_ctl.sh \
62                  $(supportscr)/fine_generator.pl \
63                  $(supportscr)/hold_targeter.pl \
64                  $(supportscr)/hold_targeter_legacy.pl \
65                  $(supportscr)/reshelving_complete.srfsh \
66                  $(supportscr)/clear_expired_circ_history.srfsh \
67                  $(supportscr)/update_hard_due_dates.srfsh \
68                  $(supportscr)/juv_to_adult.srfsh \
69                  $(supportscr)/thaw_expired_frozen_holds.srfsh \
70                  $(supportscr)/long-overdue-status-update.pl \
71                  $(supportscr)/oils_header.pl \
72                  $(supportscr)/purge_at_events.srfsh \
73                  $(supportscr)/purge_holds.srfsh \
74                  $(supportscr)/purge_circulations.srfsh \
75                  $(supportscr)/purge_pending_users.srfsh \
76                  $(supportscr)/clear_cc_number.srfsh \
77                  $(supportscr)/sitemap_generator \
78                  $(srcdir)/extras/eg_config \
79                  $(srcdir)/extras/openurl_map.pl \
80                  $(srcdir)/extras/import/marc_add_ids \
81                  $(supportscr)/pingest.pl
82
83 installautojs = $(autojsbinscripts)
84
85 endif
86
87 #--------------------
88 # Build Apache modules
89 #--------------------
90
91 if BUILDAPACHEMODS
92 OILSWEB_DIR = apachemods
93 endif
94
95 #---------------------
96 # Build ILS Reporter
97 #---------------------
98
99 if BUILDILSREPORTER
100 OILSREP_INST = reporter-install
101 #reporter-install
102 reporter_scripts = @srcdir@/reporter/clark-kent.pl \
103                    @srcdir@/reporter/find_orphaned_reports.pl
104 reporter_data = @srcdir@/reporter/report-fail \
105                @srcdir@/reporter/report-success
106 endif
107
108 #------------------------------
109 # Build EVERGREEN PYTHON
110 #------------------------------
111
112 if BUILDEGPYTHON
113 OILSPYTHON_DIR = python
114 endif
115
116 #------------------------------
117 # Build EVERGREEN JAVA
118 #------------------------------
119
120 if BUILDEGJAVA
121 OILSJAVA_DIR = java
122 endif
123
124 # scripts that are generated from *.in files and can
125 # be deleted by a make clean
126 gen_scripts = \
127         @srcdir@/extras/fast-extract \
128         @srcdir@/extras/import/marc2are.pl \
129         @srcdir@/extras/import/marc2bre.pl \
130         @srcdir@/extras/import/marc2sre.pl \
131         @srcdir@/extras/import/parallel_pg_loader.pl \
132         $(supportscr)/action_trigger_runner.pl \
133         $(supportscr)/authority_control_fields.pl \
134         $(supportscr)/authority_authority_linker.pl \
135         $(supportscr)/eg_db_config \
136         $(supportscr)/marc_export \
137         $(supportscr)/marc_stream_importer.pl \
138         $(supportscr)/offline-blocked-list.pl
139
140 # config files that are generated from *.in files and can
141 # be deleted by a make clean
142 gen_docs = \
143         $(examples)/apache_24/eg_startup \
144         $(examples)/apache_24/eg_24.conf \
145         $(examples)/apache_24/eg_vhost_24.conf
146
147 bin_SCRIPTS = $(core_scripts) $(gen_scripts) $(reporter_scripts) $(installautojs)
148
149 CLEANFILES = $(gen_scripts)
150
151 data_DATA = $(core_data) $(reporter_data)
152
153 doc_DATA = $(gen_docs)
154
155 # Take care of which subdirectories to build, and which extra files to include in a distribution.
156
157 SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIR) $(OILSPYTHON_DIR) $(OILSJAVA_DIR)
158
159 EXTRA_DIST = @srcdir@/perlmods \
160         @srcdir@/data \
161         @srcdir@/templates \
162         @top_srcdir@/Open-ILS/xsl \
163         @srcdir@/cgi-bin \
164         $(gen_scripts) \
165         $(gen_docs) \
166         @srcdir@/extras/eg_config
167
168 do_subst = $(SED) \
169         -e 's,[@]bindir[@],$(bindir),g' \
170         -e 's,[@]datarootdir[@],$(datarootdir),g' \
171         -e 's,[@]docdir[@],$(docdir),g' \
172         -e 's,[@]exec_prefix[@],$(exec_prefix),g' \
173         -e 's,[@]includedir[@],$(includedir),g' \
174         -e 's,[@]libdir[@],$(libdir),g' \
175         -e 's,[@]localstatedir[@],$(localstatedir),g' \
176         -e 's,[@]prefix[@],$(prefix),g' \
177         -e 's,[@]sysconfdir[@],$(sysconfdir),g'
178
179 # Install header files
180
181 oilsincludedir = @includedir@/openils
182 headsdir = @top_srcdir@/Open-ILS/include/openils
183 oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h $(headsdir)/oils_event.h $(headsdir)/oils_idl.h $(headsdir)/oils_utils.h
184
185 # Install everything that did not get installed by autotools
186
187 install-data-hook: $(OILSCORE_INST) $(OILSWEB_INST) $(OILSUPDATES_INST) $(OILSREP_INST)
188
189 uninstall-hook:
190         rm -R $(TEMPLATEDIR)
191         rm -R $(XSLDIR)
192         rm -R $(CGIDIR)
193
194 @srcdir@/extras/fast-extract: Makefile @srcdir@/extras/fast-extract.in
195         $(do_subst) @srcdir@/extras/fast-extract.in > "$@"
196         chmod 755 "$@"
197
198 @srcdir@/extras/import/marc2are.pl: Makefile @srcdir@/extras/import/marc2are.pl.in
199         $(do_subst) @srcdir@/extras/import/marc2are.pl.in > "$@"
200         chmod 755 "$@"
201
202 @srcdir@/extras/import/marc2bre.pl: Makefile @srcdir@/extras/import/marc2bre.pl.in
203         $(do_subst) @srcdir@/extras/import/marc2bre.pl.in > "$@"
204         chmod 755 "$@"
205
206 @srcdir@/extras/import/marc2sre.pl: Makefile @srcdir@/extras/import/marc2sre.pl.in
207         $(do_subst) @srcdir@/extras/import/marc2sre.pl.in > "$@"
208         chmod 755 "$@"
209
210 @srcdir@/extras/import/parallel_pg_loader.pl: Makefile @srcdir@/extras/import/parallel_pg_loader.pl.in
211         $(do_subst) @srcdir@/extras/import/parallel_pg_loader.pl.in > "$@"
212         chmod 755 "$@"
213
214 $(supportscr)/action_trigger_runner.pl: Makefile $(supportscr)/action_trigger_runner.pl.in
215         $(do_subst) $(supportscr)/action_trigger_runner.pl.in > "$@"
216         chmod 755 "$@"
217
218 $(supportscr)/authority_authority_linker.pl: Makefile $(supportscr)/authority_authority_linker.pl.in
219         $(do_subst) $(supportscr)/authority_authority_linker.pl.in > "$@"
220         chmod 755 "$@"
221
222 $(supportscr)/authority_control_fields.pl: Makefile $(supportscr)/authority_control_fields.pl.in
223         $(do_subst) $(supportscr)/authority_control_fields.pl.in > "$@"
224         chmod 755 "$@"
225
226 $(supportscr)/eg_db_config: Makefile $(supportscr)/eg_db_config.in
227         $(do_subst) $(supportscr)/eg_db_config.in > "$@"
228         chmod 755 "$@"
229
230 $(supportscr)/marc_export: Makefile $(supportscr)/marc_export.in
231         $(do_subst) $(supportscr)/marc_export.in > "$@"
232         chmod 755 "$@"
233
234 $(supportscr)/marc_stream_importer.pl: Makefile $(supportscr)/marc_stream_importer.pl.in
235         $(do_subst) $(supportscr)/marc_stream_importer.pl.in > "$@"
236         chmod 755 "$@"
237
238 $(supportscr)/offline-blocked-list.pl: Makefile $(supportscr)/offline-blocked-list.pl.in
239         $(do_subst) $(supportscr)/offline-blocked-list.pl.in > "$@"
240         chmod 755 "$@"
241
242 $(examples)/apache_24/eg_startup: Makefile $(examples)/apache_24/eg_startup.in
243         $(do_subst) $(examples)/apache_24/eg_startup.in > "$@"
244
245 $(examples)/apache_24/eg_24.conf: Makefile $(examples)/apache_24/eg.conf.in
246         $(do_subst) $(examples)/apache_24/eg.conf.in > "$@"
247
248 $(examples)/apache_24/eg_vhost_24.conf: Makefile $(examples)/apache_24/eg_vhost.conf.in
249         $(do_subst) $(examples)/apache_24/eg_vhost.conf.in > "$@"
250
251 #perl-install and string-templates-install      
252 ilscore-install:
253         @echo $@
254         $(MKDIR_P) $(DESTDIR)$(TEMPLATEDIR)
255         @echo "Installing templates to $(DESTDIR)$(TEMPLATEDIR)"
256         cp -r @srcdir@/templates/* $(DESTDIR)$(TEMPLATEDIR)
257         -@if test -d @srcdir@/data/locale; then \
258                 $(MKDIR_P) $(DESTDIR)$(datadir)/locale/ && \
259                 echo "Installing template data files to $(datadir)/locale/" && \
260                 cp -r @srcdir@/data/locale/* $(datadir)/locale/ ;\
261         fi;
262         $(MKDIR_P) $(DESTDIR)$(datadir)/overdue/
263         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
264         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
265         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example'
266         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
267         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example'
268         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
269         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
270         sed -i 's|LIBDIR|@libdir@|g' '$(DESTDIR)@sysconfdir@/opensrf.xml.example'
271         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/marc_stream_importer.conf.example'
272         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/marc_stream_importer.conf.example'
273         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/autogen.sh'
274         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
275         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
276         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
277         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/clear_expired_circ_history.srfsh'
278         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/update_hard_due_dates.srfsh'
279         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/juv_to_adult.srfsh'
280         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
281         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
282         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
283         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/clear_cc_number.srfsh'
284         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/purge_at_events.srfsh'
285         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/purge_circulations.srfsh'
286         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/purge_holds.srfsh'
287         sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/purge_pending_users.srfsh'
288         sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
289         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/oils_ctl.sh'
290
291 reporter-install:
292         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/clark-kent.pl'
293         sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/find_orphaned_reports.pl'
294
295 docs-install: gen_docs
296         $(MKDIR_P) $(DESTDIR)$(docdir)