[Opensrf-commits] r1482 - branches/rel_1_0/src/extras
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Oct 26 23:26:24 EDT 2008
Author: dbs
Date: 2008-10-26 23:26:17 -0400 (Sun, 26 Oct 2008)
New Revision: 1482
Added:
branches/rel_1_0/src/extras/Makefile.install
Log:
Merge 1481 from trunk (add prerequisite installer for OpensSRF)
Copied: branches/rel_1_0/src/extras/Makefile.install (from rev 1481, trunk/src/extras/Makefile.install)
===================================================================
--- branches/rel_1_0/src/extras/Makefile.install (rev 0)
+++ branches/rel_1_0/src/extras/Makefile.install 2008-10-27 03:26:17 UTC (rev 1482)
@@ -0,0 +1,315 @@
+# ---------------------------------------------------------------------
+# Author: Bill Erickson <erickson at esilibrary.com>
+#
+# Makefile to install prerequisites for OpenSRF
+#
+# Currently supports Debian (etch), Ubuntu (gutsy), and Gentoo.
+# Working towards support of CentOS 5 / RHEL 5.
+# Installs Perl prereqs, libjs with Perl wrapper
+#
+# 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 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 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.0.1
+EJABBERD_PKG=ejabberd-2.0.1_2-linux-x86-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.tar.gz
+XML2_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6
+
+APT_TOOL=aptitude
+
+# Debian dependencies
+DEBS = \
+ apache2-mpm-prefork\
+ apache2-prefork-dev\
+ autoconf\
+ automake\
+ build-essential\
+ ejabberd\
+ less\
+ libapache2-mod-perl2\
+ libcache-memcached-perl\
+ libclass-dbi-abstractsearch-perl\
+ libclass-dbi-sqlite-perl\
+ liberror-perl\
+ libexpat1-dev\
+ libfile-find-rule-perl\
+ libfreezethaw-perl\
+ liblog-log4perl-perl\
+ libmemcache-dev\
+ libmodule-build-perl\
+ libnet-jabber-perl\
+ libperl-dev\
+ libreadline5-dev\
+ librpc-xml-perl\
+ libtemplate-perl\
+ libtest-pod-perl\
+ libtie-ixhash-perl\
+ libtool\
+ libuniversal-require-perl\
+ libunix-syslog-perl\
+ libwww-perl\
+ libxml2-dev\
+ libxml-libxml-perl\
+ libxml-libxslt-perl\
+ libxml-simple-perl\
+ libxslt1-dev\
+ memcached\
+ ntpdate\
+ psmisc\
+ python-dev\
+ python-libxml2\
+ python-setuptools\
+ syslog-ng
+
+CENTOS = \
+ apr-util-devel \
+ autoconf \
+ automake \
+ gcc \
+ gdbm-devel \
+ httpd-devel \
+ less \
+ libtool \
+ libxml2-devel \
+ libxslt-devel \
+ make \
+ mod_perl \
+ mod_ssl \
+ ncurses \
+ ncurses-devel \
+ ntp \
+ perl-DBI \
+ perl-XML-LibXML \
+ perl-XML-Simple \
+ perl-libwww-perl \
+ psmisc \
+ python-devel \
+ python-setuptools\
+ 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
+
+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 \
+ JSON::XS \
+ XML::LibXML::XPathContext
+
+
+# ----------------------------------------------------------------------------
+
+all:
+ @echo "please specify an OS" && exit 0
+
+
+# these should be the same for any distro
+install: install_cpan
+
+centos: install_centos_rpms install_ejabberd install_libmemcache install install_libxml2 install_libxslt install_centos_perl create_ld_local
+
+debian: install_debs install debian_sys_config
+
+gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
+
+rhel: centos
+
+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 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).gz
+ ./$(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
+
+
+# ------------------------------------------------------------------
+# - 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_TOOL) 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
+
+# ------------------------------------------------------------------
+
+# 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:
More information about the opensrf-commits
mailing list