# --------------------------------------------------------------------- # Author: Bill Erickson # # Makefile to install prerequisites for OpenSRF and Evergreen # # Currently supports Debian (etch), Ubuntu (gutsy/hardy), and Gentoo. # Working towards support of CentOS 5 / RHEL 5. # Installs Perl prereqs, libjs with Perl wrapper, libdbi, libdbi-drivers, and libyaz # # usage: # make -f Makefile.install debian # - or - # make -f Makefile.install ubuntu # - or - # make -f Makefile.install centos # - or - # make -f Makefile.install rhel # - or - # make -f Makefile.install gentoo # # Notes: # # This makefile has been tested much more with Debian than CentOS, Gentoo, or RHEL. # # 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 # # --------------------------------------------------------------------- # Make any assumptions about the shell being used explicit SHELL=/bin/bash # XXX # Gentoo needs explicit versions on many of these packages # to simulate a "blessed" set of packages # Also, I (think) Gentoo has a javascript::spidermonkey package that does # not require fetching the sources externally ... needs testing/updating in here LIBJS=js-1.7.0 LIBJS_PERL=JavaScript-SpiderMonkey-0.19 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/ # The libdbi sources can be fetched from sourceforge.net. They are stored on # the open-ils.org site now for ease of direct linking LIBDBI=libdbi-0.8.3 LIBDBI_DRIVERS=libdbi-drivers-0.8.3 LIBDBI_HOST=http://open-ils.org/~denials/evergreen # We need a recent version of Yaz # Debian Lenny and Ubuntu 8.10 come with 3.0.34 YAZ=yaz-3.0.38 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz # Business::OnlinePayment is not packaged on CentOS/RHEL PAY_ONLINE=Business-OnlinePayment-3.00_08.tar.gz PAY_ONLINE_HOST=http://ftp.perl.org/pub/CPAN/authors/id/I/IV/IVAN/ APT_TOOL=aptitude # Debian dependencies DEBS = \ aspell\ aspell-en\ libbusiness-creditcard-perl\ libbusiness-onlinepayment-authorizenet-perl\ libbusiness-onlinepayment-perl\ libclass-dbi-pg-perl\ libdatetime-format-builder-perl\ libdatetime-format-mail-perl\ libdatetime-perl\ libdatetime-timezone-perl\ libemail-send-perl\ libgd-graph3d-perl\ libmarc-record-perl\ libole-storage-lite-perl\ libpq-dev\ libspreadsheet-writeexcel-perl\ libtext-aspell-perl\ libtext-csv-perl\ libtext-csv-perl CENTOS = \ aspell \ aspell-devel \ aspell-en \ gd-devel \ perl-DBD-Pg PGSQL_CENTOS = \ postgresql \ postgresql-contrib \ postgresql-devel \ postgresql-pl \ postgresql-server # Avoids a weak reference error that otherwise sinks DateTime:Format:ISO8601 CENTOS_PERL_FORCE = \ Scalar::Util # Some of these packages have stupid bugs in their test suites # that are simply too painful to workaround CENTOS_PERL_NOTEST = \ Business::OnlinePayment::AuthorizeNet \ DateTime::Format::Strptime # This is a developer's version, but B:OP:AuthorizeNet depends on it CENTOS_PERL_VERSION = \ IVAN/Business-OnlinePayment-3.00_08.tar.gz CENTOS_PERL = \ Business::CreditCard \ Class::DBI::Pg \ DateTime \ DateTime::TimeZone \ DateTime::Format::Builder \ GD::Graph3d \ MARC::Record \ Net::Z3950::ZOOM \ Spreadsheet::WriteExcel \ Text::Aspell \ Text::CSV PGSQL_DEBIAN = \ postgresql-8.1\ postgresql-client-8.1\ postgresql-contrib-8.1\ postgresql-plperl-8.1\ postgresql-server-dev-8.1 PGSQL_UBUNTU = \ postgresql-8.2\ postgresql-client-8.2\ postgresql-contrib-8.2\ postgresql-plperl-8.2\ postgresql-server-dev-8.2 GENTOOS = \ yaz\ aspell-en\ dev-db/libpq\ dev-db/postgresql\ dev-perl/Email-Send\ dev-perl/DateTime\ dev-perl/DateTime-TimeZone\ dev-perl/DBD-Pg\ dev-perl/GD-Graph3d\ dev-perl/Text-Aspell\ dev-perl/Template-Toolkit\ dev-perl/Text-CSV_XS\ dev-perl/Spreadsheet-WriteExcel GENTOO_PERL = \ MARC::Record \ Net::Z3950::ZOOM \ Text::CSV DEB_APACHE_MODS = \ expires\ include\ proxy\ proxy_http\ rewrite\ ssl # generic CPAN modules CPAN_MODULES = \ Business::CreditCard::Object \ MARC::Charset MARC::File::XML \ Net::Z3950::ZOOM \ SRU # ---------------------------------------------------------------------------- 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 centos: install_centos_pgsql install_centos_rpms install install_centos_perl create_ld_local debian: install_pgsql_debian install_debs install debian_sys_config gentoo: install_gentoos install_gentoo_perl install rhel: centos ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config # - COMMON TARGETS --------------------------------------------------------- # Install the CPAN modules install_cpan: for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done # Install a known working version of YAZ 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 $(LIBJS_PERL) && 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; # Install the debian-specific dependencies install_debs: $(APT_TOOL) install $(DEBS) install_pgsql_debian: $(APT_TOOL) install $(PGSQL_DEBIAN) install_pgsql_ubuntu: $(APT_TOOL) install $(PGSQL_UBUNTU) # ------------------------------------------------------------------ # - GENTOO --------------------------------------------------------- install_gentoos: emerge -n $(GENTOOS) install_gentoo_perl: for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done # ------------------------------------------------------------------ # CENTOS install_centos_rpms: yum -y install $(CENTOS) install_centos_pgsql: yum -y install $(PGSQL_CENTOS) install_centos_perl: for m in $(CENTOS_PERL_FORCE); do perl -MCPAN -e "CPAN::Shell->force(qw#install $$m#);"; done for m in $(CENTOS_PERL); do perl -MCPAN -e "install \"$$m\";"; done for m in $(CENTOS_PERL_VERSION); do perl -MCPAN -e "CPAN::Shell->install \"$$m\";"; done for m in $(CENTOS_PERL_NOTEST); do perl -MCPAN -e "CPAN::Shell->notest('install', \"$$m\";"; done # We need to add /usr/local/lib to the ldconfig list of directories on CentOS, # if it is not already there create_ld_local: if [ "$$(ldconfig -v 2> /dev/null | grep '^/usr/local/lib' | wc -l)" -eq 0 ]; then \ echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf; \ ldconfig; \ fi; # vim:noet:sw=4:ts=4: