1 # ---------------------------------------------------------------------
2 # Author: Bill Erickson <erickson@esilibrary.com>
4 # Makefile to install prerequisites for OpenSRF and Evergreen
6 # Currently supports Debian (etch), Ubuntu (gutsy), and Gentoo.
7 # Working towards support of CentOS 5 / RHEL 5.
8 # Installs Perl prereqs, libjs with Perl wrapper, libdbi, libdbi-drivers, and libyaz
11 # make -f Makefile.install debian
13 # make -f Makefile.install ubuntu
15 # make -f Makefile.install centos
17 # make -f Makefile.install rhel
19 # make -f Makefile.install gentoo
23 # This makefile has been tested much more with Debian than CentOS, Gentoo, or RHEL.
25 # Gentoo (especially amd64) requires a good bit of masked package
26 # mangling for some packages. These are not documented here because
27 # they will continue to evolve
29 # ---------------------------------------------------------------------
32 # Gentoo needs explicit versions on many of these packages
33 # to simulate a "blessed" set of packages
34 # Also, I (think) Gentoo has a javascript::spidermonkey package that does
35 # not require fetching the sources externally ... needs testing/updating in here
39 LIBJS_PERL=JavaScript-SpiderMonkey-0.19
40 LIBJS_URL=ftp://ftp.mozilla.org/pub/mozilla.org/js/$(LIBJS).tar.gz
41 LIBJS_PERL_URL=ftp://mirror.datapipe.net/pub/CPAN/authors/id/T/TB/TBUSCH/$(LIBJS_PERL).tar.gz
42 # used for installing libjs lib and header files
43 JS_INSTALL_PREFIX=/usr/
46 # The libdbi sources can be fetched from sourceforge.net. They are stored on
47 # the open-ils.org site now for ease of direct linking
49 LIBDBI_DRIVERS=libdbi-drivers-0.8.3
50 LIBDBI_HOST=http://open-ils.org/~denials/evergreen
53 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
55 # ejabberd is not packaged on CentOS/RHEL, so we have to
56 # download the installable package from the source
58 EJABBERD_PKG=ejabberd-2.0.1_2-linux-x86-installer.bin
59 EJABBERD_HOST=http://www.process-one.net/downloads/ejabberd
61 # Business::OnlinePayment is not packaged on CentOS/RHEL
62 PAY_ONLINE=Business-OnlinePayment-3.00_08.tar.gz
63 PAY_ONLINE_HOST=http://ftp.perl.org/pub/CPAN/authors/id/I/IV/IVAN/
66 # XML::LibXSLT fails due to old libxslt
68 XSLT_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1
70 # libxslt depends on a newer version of libxml2:
71 XML2=libxml2-2.6.30.tar.gz
72 XML2_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6
89 libcache-memcached-perl\
97 libclass-dbi-abstractsearch-perl\
100 libdatetime-timezone-perl\
104 libuniversal-require-perl\
105 libclass-dbi-sqlite-perl\
106 liblog-log4perl-perl\
109 libfile-find-rule-perl\
110 libdatetime-format-builder-perl\
122 libapache2-mod-perl2\
125 libspreadsheet-writeexcel-perl\
126 libole-storage-lite-perl\
131 libbusiness-creditcard-perl\
132 libbusiness-onlinepayment-perl\
133 libbusiness-onlinepayment-authorizenet-perl
171 # Some of these packages have stupid bugs in their test suites
172 # that are simply too painful to workaround
173 CENTOS_PERL_NOTEST = \
174 Business::OnlinePayment::AuthorizeNet \
175 DateTime::Format::Strptime \
178 CENTOS_PERL_VERSION = \
179 # This is a developer's version, but B:OP:AuthorizeNet depends on it
180 IVAN/Business-OnlinePayment-3.00_08.tar.gz
182 CENTOS_PERL_LOCAL = \
186 Business::CreditCard \
188 Class::DBI::AbstractSearch \
193 DateTime::Format::Builder \
202 Spreadsheet::WriteExcel \
214 postgresql-client-8.1\
215 postgresql-contrib-8.1\
216 postgresql-plperl-8.1\
217 postgresql-server-dev-8.1
221 postgresql-client-8.2\
222 postgresql-contrib-8.2\
223 postgresql-plperl-8.2\
224 postgresql-server-dev-8.2
232 app-portage/gentoolkit\
243 dev-perl/Cache-Memcached\
245 dev-perl/DateTime-TimeZone\
249 dev-perl/Log-Log4perl\
250 dev-perl/Text-Aspell\
251 dev-perl/Unix-Syslog\
253 dev-perl/XML-LibXSLT\
256 dev-perl/libwww-perl\
257 dev-perl/Template-Toolkit\
259 dev-perl/Text-CSV_XS\
260 dev-perl/Spreadsheet-WriteExcel\
271 Class::DBI::AbstractSearch\
285 # generic CPAN modules
287 DateTime::Format::ISO8601 \
288 TMTM/Class-DBI-0.96.tar.gz \
289 RHANDOM/Net-Server-0.90.tar.gz \
290 MARC::Charset MARC::File::XML \
294 Business::CreditCard::Object \
295 XML::LibXML::XPathContext
298 # ----------------------------------------------------------------------------
301 @echo "please specify an OS" && exit 0
304 # these should be the same for any distro
305 install: install_yaz install_cpan install_js_sm install_libdbi
307 centos: install_centos_pgsql install_centos_rpms install_ejabberd install install_libxml2 install_libxslt install_centos_perl
308 debian: install_pgsql_debian install_debs install debian_sys_config
310 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
314 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
317 # - COMMON TARGETS ---------------------------------------------------------
319 # Install the CPAN modules
321 for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
323 # Install ejabberd from official project installer binary
325 if [ ! -f $(EJABBERD_PKG).gz ]; then wget $(EJABBERD_HOST)/$(EJABBERD_VER)/$(EJABBERD_PKG).gz; fi;
326 gunzip $(EJABBERD_PKG).gz
327 chmod u+x $(EJABBERD_PKG).gz
328 ./$(EJABBERD_PKG) --mode unattended --prefix /opt/ejabberd --adminpw evergreen
330 # Install a newer version of libxslt
332 if [ ! -d $(XSLT) ]; then wget $(XSLT_HOST)/$(XSLT).tar.gz; fi;
333 tar xzf $(XSLT).tar.gz
334 cd $(XSLT) && ./configure --with-libxml-prefix=/usr/local && make && make install
336 # Install a newer version of libxml2
338 if [ ! -d $(XML2) ]; then wget $(XML2_HOST)/$(XML2).tar.gz; fi;
339 tar xzf $(XML2).tar.gz
340 cd $(XML2) && ./configure && make && make install
342 # Install a known working version of YAZ
344 if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
345 tar xzf $(YAZ).tar.gz
346 cd $(YAZ) && ./configure && make && make install
348 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
350 if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
351 if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
352 tar -zxf $(LIBJS).tar.gz
353 tar -zxf $(LIBJS_PERL).tar.gz
354 cd js/src/ && make -f Makefile.ref
355 mkdir -p $(JS_INSTALL_PREFIX)/include/js/
356 cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
357 cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
358 cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
359 cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
360 cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
363 # Install libdbi and the postgres drivers
365 if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
366 if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
367 tar -zxf $(LIBDBI).tar.gz
368 tar -zxf $(LIBDBI_DRIVERS).tar.gz
369 cd $(LIBDBI) && ./configure --disable-docs && make all install
370 cd $(LIBDBI_DRIVERS) && ./configure \
371 --disable-docs --with-pgsql --enable-libdbi && make all install
375 make -C $(LIBDBI) clean
376 make -C $(LIBDBI_DRIVERS) clean
377 make -C $(LIBJS_PERL) clean
378 make -C $(XML2) clean
379 make -C $(XSLT) clean
380 make -f Makefile.ref -C js/src/ clean
383 # ------------------------------------------------------------------
384 # - DEBIAN ---------------------------------------------------------
387 # link the apache modules in
388 for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
390 # adds a placeholder module so apxs will be happy
391 if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
392 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
393 >> /etc/apache2/httpd.conf; \
396 # Install the debian-specific dependencies
398 $(APT_TOOL) install $(DEBS)
400 install_pgsql_debian:
401 $(APT_TOOL) install $(PGSQL_DEBIAN)
403 install_pgsql_ubuntu:
404 $(APT_TOOL) install $(PGSQL_UBUNTU)
406 # ------------------------------------------------------------------
407 # - GENTOO ---------------------------------------------------------
413 for m in $(GENTOO_RC); do rc-update add $$m default; done;
416 for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
418 # ------------------------------------------------------------------
423 yum -y install $(CENTOS)
425 install_centos_pgsql:
426 yum -y install $(PGSQL_CENTOS)
429 for m in $(CENTOS_PERL); do perl -MCPAN -e "install \"$$m\";"; done
430 for m in $(CENTOS_PERL_VERSION); do perl -MCPAN -e "CPAN::Shell->install \"$$m\";"; done
431 for m in $(CENTOS_PERL_NOTEST); do perl -MCPAN -e "CPAN::Shell->notest('install', \"$$m\";"; done
432 for m in $(CENTOS_PERL_LOCAL); do LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib perl -MCPAN -e "install \"$$m\";"; done