# ---------------------------------------------------------------------
# Author: Bill Erickson <erickson@esilibrary.com>
+# Author: Dan Scott <dscott@laurentian.ca>
#
# Makefile to install prerequisites for OpenSRF
#
-# Currently supports Debian (etch/lenny), Ubuntu (hardy/karmic), and Gentoo.
-# Working towards support of CentOS 5 / RHEL 5 and Fedora.
+# Currently supports Debian (jessie/wheezy), Ubuntu (trusty/xenial)
+# and Fedora (16).
+#
# Installs Perl prereqs, libjs with Perl wrapper
#
# usage:
-# make -f Makefile.install debian-etch
-# - or -
-# make -f Makefile.install debian-lenny
-# - or -
-# make -f Makefile.install ubuntu-hardy
+# make -f Makefile.install debian-stretch
# - or -
-# make -f Makefile.install ubuntu-karmic
+# make -f Makefile.install debian-jessie
# - or -
-# make -f Makefile.install centos
+# make -f Makefile.install debian-wheezy
# - or -
-# make -f Makefile.install rhel
+# make -f Makefile.install ubuntu-trusty
# - or -
-# make -f Makefile.install gentoo
+# make -f Makefile.install ubuntu-xenial
# - or -
-# make -f Makefile.install fedora13
-#
-# Notes:
-#
-# This makefile has been tested much more with Ubuntu and 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 -f Makefile.install fedora
#
# ---------------------------------------------------------------------
# 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
-
-# ejabberd is not packaged on CentOS/RHEL, so we have to
-# download the installable package from the source
-EJABBERD_VER=2.1.2
-EJABBERD_PKG=ejabberd-2.1.2-linux-x86_64-installer.bin
-EJABBERD_PKG_x64=ejabberd-2.1.2-linux-x86_64-installer.bin
-EJABBERD_HOST=http://www.process-one.net/downloads/ejabberd
-
-# Centos and Redhat will require the rpmforge repository mostly for memcache and perl modules
-RPMFORGE_PKG=rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
-RPMFORGE_HOST=http://packages.sw.be/rpmforge-release
-
-# need newer libtool, autoconf, and automake on centos
-AUTOCONF_HOST=http://ftp.gnu.org/gnu/autoconf
-AUTOCONF_PKG=autoconf-2.65
-LIBTOOL_HOST=http://ftp.gnu.org/gnu/libtool
-LIBTOOL_PKG=libtool-2.2.6b
-AUTOMAKE_HOST=http://ftp.gnu.org/gnu/automake
-AUTOMAKE_PKG=automake-1.11
-
-# libmemcached is only packaged on newer distros
-LIBMEMCACHED=libmemcached-0.35
-LIBMEMCACHED_HOST=http://download.tangent.org
-
-# XML::LibXSLT fails due to old libxslt
-XSLT=libxslt-1.1.22
-XSLT_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1
-
-# libxslt depends on a newer version of libxml2:
-XML2=libxml2-2.6.30
-XML2_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6
+# 64 or 32 bit os?
+LBITS=$(shell getconf LONG_BIT)
-APT_TOOL=aptitude -yq
+APT_TOOL=apt-get -yq
# Debian dependencies
DEBS = \
- apache2-mpm-prefork\
- apache2-prefork-dev\
autoconf\
automake\
build-essential\
+ check\
ejabberd\
less\
libapache2-mod-perl2\
liberror-perl\
libexpat1-dev\
libfile-find-rule-perl\
- libfreezethaw-perl\
libgcrypt11-dev \
libgdbm-dev \
liblog-log4perl-perl\
+ libmemcached-dev \
+ libmemcached-tools \
libmodule-build-perl\
- libnet-jabber-perl\
+ libnet-dns-perl\
libperl-dev\
- libreadline5-dev\
- librpc-xml-perl\
+ libreadline-dev\
libtemplate-perl\
libtest-pod-perl\
libtie-ixhash-perl\
libxml-simple-perl\
libxslt1-dev\
memcached\
- ntpdate\
pkg-config\
+ python-coverage\
psmisc\
python-dev\
python-libxml2\
- python-setuptools
-
-CENTOS = \
- apr-util-devel.x86_64 \
- autoconf \
- automake \
- gcc \
- gcc-c++ \
- gdbm-devel \
- httpd-devel \
- less \
- libmemcache-devel \
- libtool \
- libxml2-devel \
- libxslt-devel \
- make \
- memcached \
- mod_perl \
- mod_ssl \
- ncurses \
- ncurses-devel \
- ntp \
- perl-Cache-Memcached \
- perl-Class-DBI-AbstractSearch \
- perl-Class-DBI-SQLite \
- perl-DateTime \
- perl-DateTime-Format-ISO8601 \
- perl-DateTime-Format-Mail \
- perl-DateTime-Set \
- perl-DateTime-TimeZone \
- perl-DBI \
- perl-Email-Send \
- perl-Error \
- perl-File-Find-Rule \
- perl-FreezeThaw \
- perl-JSON-XS \
- perl-libwww-perl \
- perl-Log-Log4perl \
- perl-Memcached-libmemcached \
- perl-Module-Build \
- perl-Net-Jabber \
- perl-Net-Server \
- perl-RPC-XML \
- perl-Template-Toolkit \
- perl-Test-Pod \
- perl-Tie-IxHash \
- perl-UNIVERSAL-require \
- perl-Unix-Syslog \
- perl-XML-LibXML \
- perl-XML-LibXSLT \
- perl-XML-Parser \
- perl-XML-Simple \
- perl-XML-RPC \
- psmisc \
- python-devel \
+ python-memcache\
+ python-nose\
+ python-pyxmpp\
python-setuptools\
- readline-devel \
- wget
-
-CENTOS_PERL = \
+ python-simplejson\
+ tar\
+ zlib1g-dev
FEDORAS = \
autoconf \
automake \
+ check \
+ check-devel \
ejabberd \
expat-devel \
gcc \
libmemcached \
libmemcached-devel \
libtool \
+ libxml-libxml-perl \
+ libxml-libxslt-perl \
libxml2-devel \
libxml2-python \
libxslt-devel \
make \
memcached \
mod_perl \
- ntpdate \
perl-Cache-Memcached \
perl-Class-DBI \
+ perl-Class-DBI-AbstractSearch \
perl-Class-DBI-SQLite \
perl-DateTime-Format-Builder \
perl-DateTime-Format-ISO8601 \
perl-devel \
perl-Error \
perl-File-Find-Rule \
- perl-FreezeThaw \
perl-JSON-XS \
perl-libwww-perl \
perl-Log-Log4perl \
perl-Module-Build \
- perl-Net-Jabber \
+ perl-Net-DNS \
perl-Net-Server \
- perl-RPC-XML \
perl-SQL-Abstract-Limit \
perl-Template-Toolkit \
perl-Test-Deep \
perl-XML-Simple \
psmisc \
python-devel \
+ python-dns \
python-memcached \
python-setuptools \
- readline-devel
-
-FEDORA_CPAN = \
- Class::DBI::AbstractSearch
-
-GENTOOS = \
- vim\
- ntp\
- memcached\
- libmemcached\
- net-misc/telnet-bsd\
- app-portage/gentoolkit\
- gsasl\
- ejabberd\
- mod_perl\
- net-fs/nfs-utils\
- dev-libs/apr\
- dev-perl/Cache-Memcached\
- dev-perl/DBI\
- dev-perl/Log-Log4perl\
- 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\
- dev-perl/Tie-IxHash\
- dev-perl/FreezeThaw
-
-GENTOO_RC = \
- ejabberd\
- memcached\
- portmap
-
-GENTOO_PERL = \
- Class::DBI::AbstractSearch\
- UNIVERSAL::require
+ python-simplejson \
+ readline-devel \
+ tar
DEB_APACHE_MODS = \
ssl
libjson-xs-perl \
libnet-server-perl
-EXTRA_DEBS_UBUNTU_KARMIC = \
- libmemcached-dev\
- libxml-libxml-perl \
- libxml-libxslt-perl
+EXTRA_DEBS_WHEEZY = \
+ apache2-mpm-prefork \
+ apache2-prefork-dev \
+ libncurses5-dev
-# generic CPAN modules:
-# * DateTime::Format::ISO8601 is packaged by both Debian Lenny and Ubuntu Intrepid
-# * JSON::XS is packaged by both Debian Lenny and Ubuntu Intrepid
-# * libnet-server-perl 0.97 is packaged on Debian Lenny and Ubuntu Intrepid
-# - is there a specific need for 0.90?
-CPAN_MODULES = \
- DateTime::Format::ISO8601 \
- RHANDOM/Net-Server-0.90.tar.gz \
- JSON::XS
+EXTRA_DEBS_JESSIE = \
+ apache2-mpm-prefork \
+ apache2-prefork-dev \
+ libncurses5-dev
-# libxml-libxml-perl on Debian Lenny and Ubuntu Intrepid is 1.66, which
-# has broken namespace handling. so we still need to install these from
-# CPAN. *sigh*
-CPAN_MODULES_XML = \
- XML::LibXML \
- XML::LibXSLT
+EXTRA_DEBS_DEBIAN_STRETCH = \
+ apache2 \
+ apache2-dev \
+ libncurses5-dev
-# generic CPAN modules to force
-CPAN_MODULES_FORCE = \
- TMTM/Class-DBI-0.96.tar.gz
+EXTRA_DEBS_UBUNTU_TRUSTY = \
+ apache2-mpm-prefork \
+ apache2-prefork-dev \
+ ncurses-dev
+
+EXTRA_DEBS_UBUNTU_XENIAL = \
+ apache2 \
+ apache2-dev \
+ libncurses5-dev
# ----------------------------------------------------------------------------
@echo "please specify an OS" && exit 0
-centos: install_rpmforge install_centos_rpms install_ejabberd install_buildutils install_libmemcached install_libxml2 install_libxslt install_centos_perl create_ld_local
-
-debian-etch: generic_debian etch install_libmemcached
-debian-lenny: generic_debian lenny install_libmemcached
-etch: install_cpan
-lenny: install_extra_debs
-generic_debian: install_debs install_cpan_force install_cpan_xml debian_sys_config
-
-fedora13: install_fedora_rpms install_fedora_perl
-
-gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
-
-rhel: centos
+debian-stretch: generic_debian stretch apache_mpm_prefork_mods apache_perl_mod
+debian-jessie: generic_debian jessie apache_mpm_prefork_mods
+debian-wheezy: generic_debian wheezy
+stretch: install_extra_debs install_extra_debs_stretch debian_sys_config
+jessie: install_extra_debs_jessie debian_sys_config
+wheezy: install_extra_debs_wheezy debian_sys_config
+generic_debian: install_debs
-ubuntu-hardy: generic_ubuntu install_cpan_xml hardy
-ubuntu-karmic: generic_ubuntu karmic
-hardy: install_cpan install_libmemcached
-karmic: install_extra_debs install_extra_debs_karmic
-generic_ubuntu: install_debs install_cpan_force debian_sys_config
-
-# - COMMON TARGETS ---------------------------------------------------------
-
-# Install the CPAN modules
-install_cpan:
- for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
-
-# Install CPAN modules that need to be forced
-install_cpan_force:
- for m in $(CPAN_MODULES_FORCE); do perl -MCPAN -e "CPAN::Shell->force(qw#install $$m#);"; done
-
-# Install the CPAN XML modules
-install_cpan_xml:
- for m in $(CPAN_MODULES_XML); do perl -MCPAN -e "install \"$$m\";"; done
-
-# Install ejabberd from official project installer binary
-install_ejabberd:
- if [ ! -f $(EJABBERD_PKG).gz ]; then wget $(EJABBERD_HOST)/$(EJABBERD_VER)/$(EJABBERD_PKG).gz; fi;
- gunzip $(EJABBERD_PKG).gz
- chmod u+x $(EJABBERD_PKG)
- ./$(EJABBERD_PKG) --mode unattended --prefix /opt/ejabberd --adminpw opensrf
-
-# Install rpmforge for redhat and centos
-install_rpmforge:
- if [ ! -f $(RPMFORGE_PKG).gz ]; then wget $(RPMFORGE_HOST)/$(RPMFORGE_PKG); fi;
- rpm -Uvh --force ./$(RPMFORGE_PKG)
- yum update -y
-
-# Install automake, autoconf, and libtool
-install_buildutils:
- if [ ! -f $(LIBTOOL_PKG).tar.gz ]; then wget $(LIBTOOL_HOST)/$(LIBTOOL_PKG).tar.gz; fi;
- tar zxf $(LIBTOOL_PKG).tar.gz
- cd $(LIBTOOL_PKG) && ./configure --prefix=/usr && make && make install
-
- if [ ! -f $(AUTOCONF_PKG).tar.gz ]; then wget $(AUTOCONF_HOST)/$(AUTOCONF_PKG).tar.gz; fi;
- tar zxf $(AUTOCONF_PKG).tar.gz
- cd $(AUTOCONF_PKG) && ./configure --prefix=/usr && make && make install
-
- if [ ! -f $(AUTOMAKE_PKG).tar.gz ]; then wget $(AUTOMAKE_HOST)/$(AUTOMAKE_PKG).tar.gz; fi;
- tar zxf $(AUTOMAKE_PKG).tar.gz
- cd $(AUTOMAKE_PKG) && ./configure --prefix=/usr && make && make install
-
-# Install libmemcached from the official project source
-install_libmemcached:
- if [ ! -d $(LIBMEMCACHED).tar.gz ]; then wget $(LIBMEMCACHED_HOST)/$(LIBMEMCACHED).tar.gz; fi;
- tar xzf $(LIBMEMCACHED).tar.gz
- cd $(LIBMEMCACHED) && ./configure && make && make install
-
-# Install a newer version of libxslt
-install_libxslt:
- if [ ! -d $(XSLT) ]; then wget $(XSLT_HOST)/$(XSLT).tar.gz; fi;
- tar xzf $(XSLT).tar.gz
- cd $(XSLT) && ./configure --with-libxml-prefix=/usr/local && make && make install
-
-# Install a newer version of libxml2
-install_libxml2:
- if [ ! -d $(XML2) ]; then wget $(XML2_HOST)/$(XML2).tar.gz; fi;
- tar xzf $(XML2).tar.gz
- cd $(XML2) && ./configure && make && make install
-
-clean:
- make -C $(LIBJS_PERL) clean
- make -C $(XML2) clean
- make -C $(XSLT) clean
- make -f Makefile.ref -C js/src/ clean
+fedora: install_fedora_rpms
+ubuntu-trusty: generic_ubuntu trusty apache_mpm_prefork_mods
+ubuntu-xenial: generic_ubuntu xenial apache_mpm_prefork_mods apache_perl_mod
+trusty: install_extra_debs install_extra_debs_trusty debian_sys_config
+xenial: install_extra_debs install_extra_debs_xenial debian_sys_config
+generic_ubuntu: install_debs
# ------------------------------------------------------------------
# - DEBIAN ---------------------------------------------------------
# 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_TOOL) install $(DEBS)
install_extra_debs:
$(APT_TOOL) install $(EXTRA_DEBS)
-# Install even more packaged dependencies on modern distros
-install_extra_debs_karmic:
- $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_KARMIC)
+install_extra_debs_stretch:
+ $(APT_TOOL) install $(EXTRA_DEBS_DEBIAN_STRETCH)
-# ------------------------------------------------------------------
-# - GENTOO ---------------------------------------------------------
+install_extra_debs_jessie: install_extra_debs
+ $(APT_TOOL) install $(EXTRA_DEBS_JESSIE)
-install_gentoos:
- emerge -n $(GENTOOS)
+install_extra_debs_wheezy: install_extra_debs
+ $(APT_TOOL) install $(EXTRA_DEBS_WHEEZY)
-install_gentoo_rc:
- for m in $(GENTOO_RC); do rc-update add $$m default; done;
+# Install even more packaged dependencies on modern distros
+install_extra_debs_trusty:
+ $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_TRUSTY)
-install_gentoo_perl:
- for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
+install_extra_debs_xenial:
+ $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_XENIAL)
-# ------------------------------------------------------------------
+# Some OSes activate the Apache mpm_event module by default.
+# OpenSRF requires prefork.
+apache_mpm_prefork_mods:
+ a2dismod mpm_event
+ a2enmod mpm_prefork
+
+# Need to activate mod_perl on some O/S.
+apache_perl_mod:
+ a2enmod perl
# Fedora
install_fedora_rpms:
yum -y install $(FEDORAS)
-install_fedora_perl:
- for m in $(FEDORA_CPAN); do perl -MCPAN -e "install \"$$m\";"; done
-
-# CENTOS
-install_centos_rpms:
- yum -y install $(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
- for m in $(CENTOS_PERL_LOCAL); do LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib perl -MCPAN -e "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: