# ---------------------------------------------------------------------
# Author: Bill Erickson <erickson@esilibrary.com>
+# Author: Dan Scott <dscott@laurentian.ca>
#
# Makefile to install prerequisites for OpenSRF
#
-# Currently supports Debian (etch/lenny), Ubuntu (gutsy/hardy/intrepid), and Gentoo.
-# Working towards support of CentOS 5 / RHEL 5.
+# 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-gutsy
+# make -f Makefile.install debian-stretch
# - or -
-# make -f Makefile.install ubuntu-hardy
+# make -f Makefile.install debian-jessie
# - or -
-# make -f Makefile.install ubuntu-intrepid
+# make -f Makefile.install debian-wheezy
# - or -
-# make -f Makefile.install centos
+# make -f Makefile.install ubuntu-trusty
# - or -
-# make -f Makefile.install rhel
+# make -f Makefile.install ubuntu-xenial
# - or -
-# make -f Makefile.install gentoo
-#
-# 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
+# 64 or 32 bit os?
+LBITS=$(shell getconf LONG_BIT)
-# ejabberd is not packaged on CentOS/RHEL, so we have to
-# download the installable package from the source
-EJABBERD_VER=2.0.2
-EJABBERD_PKG=ejabberd-2.0.2_2-linux-x86-installer.bin
-EJABBERD_PKG_x64=ejabberd-2.0.2_2-linux-x86_64-installer.bin
-EJABBERD_HOST=http://www.process-one.net/downloads/ejabberd
-
-# libmemcache is not packaged on CentOS/RHEL
-LIBMEMCACHE=libmemcache-1.4.0.rc2
-LIBMEMCACHE_HOST=http://people.freebsd.org/~seanc/libmemcache/
-
-# 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
-
-APT_TOOL=aptitude
+APT_TOOL=apt-get -yq
# Debian dependencies
DEBS = \
- apache2-mpm-prefork\
- apache2-prefork-dev\
autoconf\
automake\
build-essential\
+ check\
ejabberd\
less\
libapache2-mod-perl2\
libcache-memcached-perl\
libclass-dbi-abstractsearch-perl\
libclass-dbi-sqlite-perl\
+ libdatetime-format-builder-perl\
+ libdatetime-format-mail-perl\
+ libdatetime-perl\
+ libdatetime-timezone-perl\
liberror-perl\
libexpat1-dev\
libfile-find-rule-perl\
- libfreezethaw-perl\
libgcrypt11-dev \
libgdbm-dev \
liblog-log4perl-perl\
- libmemcache-dev\
+ 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
+ python-memcache\
+ python-nose\
+ python-pyxmpp\
+ python-setuptools\
+ python-simplejson\
+ tar\
+ zlib1g-dev
-CENTOS = \
- apr-util-devel \
+FEDORAS = \
autoconf \
automake \
+ check \
+ check-devel \
+ ejabberd \
+ expat-devel \
gcc \
gdbm-devel \
+ httpd \
httpd-devel \
less \
+ libgcrypt-devel \
+ libmemcached \
+ libmemcached-devel \
libtool \
+ libxml-libxml-perl \
+ libxml-libxslt-perl \
libxml2-devel \
+ libxml2-python \
libxslt-devel \
make \
+ memcached \
mod_perl \
- mod_ssl \
- ncurses \
- ncurses-devel \
- ntp \
- perl-DBI \
+ perl-Cache-Memcached \
+ perl-Class-DBI \
+ perl-Class-DBI-AbstractSearch \
+ perl-Class-DBI-SQLite \
+ perl-DateTime-Format-Builder \
+ perl-DateTime-Format-ISO8601 \
+ perl-DateTime-Format-Mail \
+ perl-DateTime-Set \
+ perl-devel \
+ perl-Error \
+ perl-File-Find-Rule \
+ perl-JSON-XS \
+ perl-libwww-perl \
+ perl-Log-Log4perl \
+ perl-Module-Build \
+ perl-Net-DNS \
+ perl-Net-Server \
+ perl-SQL-Abstract-Limit \
+ perl-Template-Toolkit \
+ perl-Test-Deep \
+ perl-Test-Exception \
+ perl-Test-Pod \
+ perl-Tie-IxHash \
+ perl-UNIVERSAL-require \
+ perl-Unix-Syslog \
perl-XML-LibXML \
+ perl-XML-LibXSLT \
perl-XML-Simple \
- perl-libwww-perl \
psmisc \
python-devel \
- python-setuptools\
+ python-dns \
+ python-memcached \
+ python-setuptools \
+ python-simplejson \
readline-devel \
- wget
-
-# Some of these packages have stupid bugs in their test suites
-# that are simply too painful to workaround
-CENTOS_PERL_NOTEST = \
- RPC::XML
-
-CENTOS_PERL_LOCAL = \
- XML-LibXSLT
-
-CENTOS_PERL = \
- Cache::Memcached \
- Class::DBI::AbstractSearch \
- Class::DBI::SQLite \
- Error \
- File::Find::Rule \
- FreezeThaw \
- Log::Log4perl \
- Net::Jabber \
- Template \
- Test::Pod \
- Tie::IxHash \
- Unix::Syslog \
- UNIVERSAL::require \
- XML::LibXSLT
-
-GENTOOS = \
- vim\
- ntp\
- memcached\
- libmemcache\
- 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
+ tar
DEB_APACHE_MODS = \
ssl
libjson-xs-perl \
libnet-server-perl
-# 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_WHEEZY = \
+ apache2-mpm-prefork \
+ apache2-prefork-dev \
+ libncurses5-dev
+
+EXTRA_DEBS_JESSIE = \
+ apache2-mpm-prefork \
+ apache2-prefork-dev \
+ libncurses5-dev
+
+EXTRA_DEBS_DEBIAN_STRETCH = \
+ apache2 \
+ apache2-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_UBUNTU_TRUSTY = \
+ apache2-mpm-prefork \
+ apache2-prefork-dev \
+ ncurses-dev
-# generic CPAN modules to force
-CPAN_MODULES_FORCE = \
- TMTM/Class-DBI-0.96.tar.gz
+EXTRA_DEBS_UBUNTU_XENIAL = \
+ apache2 \
+ apache2-dev \
+ libncurses5-dev
# ----------------------------------------------------------------------------
@echo "please specify an OS" && exit 0
-centos: install_centos_rpms install_ejabberd install_libmemcache install_libxml2 install_libxslt install_centos_perl create_ld_local
-
-debian-etch: generic_debian etch
-debian-lenny: generic_debian lenny
-etch: install_cpan
-lenny: install_extra_debs
-generic_debian: install_debs install_cpan_force install_cpan_xml debian_sys_config
-
-gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
-
-rhel: centos
-
-ubuntu-gutsy: generic_ubuntu hardy
-ubuntu-hardy: generic_ubuntu hardy
-ubuntu-intrepid: generic_ubuntu intrepid
-hardy: install_cpan
-intrepid: install_extra_debs
-generic_ubuntu: generic_debian
-
-# - COMMON TARGETS ---------------------------------------------------------
+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
-# 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 libmemcache from the official project source
-install_libmemcache:
- if [ ! -d $(LIBMEMCACHE) ]; then wget $(LIBMEMCACHE_HOST)/$(LIBMEMCACHE).tar.bz2; fi;
- tar xjf $(LIBMEMCACHE).tar.bz2
- cd $(LIBMEMCACHE) && ./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)
-# ------------------------------------------------------------------
-# - GENTOO ---------------------------------------------------------
+install_extra_debs_stretch:
+ $(APT_TOOL) install $(EXTRA_DEBS_DEBIAN_STRETCH)
-install_gentoos:
- emerge -n $(GENTOOS)
+install_extra_debs_jessie: install_extra_debs
+ $(APT_TOOL) install $(EXTRA_DEBS_JESSIE)
-install_gentoo_rc:
- for m in $(GENTOO_RC); do rc-update add $$m default; done;
+install_extra_debs_wheezy: install_extra_debs
+ $(APT_TOOL) install $(EXTRA_DEBS_WHEEZY)
-install_gentoo_perl:
- for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
+# Install even more packaged dependencies on modern distros
+install_extra_debs_trusty:
+ $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_TRUSTY)
-# ------------------------------------------------------------------
+install_extra_debs_xenial:
+ $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_XENIAL)
-# CENTOS
-install_centos_rpms:
- yum -y install $(CENTOS)
+# Some OSes activate the Apache mpm_event module by default.
+# OpenSRF requires prefork.
+apache_mpm_prefork_mods:
+ a2dismod mpm_event
+ a2enmod mpm_prefork
-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
+# Need to activate mod_perl on some O/S.
+apache_perl_mod:
+ a2enmod perl
-# 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;
+# Fedora
+install_fedora_rpms:
+ yum -y install $(FEDORAS)
# vim:noet:sw=4:ts=4: