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 # ---------------------------------------------------------------------
31 # Make any assumptions about the shell being used explicit
35 # Gentoo needs explicit versions on many of these packages
36 # to simulate a "blessed" set of packages
37 # Also, I (think) Gentoo has a javascript::spidermonkey package that does
38 # not require fetching the sources externally ... needs testing/updating in here
41 LIBJS_PERL=JavaScript-SpiderMonkey-0.19
42 LIBJS_URL=ftp://ftp.mozilla.org/pub/mozilla.org/js/$(LIBJS).tar.gz
43 LIBJS_PERL_URL=ftp://mirror.datapipe.net/pub/CPAN/authors/id/T/TB/TBUSCH/$(LIBJS_PERL).tar.gz
44 # used for installing libjs lib and header files
45 JS_INSTALL_PREFIX=/usr/
48 # The libdbi sources can be fetched from sourceforge.net. They are stored on
49 # the open-ils.org site now for ease of direct linking
51 LIBDBI_DRIVERS=libdbi-drivers-0.8.3
52 LIBDBI_HOST=http://open-ils.org/~denials/evergreen
54 # Some people are firewalled out of indexdata.dk
56 YAZ_HOST=http://evergreen-ils.org/~denials/yaz
58 # ejabberd is not packaged on CentOS/RHEL, so we have to
59 # download the installable package from the source
61 EJABBERD_PKG=ejabberd-2.0.1_2-linux-x86-installer.bin
62 EJABBERD_HOST=http://www.process-one.net/downloads/ejabberd
64 # libmemcache is not packaged on CentOS/RHEL
65 LIBMEMCACHE=libmemcache-1.4.0.rc2
66 LIBMEMCACHE_HOST=http://people.freebsd.org/~seanc/libmemcache/
68 # Business::OnlinePayment is not packaged on CentOS/RHEL
69 PAY_ONLINE=Business-OnlinePayment-3.00_08.tar.gz
70 PAY_ONLINE_HOST=http://ftp.perl.org/pub/CPAN/authors/id/I/IV/IVAN/
73 # XML::LibXSLT fails due to old libxslt
75 XSLT_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1
77 # libxslt depends on a newer version of libxml2:
78 XML2=libxml2-2.6.30.tar.gz
79 XML2_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6
95 libbusiness-creditcard-perl\
96 libbusiness-onlinepayment-authorizenet-perl\
97 libbusiness-onlinepayment-perl\
98 libcache-memcached-perl\
99 libclass-dbi-abstractsearch-perl\
100 libclass-dbi-pg-perl\
101 libclass-dbi-sqlite-perl\
102 libdatetime-format-builder-perl\
103 libdatetime-format-mail-perl\
105 libdatetime-timezone-perl\
109 libfile-find-rule-perl\
112 liblog-log4perl-perl\
115 libmodule-build-perl\
117 libole-storage-lite-perl\
122 libspreadsheet-writeexcel-perl\
130 libuniversal-require-perl\
184 # Avoids a weak reference error that otherwise sinks DateTime:Format:ISO8601
185 CENTOS_PERL_FORCE = \
188 # Some of these packages have stupid bugs in their test suites
189 # that are simply too painful to workaround
190 CENTOS_PERL_NOTEST = \
191 Business::OnlinePayment::AuthorizeNet \
192 DateTime::Format::Strptime \
195 # This is a developer's version, but B:OP:AuthorizeNet depends on it
196 CENTOS_PERL_VERSION = \
197 IVAN/Business-OnlinePayment-3.00_08.tar.gz
199 CENTOS_PERL_LOCAL = \
203 Business::CreditCard \
205 Class::DBI::AbstractSearch \
210 DateTime::Format::Builder \
219 Spreadsheet::WriteExcel \
231 postgresql-client-8.1\
232 postgresql-contrib-8.1\
233 postgresql-plperl-8.1\
234 postgresql-server-dev-8.1
238 postgresql-client-8.2\
239 postgresql-contrib-8.2\
240 postgresql-plperl-8.2\
241 postgresql-server-dev-8.2
249 app-portage/gentoolkit\
260 dev-perl/Cache-Memcached\
262 dev-perl/DateTime-TimeZone\
266 dev-perl/Log-Log4perl\
267 dev-perl/Text-Aspell\
268 dev-perl/Unix-Syslog\
270 dev-perl/XML-LibXSLT\
273 dev-perl/libwww-perl\
274 dev-perl/Template-Toolkit\
276 dev-perl/Text-CSV_XS\
277 dev-perl/Spreadsheet-WriteExcel\
288 Class::DBI::AbstractSearch\
302 # generic CPAN modules
304 DateTime::Format::ISO8601 \
305 TMTM/Class-DBI-0.96.tar.gz \
306 RHANDOM/Net-Server-0.90.tar.gz \
307 MARC::Charset MARC::File::XML \
311 Business::CreditCard::Object \
312 XML::LibXML::XPathContext
315 # ----------------------------------------------------------------------------
318 @echo "please specify an OS" && exit 0
321 # these should be the same for any distro
322 install: install_yaz install_cpan install_js_sm install_libdbi
324 centos: install_centos_pgsql install_centos_rpms install_ejabberd install_libmemcache install install_libxml2 install_libxslt install_centos_perl create_ld_local
326 debian: install_pgsql_debian install_debs install debian_sys_config
328 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
332 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
335 # - COMMON TARGETS ---------------------------------------------------------
337 # Install the CPAN modules
339 for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
341 # Install ejabberd from official project installer binary
343 if [ ! -f $(EJABBERD_PKG).gz ]; then wget $(EJABBERD_HOST)/$(EJABBERD_VER)/$(EJABBERD_PKG).gz; fi;
344 gunzip $(EJABBERD_PKG).gz
345 chmod u+x $(EJABBERD_PKG).gz
346 ./$(EJABBERD_PKG) --mode unattended --prefix /opt/ejabberd --adminpw evergreen
348 # Install libmemcache from the official project source
350 if [ ! -d $(LIBMEMCACHE) ]; then wget $(LIBMEMCACHE_HOST)/$(LIBMEMCACHE).tar.bz2; fi;
351 tar xjf $(LIBMEMCACHE).tar.bz2
352 cd $(LIBMEMCACHE) && ./configure && make && make install
354 # Install a newer version of libxslt
356 if [ ! -d $(XSLT) ]; then wget $(XSLT_HOST)/$(XSLT).tar.gz; fi;
357 tar xzf $(XSLT).tar.gz
358 cd $(XSLT) && ./configure --with-libxml-prefix=/usr/local && make && make install
360 # Install a newer version of libxml2
362 if [ ! -d $(XML2) ]; then wget $(XML2_HOST)/$(XML2).tar.gz; fi;
363 tar xzf $(XML2).tar.gz
364 cd $(XML2) && ./configure && make && make install
366 # Install a known working version of YAZ
368 if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
369 tar xzf $(YAZ).tar.gz
370 cd $(YAZ) && ./configure && make && make install
372 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
374 if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
375 if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
376 tar -zxf $(LIBJS).tar.gz
377 tar -zxf $(LIBJS_PERL).tar.gz
378 cd js/src/ && make -f Makefile.ref
379 mkdir -p $(JS_INSTALL_PREFIX)/include/js/
380 cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
381 cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
382 cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
383 cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
384 cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
387 # Install libdbi and the postgres drivers
389 if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
390 if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
391 tar -zxf $(LIBDBI).tar.gz
392 tar -zxf $(LIBDBI_DRIVERS).tar.gz
393 cd $(LIBDBI) && ./configure --disable-docs && make all install
394 cd $(LIBDBI_DRIVERS) && ./configure \
395 --disable-docs --with-pgsql --enable-libdbi && make all install
399 make -C $(LIBDBI) clean
400 make -C $(LIBDBI_DRIVERS) clean
401 make -C $(LIBJS_PERL) clean
402 make -C $(XML2) clean
403 make -C $(XSLT) clean
404 make -f Makefile.ref -C js/src/ clean
407 # ------------------------------------------------------------------
408 # - DEBIAN ---------------------------------------------------------
411 # link the apache modules in
412 for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
414 # adds a placeholder module so apxs will be happy
415 if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
416 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
417 >> /etc/apache2/httpd.conf; \
420 # Install the debian-specific dependencies
422 $(APT_TOOL) install $(DEBS)
424 install_pgsql_debian:
425 $(APT_TOOL) install $(PGSQL_DEBIAN)
427 install_pgsql_ubuntu:
428 $(APT_TOOL) install $(PGSQL_UBUNTU)
430 # ------------------------------------------------------------------
431 # - GENTOO ---------------------------------------------------------
437 for m in $(GENTOO_RC); do rc-update add $$m default; done;
440 for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
442 # ------------------------------------------------------------------
447 yum -y install $(CENTOS)
449 install_centos_pgsql:
450 yum -y install $(PGSQL_CENTOS)
453 for m in $(CENTOS_PERL_FORCE); do perl -MCPAN -e "CPAN::Shell->force(qw/install $$m);"; done
454 for m in $(CENTOS_PERL); do perl -MCPAN -e "install \"$$m\";"; done
455 for m in $(CENTOS_PERL_VERSION); do perl -MCPAN -e "CPAN::Shell->install \"$$m\";"; done
456 for m in $(CENTOS_PERL_NOTEST); do perl -MCPAN -e "CPAN::Shell->notest('install', \"$$m\";"; done
457 for m in $(CENTOS_PERL_LOCAL); do LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib perl -MCPAN -e "install \"$$m\";"; done
459 # We need to add /usr/local/lib to the ldconfig list of directories on CentOS,
460 # if it is not already there
462 if [ "$$(ldconfig -v 2> /dev/null | grep '^/usr/local/lib' | wc -l)" -eq 0 ]; then \
463 echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf; \
467 # vim:noet:sw=4:ts=4: