# --------------------------------------------------------------------- # Author: Bill Erickson # # Makefile to install prerequisites for OpenSRF and Evergreen # # Currently supports Debian (etch/lenny), Ubuntu (hardy/karmic), and Gentoo. # Working towards support of CentOS 5 / RHEL 5 / Fedora 13. # Installs Perl prereqs, libjs with Perl wrapper, libdbi, libdbi-drivers, and libyaz # # usage: # make -f Makefile.install debian-etch # - or - # make -f Makefile.install debian-lenny # - or - # make -f Makefile.install ubuntu-hardy # - or - # make -f Makefile.install ubuntu-karmic # - or - # make -f Makefile.install fedora-13 # - 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 and Ubuntu than # Fedora, 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.20 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.47 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 -yq # 64 or 32 bit os? LBITS=$(shell getconf LONG_BIT) # Fedora 64-bit? FEDORA_64=$(shell uname -r | grep "fc[0-9][0-9].x86_64") #RHEL/Centos PGSQL PGSQL_HOST=http://yum.pgsqlrpms.org/reporpms/8.4 PGSQL_CENTOS=pgdg-centos-8.4-2.noarch.rpm PGSQL_REDHAT=pgdg-redhat-8.4-2.noarch.rpm # Debian dependencies DEBS = \ apache2-prefork-dev\ aspell\ aspell-en\ libbusiness-creditcard-perl\ libbusiness-onlinepayment-authorizenet-perl\ libbusiness-onlinepayment-perl\ libclass-dbi-pg-perl\ libdatetime-format-builder-perl\ libdatetime-format-iso8601-perl\ libdatetime-format-mail-perl\ libdatetime-perl\ libdatetime-timezone-perl\ libdatetime-set-perl\ libemail-send-perl\ libgd-graph3d-perl\ liblog-log4perl-perl\ libmarc-record-perl\ libncurses5-dev\ libnet-server-perl\ libole-storage-lite-perl\ libpq-dev\ libreadline5-dev\ libspreadsheet-writeexcel-perl\ libssh2-1-dev\ libtext-aspell-perl\ libtext-csv-perl\ libuniversal-require-perl\ libunix-syslog-perl # Debian Lenny and Ubuntu Intrepid bundle recent versions of yaz EXTRA_DEBS = \ libmarc-charset-perl \ libmarc-xml-perl \ libnet-z3950-zoom-perl \ libyaz-dev \ yaz # Ubuntu Hardy and Debian Etch require libencode-perl # to get a version of Encode > 2.12 - see bug 525069. # Note that the Debian version of libencode-perl comes # from etch-backports. EXTRA_ENCODE = \ libencode-perl CENTOS = \ aspell \ aspell-devel \ aspell-en \ gd-devel \ libssh2-devel \ openssl-devel \ perl-Business-CreditCard \ perl-Business-OnlinePayment \ perl-Class-Data-Inheritable \ perl-DateTime-Format-Builder \ perl-DateTime-Format-Strptime \ perl-Ima-DBI \ perl-DBD-Pg \ perl-GD-Graph3d \ perl-IO-stringy \ perl-Spreadsheet-WriteExcel \ perl-Text-Aspell \ perl-Text-CSV CENTOS_PERL = \ Class::DBI \ Class::DBI::Pg \ Encode \ DBIx::ContextualFetch \ Getopt::Long \ Net::SSH2 \ Net::uFTP \ Net::XMPP \ Net::Z3950::ZOOM FEDORA_13_RPMS = \ aspell \ aspell-en \ js-devel \ libdbi \ libdbi-dbd-pgsql \ libdbi-devel \ libssh2-devel \ libyaz \ libyaz-devel \ ncurses-devel \ ncurses-libs \ perl-Business-CreditCard \ perl-Class-DBI-Pg \ perl-Email-Send \ perl-GDGraph3d \ perl-MARC-Record \ perl-Net-SSH2 \ perl-OLE-Storage_Lite \ perl-Spreadsheet-WriteExcel \ perl-Text-Aspell \ perl-Text-CSV \ perl-Text-CSV_XS \ perl-XML-Writer \ postgresql-devel \ readline-devel \ tcp_wrappers-devel \ yaz # Note: B:O:AuthorizeNet 3.21 fails with https://rt.cpan.org/Public/Bug/Display.html?id=55172 # Should be fixed in 3.22 FEDORA_13_CPAN = \ Business::OnlinePayment \ Business::OnlinePayment::AuthorizeNet PGSQL_84_RPMS = \ postgresql-8.4* \ postgresql-contrib-8.4* \ postgresql-devel-8.4* \ postgresql-plpe*-8.4* \ postgresql-server-8.4* PGSQL_CLIENT_DEBS_81 = \ postgresql-client-8.1 PGSQL_SERVER_DEBS_81 = \ postgresql-8.1 \ postgresql-contrib-8.1 \ postgresql-plperl-8.1 \ postgresql-server-dev-8.1 PGSQL_CLIENT_DEBS_82 = \ postgresql-client PGSQL_SERVER_DEBS_82 = \ postgresql \ postgresql-contrib-8.2 \ postgresql-plperl-8.2 \ postgresql-server-dev-8.2 PGSQL_CLIENT_DEBS_83 = \ postgresql-client PGSQL_SERVER_DEBS_83 = \ postgresql \ postgresql-contrib-8.3 \ postgresql-plperl-8.3 \ postgresql-server-dev-8.3 PGSQL_CLIENT_DEBS_84 = \ postgresql-client PGSQL_SERVER_DEBS_84 = \ postgresql \ postgresql-contrib-8.4 \ postgresql-plperl-8.4 \ postgresql-server-dev-8.4 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 DEB_APACHE_DISMODS = \ deflate # Chronically unpackaged CPAN modules CPAN_MODULES = \ Business::CreditCard::Object \ Business::EDI \ Net::uFTP \ Net::Z3950::Simple2ZOOM \ UUID::Tiny \ SRU # Are we sure most distros don't come with an acceptable version of Safe.pm? CPAN_MODULES_SAFE = \ Safe # Recent Debian/Ubuntus have libmarc-charset-perl, libmarc-xml-perl, libnet-z3950-zoom-perl CPAN_MODULES_MARC = \ 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_cpan install_js_sm install_libdbi centos: install_centos_pgsql install_centos_rpms install_yaz install_cpan_marc install install_centos_perl create_ld_local install_cpan_safe rhel: install_redhat_pgsql install_centos_rpms install_yaz install_cpan_marc install install_centos_perl create_ld_local install_cpan_safe fedora-13: install_fedora_13_rpms install_cpan install_cpan_marc install_cpan_fedora install_spidermonkey debian-etch: etch generic_debian debian-lenny: lenny generic_debian etch: install_pgsql_client_debs_81 install_yaz install_cpan_marc install_extra_encode lenny: install_pgsql_client_debs_83 install_extra_debs generic_debian: install_debs install debian_sys_config install_cpan_safe gentoo: install_gentoos install_gentoo_perl install ubuntu-hardy: hardy generic_ubuntu ubuntu-karmic: karmic generic_ubuntu hardy: install_pgsql_client_debs_82 install_yaz install_cpan_marc install_extra_encode karmic: install_pgsql_client_debs_84 install_extra_debs generic_ubuntu: install_debs install debian_sys_config install_cpan_safe # - COMMON TARGETS --------------------------------------------------------- # Install the CPAN modules install_cpan: for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done # Install the CPAN modules for MARC functionality install_cpan_marc: for m in $(CPAN_MODULES_MARC); do perl -MCPAN -e "install \"$$m\";"; done # Install the Safe Perl module # Is this really unpackaged everywhere except for Fedora? install_cpan_safe: for m in $(CPAN_MODULES_SAFE); do perl -MCPAN -e "install \"$$m\";"; done # Install the CPAN modules for Fedora 13 install_cpan_fedora: for m in $(FEDORA_13_CPAN); 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 && ldconfig # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules install_js_sm: install_libjs install_spidermonkey install_libjs: if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi; tar -zxf $(LIBJS).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/ install_spidermonkey: if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi; tar -zxf $(LIBJS_PERL).tar.gz if [ ! -z $(FEDORA_64) ]; then \ sed -i -e 's/"\/usr\/lib"/"\/usr\/lib64"/' $(LIBJS_PERL)/Makefile.PL ; \ sed -i -e 's/js32.dll/libjs.so/' $(LIBJS_PERL)/Makefile.PL ; \ fi; cd $(LIBJS_PERL) && perl Makefile.PL -E4X -JS_THREADSAFE && 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; # keep the bad apache modules away for m in $(DEB_APACHE_DISMODS); do a2dismod $$m; done; # refresh the dynamic library cache ldconfig # Install the debian-specific dependencies install_debs: $(APT_TOOL) install $(DEBS) install_pgsql_client_debs_84: $(APT_TOOL) install $(PGSQL_CLIENT_DEBS_84) install_pgsql_server_debs_84: LANG=C $(APT_TOOL) install $(PGSQL_SERVER_DEBS_84) install_pgsql_client_debs_83: $(APT_TOOL) install $(PGSQL_CLIENT_DEBS_83) install_pgsql_server_debs_83: LANG=C $(APT_TOOL) install $(PGSQL_SERVER_DEBS_83) install_pgsql_client_debs_82: $(APT_TOOL) install $(PGSQL_CLIENT_DEBS_82) install_pgsql_server_debs_82: LANG=C $(APT_TOOL) install $(PGSQL_SERVER_DEBS_82) # Etch requires an explicit version to avoid PostgreSQL 7.4 install_pgsql_client_debs_81: $(APT_TOOL) install $(PGSQL_CLIENT_DEBS_81) # Etch requires an explicit version to avoid PostgreSQL 7.4 install_pgsql_server_debs_81: LANG=C $(APT_TOOL) install $(PGSQL_SERVER_DEBS_81) # Install the debian-specific dependencies for more modern distros install_extra_debs: $(APT_TOOL) install $(EXTRA_DEBS) # Install specific modules required by Ubuntu Hardy and # Debian Etch - see bug 525069 install_extra_encode: $(APT_TOOL) install $(EXTRA_ENCODE) # ------------------------------------------------------------------ # - GENTOO --------------------------------------------------------- install_gentoos: emerge -n $(GENTOOS) install_gentoo_perl: for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done # ------------------------------------------------------------------ # FEDORA 13 install_fedora_13_rpms: yum -y update yum -y install $(FEDORA_13_RPMS) install_fedora_13_pgsql_server: yum -y install $(PGSQL_84_RPMS) # CENTOS install_centos_rpms: yum -y install $(CENTOS) yum -y update if [ $(LBITS) -eq 64 ]; then \ ln -sf /usr/lib64/libpq.* /usr/lib/ && \ ln -sf /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so /usr/lib/ && \ ldconfig ; \ fi; if [ $(LBITS) -eq 32 ]; then \ ln -sf /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so /usr/lib && \ ldconfig ; \ fi; install_centos_pgsql: if [ $(LBITS) -eq 64 ]; then yum remove -y postgresql-libs-8.1*i386 apr-util-devel-*i386 ; fi; wget $(PGSQL_HOST)/$(PGSQL_CENTOS) rpm -Uvh --force ./$(PGSQL_CENTOS) yum update -y yum -y install $(PGSQL_84_RPMS) install_redhat_pgsql: if [ $(LBITS) -eq 64 ]; then yum remove -y postgresql-libs-8.1*i386 apr-util-devel-*i386 ; fi; wget $(PGSQL_HOST)/$(PGSQL_REDHAT) rpm -Uvh --force ./$(PGSQL_REDHAT) yum update -y yum -y install $(PGSQL_84_RPMS) install_centos_perl: for m in $(CENTOS_PERL); do perl -MCPAN -e "install \"$$m\";"; done echo "force install Business::OnlinePayment::AuthorizeNet" | perl -MCPAN -e shell echo "force install Scalar::Util" | perl -MCPAN -e shell # 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: