]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/extras/Makefile.install
added missing backslash. Thanks, Don
[working/Evergreen.git] / Open-ILS / src / extras / Makefile.install
1 # ---------------------------------------------------------------------
2 # Author: Bill Erickson <erickson@esilibrary.com>
3 #
4 # Makefile to install prerequisites for OpenSRF and Evergreen
5 #
6 # Currently supports Debian (etch), Ubuntu (gutsy) and Gentoo.  Installs Perl prereqs, 
7 # libjs with Perl wrapper, libdbi, libdbi-drivers, and libyaz
8 #
9 # usage:
10 #       make -f Makefile.install debian
11 #       - or -
12 #       make -f Makefile.install ubuntu
13 #       - or -
14 #       make -f Makefile.install gentoo
15 #
16 # Notes:
17 #
18 #       This makefile has been tested much more with Debian than Gentoo.
19 #
20 #       Gentoo (especially amd64) requires a good bit of masked package
21 #       mangling for some packages.  These are not documented here because
22 #       they will continue to evolve
23 #
24 # ---------------------------------------------------------------------
25  
26 # XXX
27 # Gentoo needs explicit versions on many of these packages
28 # to simulate a "blessed" set of packages
29 # Also, I (think) Gentoo has a javascript::spidermonkey package that does
30 # not require fetching the sources externally ... needs testing/updating in here
31
32  
33 LIBJS=js-1.7.0
34 LIBJS_PERL=JavaScript-SpiderMonkey-0.19
35 LIBJS_URL=ftp://ftp.mozilla.org/pub/mozilla.org/js/$(LIBJS).tar.gz
36 LIBJS_PERL_URL=ftp://mirror.datapipe.net/pub/CPAN/authors/id/T/TB/TBUSCH/$(LIBJS_PERL).tar.gz
37 # used for installing libjs lib and header files
38 JS_INSTALL_PREFIX=/usr/
39
40
41 # The libdbi sources can be fetched from sourceforge.net.  They are stored on
42 # the open-ils.org site now for ease of direct linking
43 LIBDBI=libdbi-0.8.3
44 LIBDBI_DRIVERS=libdbi-drivers-0.8.3
45 LIBDBI_HOST=http://open-ils.org/~denials/evergreen
46
47 YAZ=yaz-2.1.56
48 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
49
50 # Debian dependencies
51 DEBS =  \
52         build-essential\
53         syslog-ng\
54         psmisc\
55         ntpdate\
56         less\
57     memcached\
58     libxml2-dev\
59     libmodule-build-perl\
60     libexpat1-dev\
61     libmemcache-dev\
62     libperl-dev\
63     libcache-memcached-perl\
64         libtext-csv-perl\
65     libxml-libxml-perl\
66     libxslt1-dev\
67     libxml-libxslt-perl\
68     libwww-perl\
69     liberror-perl\
70     libclass-dbi-pg-perl\
71     libclass-dbi-abstractsearch-perl\
72     libtemplate-perl\
73     libtext-aspell-perl\
74     libdatetime-timezone-perl\
75     libdatetime-perl\
76     libunix-syslog-perl\
77     libgd-graph3d-perl\
78     libuniversal-require-perl\
79     libclass-dbi-sqlite-perl\
80     liblog-log4perl-perl\
81     libnet-jabber-perl\
82     libtest-pod-perl\
83     libfile-find-rule-perl\
84     libdatetime-format-builder-perl\
85     libmarc-record-perl\
86     librpc-xml-perl\
87     aspell\
88     aspell-en\
89     libxml-simple-perl\
90     libpq-dev\
91     libemail-send-perl\
92     ejabberd\
93     libtool\
94     apache2-mpm-prefork\
95     apache2-prefork-dev\
96     libapache2-mod-perl2\
97     libreadline5-dev\
98         libtext-csv-perl\
99         libspreadsheet-writeexcel-perl\
100         libole-storage-lite-perl\
101         libtie-ixhash-perl\
102         python-dev\
103         python-setuptools\
104         libfreezethaw-perl\
105         libbusiness-creditcard-perl\
106         libbusiness-onlinepayment-perl\
107         libbusiness-onlinepayment-authorizenet-perl
108
109
110 PGSQL_DEBIAN = \
111         postgresql-8.1\
112         postgresql-client-8.1\
113         postgresql-contrib-8.1\
114         postgresql-plperl-8.1\
115         postgresql-server-dev-8.1
116
117 PGSQL_UBUNTU = \
118         postgresql-8.2\
119         postgresql-client-8.2\
120         postgresql-contrib-8.2\
121         postgresql-plperl-8.2\
122         postgresql-server-dev-8.2
123
124 GENTOOS = \
125     vim\
126     ntp\
127     memcached\
128     libmemcache\
129     net-misc/telnet-bsd\
130     app-portage/gentoolkit\
131     gsasl\
132     ejabberd\
133     mod_perl\
134     yaz\
135     aspell-en\
136     net-fs/nfs-utils\
137     dev-libs/apr\
138     dev-db/libpq\
139     dev-db/postgresql\
140     dev-perl/Email-Send\
141     dev-perl/Cache-Memcached\
142     dev-perl/DateTime\
143     dev-perl/DateTime-TimeZone\
144     dev-perl/DBI\
145     dev-perl/DBD-Pg\
146     dev-perl/GD-Graph3d\
147     dev-perl/Log-Log4perl\
148     dev-perl/Text-Aspell\
149     dev-perl/Unix-Syslog\
150     dev-perl/XML-LibXML\
151     dev-perl/XML-LibXSLT\
152     dev-perl/XML-Simple\
153     dev-perl/Net-Jabber\
154     dev-perl/libwww-perl\
155     dev-perl/Template-Toolkit\
156     dev-perl/Error\
157     dev-perl/Text-CSV_XS\
158     dev-perl/Spreadsheet-WriteExcel\
159     dev-perl/Tie-IxHash\
160         dev-perl/FreezeThaw
161
162 GENTOO_RC = \
163     ejabberd\
164     memcached\
165     portmap
166
167 GENTOO_PERL = \
168     UNIVERSAL::require\
169     Class::DBI::AbstractSearch\
170     MARC::Record \
171     Net::Z3950::ZOOM \
172     Text::CSV
173
174 DEB_APACHE_MODS = \
175     expires\
176     include\
177     proxy\
178     proxy_http\
179     rewrite\
180     ssl
181  
182
183 # generic CPAN modules
184 CPAN_MODULES = \
185     DateTime::Format::ISO8601 \
186     TMTM/Class-DBI-0.96.tar.gz \
187     RHANDOM/Net-Server-0.90.tar.gz \
188     MARC::Charset MARC::File::XML\
189     JSON::XS\
190     SRU \
191     Net::Z3950::ZOOM \
192         Business::CreditCard::Object \
193         XML::LibXML::XPathContext
194
195
196 # ----------------------------------------------------------------------------
197
198 all: 
199         @echo "please specify an OS" && exit 0
200
201
202 # these should be the same for any distro
203 install: install_yaz install_cpan install_js_sm install_libdbi 
204
205 debian: install_pgsql_debian install_debs install debian_sys_config
206
207 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
208
209 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
210
211
212 # - COMMON TARGETS ---------------------------------------------------------
213
214 # Install the CPAN modules
215 install_cpan: 
216         for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
217
218
219 install_yaz:    
220         if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
221         tar xzf $(YAZ).tar.gz
222         cd $(YAZ) && ./configure && make && make install
223
224 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
225 install_js_sm: 
226         if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
227         if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
228         tar -zxf $(LIBJS).tar.gz
229         tar -zxf $(LIBJS_PERL).tar.gz
230         cd js/src/ && make -f Makefile.ref
231         mkdir -p $(JS_INSTALL_PREFIX)/include/js/
232         cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
233         cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
234         cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
235         cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
236         cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
237
238
239 # Install libdbi and the postgres drivers
240 install_libdbi:
241         if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
242         if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
243         tar -zxf $(LIBDBI).tar.gz
244         tar -zxf $(LIBDBI_DRIVERS).tar.gz
245         cd $(LIBDBI) && ./configure --disable-docs && make all install
246         cd $(LIBDBI_DRIVERS) && ./configure  \
247                 --disable-docs --with-pgsql --enable-libdbi && make all install  
248
249
250 clean:
251         make -C $(LIBDBI) clean
252         make -C $(LIBDBI_DRIVERS) clean
253         make -C $(LIBJS_PERL) clean
254         make -f Makefile.ref -C js/src/ clean
255
256
257 # ------------------------------------------------------------------
258 # - DEBIAN ---------------------------------------------------------
259
260 debian_sys_config: 
261         # link the apache modules in
262         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
263         
264         # adds a placeholder module so apxs will be happy
265         if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
266                 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
267                         >> /etc/apache2/httpd.conf; \
268         fi;
269
270 # Install the debian-specific dependencies
271 install_debs:
272         apt-get install $(DEBS)
273
274 install_pgsql_debian:
275         apt-get install $(PGSQL_DEBIAN)
276
277 install_pgsql_ubuntu:
278         apt-get install $(PGSQL_UBUNTU)
279
280 # ------------------------------------------------------------------
281 # - GENTOO ---------------------------------------------------------
282
283 install_gentoos:
284         emerge -n $(GENTOOS)
285
286 install_gentoo_rc:
287         for m in $(GENTOO_RC); do rc-update add $$m default; done;
288
289 install_gentoo_perl:
290         for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
291
292 # ------------------------------------------------------------------
293     
294