]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/extras/Makefile.install
Update libdbi and libdbi-drivers to 0.8.3 to avoid recent compilation problems on...
[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     memcached\
57     libxml2-dev\
58     libmodule-build-perl\
59     libexpat1-dev\
60     libmemcache-dev\
61     libperl-dev\
62     libcache-memcached-perl\
63         libtext-csv-perl\
64     libxml-libxml-perl\
65     libxslt1-dev\
66     libxml-libxslt-perl\
67     libwww-perl\
68     liberror-perl\
69     libclass-dbi-pg-perl\
70     libclass-dbi-abstractsearch-perl\
71     libtemplate-perl\
72     libtext-aspell-perl\
73     libdatetime-timezone-perl\
74     libdatetime-perl\
75     libunix-syslog-perl\
76     libgd-graph3d-perl\
77     libuniversal-require-perl\
78     libclass-dbi-sqlite-perl\
79     liblog-log4perl-perl\
80     libnet-jabber-perl\
81     libtest-pod-perl\
82     libfile-find-rule-perl\
83     libdatetime-format-builder-perl\
84     libmarc-record-perl\
85     librpc-xml-perl\
86     aspell\
87     aspell-en\
88     libxml-simple-perl\
89     libpq-dev\
90     libemail-send-perl\
91     ejabberd\
92     libtool\
93     apache2-mpm-prefork\
94     apache2-prefork-dev\
95     libapache2-mod-perl2\
96     libreadline5-dev\
97         libtext-csv-perl\
98         libspreadsheet-writeexcel-perl\
99         libtie-ixhash-perl\
100         python-setuptools 
101
102 PGSQL_DEBIAN = \
103         postgresql-8.1\
104         postgresql-client-8.1\
105         postgresql-contrib-8.1\
106         postgresql-plperl-8.1\
107         postgresql-server-dev-8.1
108
109 PGSQL_UBUNTU = \
110         postgresql-8.2\
111         postgresql-client-8.2\
112         postgresql-contrib-8.2\
113         postgresql-plperl-8.2\
114         postgresql-server-dev-8.2
115
116 GENTOOS = \
117     vim\
118     ntp\
119     memcached\
120     libmemcache\
121     net-misc/telnet-bsd\
122     app-portage/gentoolkit\
123     gsasl\
124     ejabberd\
125     mod_perl\
126     yaz\
127     aspell-en\
128     net-fs/nfs-utils\
129     dev-libs/apr\
130     dev-db/libpq\
131     dev-db/postgresql\
132     dev-perl/Email-Send\
133     dev-perl/Cache-Memcached\
134     dev-perl/DateTime\
135     dev-perl/DateTime-TimeZone\
136     dev-perl/DBI\
137     dev-perl/DBD-Pg\
138     dev-perl/GD-Graph3d\
139     dev-perl/Log-Log4perl\
140     dev-perl/Text-Aspell\
141     dev-perl/Unix-Syslog\
142     dev-perl/XML-LibXML\
143     dev-perl/XML-LibXSLT\
144     dev-perl/XML-Simple\
145     dev-perl/Net-Jabber\
146     dev-perl/libwww-perl\
147     dev-perl/Template-Toolkit\
148     dev-perl/Error\
149     dev-perl/Text-CSV_XS\
150     dev-perl/Spreadsheet-WriteExcel\
151     dev-perl/Tie-IxHash
152
153 GENTOO_RC = \
154     ejabberd\
155     memcached\
156     portmap
157
158 GENTOO_PERL = \
159     UNIVERSAL::require\
160     Class::DBI::AbstractSearch\
161     MARC::Record \
162     Net::Z3950::ZOOM \
163     Text::CSV
164
165 DEB_APACHE_MODS = \
166     expires\
167     include\
168     proxy\
169     proxy_http\
170     rewrite\
171     ssl
172  
173
174 # generic CPAN modules
175 CPAN_MODULES = \
176     DateTime::Format::ISO8601 \
177     TMTM/Class-DBI-0.96.tar.gz \
178     RHANDOM/Net-Server-0.90.tar.gz \
179     MARC::Charset MARC::File::XML\
180     Net::Z3950::ZOOM
181
182
183 # ----------------------------------------------------------------------------
184
185 all: 
186         @echo "please specify an OS" && exit 0
187
188
189 # these should be the same for any distro
190 install: install_yaz install_cpan install_js_sm install_libdbi 
191
192 debian: install_pgsql_debian install_debs install debian_sys_config
193
194 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
195
196 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
197
198
199 # - COMMON TARGETS ---------------------------------------------------------
200
201 # Install the CPAN modules
202 install_cpan: 
203         for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
204
205
206 install_yaz:    
207         if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
208         tar xzf $(YAZ).tar.gz
209         cd $(YAZ) && ./configure && make && make install
210
211 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
212 install_js_sm: 
213         if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
214         if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
215         tar -zxf $(LIBJS).tar.gz
216         tar -zxf $(LIBJS_PERL).tar.gz
217         cd js/src/ && make -f Makefile.ref
218         mkdir -p $(JS_INSTALL_PREFIX)/include/js/
219         cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
220         cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
221         cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
222         cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
223         cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
224
225
226 # Install libdbi and the postgres drivers
227 install_libdbi:
228         if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
229         if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
230         tar -zxf $(LIBDBI).tar.gz
231         tar -zxf $(LIBDBI_DRIVERS).tar.gz
232         cd $(LIBDBI) && ./configure --disable-docs && make all install
233         cd $(LIBDBI_DRIVERS) && ./configure  \
234                 --disable-docs --with-pgsql --enable-libdbi && make all install  
235
236
237 clean:
238         make -C $(LIBDBI) clean
239         make -C $(LIBDBI_DRIVERS) clean
240         make -C $(LIBJS_PERL) clean
241         make -f Makefile.ref -C js/src/ clean
242
243
244 # ------------------------------------------------------------------
245 # - DEBIAN ---------------------------------------------------------
246
247 debian_sys_config: 
248         # link the apache modules in
249         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
250         
251         # adds a placeholder module so apxs will be happy
252         if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
253                 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
254                         >> /etc/apache2/httpd.conf; \
255         fi;
256
257 # Install the debian-specific dependencies
258 install_debs:
259         apt-get install $(DEBS)
260
261 install_pgsql_debian:
262         apt-get install $(PGSQL_DEBIAN)
263
264 install_pgsql_ubuntu:
265         apt-get install $(PGSQL_UBUNTU)
266
267 # ------------------------------------------------------------------
268 # - GENTOO ---------------------------------------------------------
269
270 install_gentoos:
271         emerge -n $(GENTOOS)
272
273 install_gentoo_rc:
274         for m in $(GENTOO_RC); do rc-update add $$m default; done;
275
276 install_gentoo_perl:
277         for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
278
279 # ------------------------------------------------------------------
280     
281
282