added install config info for the penalty scripts
[Evergreen.git] / Open-ILS / src / Makefile
1
2 export TMPDIR                   = $(TMP)/opensrf
3 export LDFLAGS                  = -L $(TMPDIR) -L .
4 export CFLAGS                   = -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) \
5                                                                 -I$(LIBXML2_HEADERS)/libxml  -I$(TMP) -I$(TMPDIR)
6
7 export INCDIR = "$(INCLUDEDIR)/openils/"
8
9 export STAFF_CLIENT_BUILD_ID = `/bin/cat ../xul/staff_client/build/BUILD_ID`
10
11 all: mod_ils_rest_gateway c_apps client-xul mod_xmlent
12
13 install:        perl-install web-install server-xul string-templates-install storage-bootstrap cgi-bootstrap xsl-install c_apps-install circ_rules-install offline-install
14
15 web-install:    webcore-install autojs-install mod_ils_rest_gateway-install  mod_xmlent-install offline-install
16
17 circ_rules-install:
18         @echo $@
19         mkdir -p $(CIRCRULESDIR)
20         mkdir -p $(PENALTYRULESDIR)
21         cp javascript/backend/circ/*.js $(CIRCRULESDIR)
22         cp javascript/backend/penalty/*.js $(PENALTYRULESDIR)
23
24
25 # -----------------------------------------------------------------------------------
26 # Web stuff
27 # -----------------------------------------------------------------------------------
28 mod_ils_rest_gateway:
29         @echo $@
30         make -C apachemods mod_ils_rest_gateway.so
31
32 mod_ils_rest_gateway-install:
33         @echo $@
34         make -C apachemods libfieldmapper-install
35         make -C apachemods mod_ils_rest_gateway-install
36
37 mod_xmlent:
38         @echo $@
39         make -C apachemods mod_xmlent.so
40
41 oils_cgi:
42         @echo $@
43         make -C apachemods oils_cgi.so
44
45 oils_cgi-install:
46         @echo $@
47         make -C apachemods oils_cgi-install
48
49 mod_xmlent-install:
50         @echo $@
51         make -C apachemods mod_xmlent-install
52
53
54 client-xul:
55         @echo $@
56         @echo "Building staff client"
57         make -C ../xul/staff_client 
58
59 server-xul:
60         @echo $@
61         mkdir -p ${WEBDIR}
62         @echo "Creating ${WEBDIR}/xul/"
63         mkdir -p ${WEBDIR}/xul/
64         @echo "BUILD_ID = ${STAFF_CLIENT_BUILD_ID}"
65         @echo "Copying xul into ${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
66         mkdir -p "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}"
67         cp -R ../xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/"
68
69 webcore-install:
70         @echo $@
71         echo "Copying web into $(WEBDIR)"
72         mkdir -p $(WEBDIR)
73         cp -r ../web/* $(WEBDIR)
74         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
75         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
76         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
77         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/advanced.xml
78         ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/myopac.xml
79
80 libfieldmapper: 
81         make -C apachemods libfieldmapper.so
82
83 libfieldmapper-install: 
84         make -C apachemods libfieldmapper-install
85
86 c_apps: libfieldmapper
87         @echo $@
88         make -C c-apps
89         make -C extras oils_requestor
90
91 c_apps-install: libfieldmapper-install
92         @echo $@
93         make -C c-apps install
94         make -C extras oils_requestor-install
95
96 autojs-install:
97         @echo $@
98         cp extras/fieldmapper.pl $(BINDIR)
99         cp extras/org_tree_js.pl $(BINDIR)
100         cp extras/autogen.sh $(BINDIR)
101 # -----------------------------------------------------------------------------------
102
103 marcdumper:
104         @echo $@
105         make -C extras/marcdumper
106
107 marcdumper-install:
108         @echo $@
109         make -C extras/marcdumper install
110
111 # -----------------------------------------------------------------------------------
112
113 perl-install:
114         @echo $@
115         @echo "Installing Perl modules to $(PERLDIR)"
116         mkdir -p $(PERLDIR)
117         mkdir -p $(DATADIR)
118         cp extras/ils_events.xml $(DATADIR)
119         cp -r perlmods/* $(PERLDIR)
120         cp ../examples/openils.xml.example $(ETCDIR)
121         mkdir -p $(TEMPLATEDIR)
122         cp -r templates/marc $(TEMPLATEDIR)
123
124 # -----------------------------------------------------------------------------------
125
126 reporter-install:
127         @echo $@
128         @echo "Installing Reporter templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
129         cp reporter/report_base.example.xml $(ETCDIR)/reporter.example.xml
130         cp reporter/tables.example.xml $(ETCDIR)
131         cp reporter/widgets.example.xml $(ETCDIR)
132         mkdir -p $(REPORTERDIR)
133         cp -r reporter/templates/* $(REPORTERDIR)
134
135 # -----------------------------------------------------------------------------------
136 offline-install:
137         @echo "Installing offline CGIs to $(CGIDIR)/offline";
138         mkdir -p $(CGIDIR)/offline;
139         perl -pe "s{##CONFIG##}{$(ETCDIR)}" < offline/offline.pl > $(TMP)/offline.pl;
140         cp offline/offline-config.pl $(ETCDIR)
141         cp $(TMP)/offline.pl $(CGIDIR)/offline/
142         chmod +x $(CGIDIR)/offline/offline.pl
143
144 # -----------------------------------------------------------------------------------
145
146 cgi-bootstrap:
147         @echo "Installing cgi's to $(CGIDIR)"
148         mkdir -p $(TMP)/cgi-bin
149         mkdir -p $(CGIDIR)
150         for i in cgi-bin/*cgi; do perl -pe "s{##CONFIG##}{$(ETCDIR)}" < $$i > $(TMP)/$$i; done
151         cp $(TMP)/cgi-bin/*cgi $(CGIDIR)
152         cp -r cgi-bin/support $(CGIDIR)
153         cp cgi-bin/setup.pl $(ETCDIR)/live-db-setup.pl
154
155 storage-bootstrap:
156         @echo $@
157         @echo ""
158         @echo "WARNING!"
159         @echo ""
160         @echo "storage-bootstrap will DESTROY all data within all of the ILS tables in your database."
161         @echo "Type control-c to avoid destroying all of the data.  Type enter to continue..."
162         @echo ""
163         @read X;
164         ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBNAME) $(DBUSER) $(DBPW)
165
166 # -----------------------------------------------------------------------------------
167
168
169 string-templates-install:
170         @echo "Installing string templates to $(TEMPLATEDIR)"
171         mkdir -p $(TEMPLATEDIR)
172         cp -r templates/strings $(TEMPLATEDIR)
173
174 xsl-install:    
175         @echo "Installing XSL files to $(XSLDIR)"
176         mkdir -p $(XSLDIR)
177         cp ../xsl/*.xsl $(XSLDIR)
178
179 clean:
180         @echo $@
181         make -C extras clean
182         make -C apachemods clean
183         make -C c-apps clean
184