From: erickson Date: Wed, 10 Oct 2007 21:33:14 +0000 (+0000) Subject: adding a sample prereq installation makefile for debian and gentoo. The gentoo porti... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9a48ecba24681a2f980e79fce5c8b377c328c0a5;p=Evergreen.git adding a sample prereq installation makefile for debian and gentoo. The gentoo portions probably need some love... git-svn-id: svn://svn.open-ils.org/ILS/trunk@7876 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install new file mode 100644 index 0000000000..ae5e21e677 --- /dev/null +++ b/Open-ILS/src/extras/Makefile.install @@ -0,0 +1,246 @@ +# --------------------------------------------------------------------- +# Author: Bill Erickson +# +# Makefile to install prerequisites for OpenSRF and Evergreen +# +# Currently supports Debian (etch) and Gentoo. Installs Perl prereqs, +# libjs with Perl wrapper, libdbi, libdbi-drivers, and libyaz +# +# usage: +# make -f Makefile.install debian +# - or - +# make -f Makefile.install gentoo +# +# Notes: +# +# This makefile has been tested much more with Debian than Gentoo. +# +# Gentoo (especially amd64) requires a good bit of masked package +# mangling for some packages. These are not documented here because +# they will continue to evolve +# +# --------------------------------------------------------------------- + + + +LIBJS=js-1.60 +LIBJS_PERL=JavaScript-SpiderMonkey-0.17 +LIBJS_URL=ftp://ftp.mozilla.org/pub/mozilla.org/js/$(LIBJS).tar.gz +LIBJS_PERL_URL=ftp://mirror.datapipe.net/pub/CPAN/authors/id/T/TB/TBUSCH/$(LIBJS_PERL).tar.gz +# used for installing libjs lib and header files +JS_INSTALL_PREFIX=/usr/ + +LIBDBI=libdbi-0.8.2 +LIBDBI_DRIVERS=libdbi-drivers-0.8.2-1 +LIBDBI_HOST=http://open-ils.org/~erickson/evergreen + +YAZ=yaz-2.1.56 +YAZ_HOST=http://ftp.indexdata.dk/pub/yaz + +# Debian dependencies +DEBS = \ + build-essential\ + syslog-ng\ + psmisc\ + ntpdate\ + memcached\ + postgresql-client\ + libxml2-dev\ + libmodule-build-perl\ + libexpat1-dev\ + libmemcache-dev\ + libperl-dev\ + libcache-memcached-perl\ + libtext-csv-perl\ + libxml-libxml-perl\ + libxslt1-dev\ + libxml-libxslt-perl\ + libwww-perl\ + liberror-perl\ + libclass-dbi-pg-perl\ + libclass-dbi-abstractsearch-perl\ + libtemplate-perl\ + libtext-aspell-perl\ + libdatetime-timezone-perl\ + libdatetime-perl\ + libunix-syslog-perl\ + libgd-graph3d-perl\ + libuniversal-require-perl\ + libclass-dbi-sqlite-perl\ + liblog-log4perl-perl\ + libnet-jabber-perl\ + libtest-pod-perl\ + libfile-find-rule-perl\ + libdatetime-format-builder-perl\ + libmarc-record-perl\ + librpc-xml-perl\ + aspell\ + aspell-en\ + libxml-simple-perl\ + libpq-dev\ + libemail-send-perl\ + ejabberd\ + libtool\ + apache2-mpm-prefork\ + apache2-prefork-dev\ + libapache2-mod-perl2\ + libreadline5-dev + +GENTOOS = \ + vim\ + ntp\ + memcached\ + libmemcache\ + net-misc/telnet-bsd\ + app-portage/gentoolkit\ + gsasl\ + ejabberd\ + mod_perl\ + yaz\ + aspell-en\ + net-fs/nfs-utils\ + dev-libs/apr\ + dev-db/libpq\ + dev-db/postgresql\ + dev-perl/Email-Send\ + dev-perl/Cache-Memcached\ + dev-perl/DateTime\ + dev-perl/DateTime-TimeZone\ + dev-perl/DBI\ + dev-perl/DBD-Pg\ + dev-perl/GD-Graph3d\ + dev-perl/Log-Log4perl\ + dev-perl/Text-Aspell\ + dev-perl/Unix-Syslog\ + dev-perl/XML-LibXML\ + dev-perl/XML-LibXSLT\ + dev-perl/XML-Simple\ + dev-perl/Net-Jabber\ + dev-perl/libwww-perl\ + dev-perl/Template-Toolkit\ + dev-perl/Error + +GENTOO_RC = \ + ejabberd\ + memcached\ + portmap + +GENTOO_PERL = \ + UNIVERSAL::require\ + Class::DBI::AbstractSearch\ + MARC::Record \ + Net::Z3950::ZOOM \ + Text::CSV + +DEB_APACHE_MODS = \ + expires\ + include\ + proxy\ + proxy_http\ + rewrite\ + ssl + + +# generic CPAN modules +CPAN_MODULES = \ + DateTime::Format::ISO8601 \ + TMTM/Class-DBI-0.96.tar.gz \ + RHANDOM/Net-Server-0.90.tar.gz \ + MARC::Charset MARC::File::XML\ + Net::Z3950::ZOOM + + +# ---------------------------------------------------------------------------- + +all: + @echo "please specify an OS" && exit 0 + + +# these should be the same for any distro +install: install_yaz install_cpan install_js_sm install_libdbi + +debian: install_debs install debian_sys_config + +gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install + + +# - COMMON TARGETS --------------------------------------------------------- + +# Install the CPAN modules +install_cpan: + for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done + + +install_yaz: + if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi; + tar xzf $(YAZ).tar.gz + cd $(YAZ) && ./configure && make && make install + +# Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules +install_js_sm: + if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi; + if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi; + tar -zxf $(LIBJS).tar.gz + tar -zxf $(LIBJS_PERL).tar.gz + cd js/src/ && make -f Makefile.ref + mkdir -p $(JS_INSTALL_PREFIX)/include/js/ + cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/ + cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/ + cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/ + cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/ + cd JavaScript-SpiderMonkey-0.17 && perl Makefile.PL -E4X && make && make test && make install + + +# Install libdbi and the postgres drivers +install_libdbi: + if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi; + if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi; + tar -zxf $(LIBDBI).tar.gz + tar -zxf $(LIBDBI_DRIVERS).tar.gz + cd $(LIBDBI) && ./configure --disable-docs && make all install + cd $(LIBDBI_DRIVERS) && ./configure \ + --disable-docs --with-pgsql --enable-libdbi && make all install + + +clean: + make -C $(LIBDBI) clean + make -C $(LIBDBI_DRIVERS) clean + make -C $(LIBJS_PERL) clean + make -f Makefile.ref -C js/src/ clean + + +# ------------------------------------------------------------------ +# - DEBIAN --------------------------------------------------------- + +debian_sys_config: + # link the apache modules in + for m in $(DEB_APACHE_MODS); do a2enmod $$m; done; + + # adds a placeholder module so apxs will be happy + if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \ + echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \ + >> /etc/apache2/httpd.conf; \ + fi; + +# Install the debian-specific dependencies +install_debs: + apt-get install $(DEBS) + + + +# ------------------------------------------------------------------ +# - GENTOO --------------------------------------------------------- + +install_gentoos: + emerge -n $(GENTOOS) + +install_gentoo_rc: + for m in $(GENTOO_RC); do rc-update add $$m default; done; + +install_gentoo_perl: + for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done + +# ------------------------------------------------------------------ + + +