1 # ---------------------------------------------------------------------
2 # Author: Bill Erickson <erickson@esilibrary.com>
4 # Makefile to install prerequisites for OpenSRF
6 # Currently supports Debian (etch/lenny), Ubuntu (gutsy/hardy/intrepid), and Gentoo.
7 # Working towards support of CentOS 5 / RHEL 5.
8 # Installs Perl prereqs, libjs with Perl wrapper
11 # make -f Makefile.install debian-etch
13 # make -f Makefile.install debian-lenny
15 # make -f Makefile.install ubuntu-gutsy
17 # make -f Makefile.install ubuntu-hardy
19 # make -f Makefile.install ubuntu-intrepid
21 # make -f Makefile.install centos
23 # make -f Makefile.install rhel
25 # make -f Makefile.install gentoo
29 # This makefile has been tested much more with Ubuntu and Debian than
30 # CentOS, Gentoo, or RHEL.
32 # Gentoo (especially amd64) requires a good bit of masked package
33 # mangling for some packages. These are not documented here because
34 # they will continue to evolve
36 # ---------------------------------------------------------------------
38 # Make any assumptions about the shell being used explicit
42 # Gentoo needs explicit versions on many of these packages
43 # to simulate a "blessed" set of packages
45 # ejabberd is not packaged on CentOS/RHEL, so we have to
46 # download the installable package from the source
48 EJABBERD_PKG=ejabberd-2.0.2_2-linux-x86-installer.bin
49 EJABBERD_PKG_x64=ejabberd-2.0.2_2-linux-x86_64-installer.bin
50 EJABBERD_HOST=http://www.process-one.net/downloads/ejabberd
52 # libmemcache is not packaged on CentOS/RHEL
53 LIBMEMCACHE=libmemcache-1.4.0.rc2
54 LIBMEMCACHE_HOST=http://people.freebsd.org/~seanc/libmemcache/
56 # XML::LibXSLT fails due to old libxslt
58 XSLT_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1
60 # libxslt depends on a newer version of libxml2:
61 XML2=libxml2-2.6.30.tar.gz
62 XML2_HOST=ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6
76 libcache-memcached-perl\
77 libclass-dbi-abstractsearch-perl\
78 libclass-dbi-sqlite-perl\
81 libfile-find-rule-perl\
96 libuniversal-require-perl\
138 # Some of these packages have stupid bugs in their test suites
139 # that are simply too painful to workaround
140 CENTOS_PERL_NOTEST = \
143 CENTOS_PERL_LOCAL = \
148 Class::DBI::AbstractSearch \
168 app-portage/gentoolkit\
174 dev-perl/Cache-Memcached\
176 dev-perl/Log-Log4perl\
177 dev-perl/Unix-Syslog\
179 dev-perl/XML-LibXSLT\
182 dev-perl/libwww-perl\
183 dev-perl/Template-Toolkit\
194 Class::DBI::AbstractSearch\
201 libdatetime-format-iso8601-perl \
205 # generic CPAN modules:
206 # * DateTime::Format::ISO8601 is packaged by both Debian Lenny and Ubuntu Intrepid
207 # * JSON::XS is packaged by both Debian Lenny and Ubuntu Intrepid
208 # * libnet-server-perl 0.97 is packaged on Debian Lenny and Ubuntu Intrepid
209 # - is there a specific need for 0.90?
211 DateTime::Format::ISO8601 \
212 RHANDOM/Net-Server-0.90.tar.gz \
215 # libxml-libxml-perl on Debian Lenny and Ubuntu Intrepid is 1.66, which
216 # has broken namespace handling. so we still need to install these from
222 # generic CPAN modules to force
223 CPAN_MODULES_FORCE = \
224 TMTM/Class-DBI-0.96.tar.gz
226 # ----------------------------------------------------------------------------
229 @echo "please specify an OS" && exit 0
232 centos: install_centos_rpms install_ejabberd install_libmemcache install install_libxml2 install_libxslt install_centos_perl create_ld_local
234 debian-etch: generic_debian etch
235 debian-lenny: generic_debian lenny
237 lenny: install_extra_debs
238 generic_debian: install_debs install_cpan_force install_cpan_xml debian_sys_config
240 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
244 ubuntu-gutsy: generic_ubuntu hardy
245 ubuntu-hardy: generic_ubuntu hardy
246 ubuntu-intrepid: generic_ubuntu intrepid
248 intrepid: install_extra_debs
249 generic_ubuntu: generic_debian
251 # - COMMON TARGETS ---------------------------------------------------------
253 # Install the CPAN modules
255 for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
257 # Install CPAN modules that need to be forced
259 for m in $(CPAN_MODULES_FORCE); do perl -MCPAN -e "CPAN::Shell->force(qw#install $$m#);"; done
261 # Install the CPAN XML modules
263 for m in $(CPAN_MODULES_XML); do perl -MCPAN -e "install \"$$m\";"; done
265 # Install ejabberd from official project installer binary
267 if [ ! -f $(EJABBERD_PKG).gz ]; then wget $(EJABBERD_HOST)/$(EJABBERD_VER)/$(EJABBERD_PKG).gz; fi;
268 gunzip $(EJABBERD_PKG).gz
269 chmod u+x $(EJABBERD_PKG).gz
270 ./$(EJABBERD_PKG) --mode unattended --prefix /opt/ejabberd --adminpw opensrf
272 # Install libmemcache from the official project source
274 if [ ! -d $(LIBMEMCACHE) ]; then wget $(LIBMEMCACHE_HOST)/$(LIBMEMCACHE).tar.bz2; fi;
275 tar xjf $(LIBMEMCACHE).tar.bz2
276 cd $(LIBMEMCACHE) && ./configure && make && make install
278 # Install a newer version of libxslt
280 if [ ! -d $(XSLT) ]; then wget $(XSLT_HOST)/$(XSLT).tar.gz; fi;
281 tar xzf $(XSLT).tar.gz
282 cd $(XSLT) && ./configure --with-libxml-prefix=/usr/local && make && make install
284 # Install a newer version of libxml2
286 if [ ! -d $(XML2) ]; then wget $(XML2_HOST)/$(XML2).tar.gz; fi;
287 tar xzf $(XML2).tar.gz
288 cd $(XML2) && ./configure && make && make install
291 make -C $(LIBJS_PERL) clean
292 make -C $(XML2) clean
293 make -C $(XSLT) clean
294 make -f Makefile.ref -C js/src/ clean
297 # ------------------------------------------------------------------
298 # - DEBIAN ---------------------------------------------------------
301 # link the apache modules in
302 for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
304 # adds a placeholder module so apxs will be happy
305 if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
306 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
307 >> /etc/apache2/httpd.conf; \
310 # Install the debian-specific dependencies
312 $(APT_TOOL) install $(DEBS)
314 # Install the debian-specific dependencies for more modern distros
316 $(APT_TOOL) install $(EXTRA_DEBS)
318 # ------------------------------------------------------------------
319 # - GENTOO ---------------------------------------------------------
325 for m in $(GENTOO_RC); do rc-update add $$m default; done;
328 for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
330 # ------------------------------------------------------------------
334 yum -y install $(CENTOS)
337 for m in $(CENTOS_PERL_FORCE); do perl -MCPAN -e "CPAN::Shell->force(qw#install $$m#);"; done
338 for m in $(CENTOS_PERL); do perl -MCPAN -e "install \"$$m\";"; done
339 for m in $(CENTOS_PERL_VERSION); do perl -MCPAN -e "CPAN::Shell->install \"$$m\";"; done
340 for m in $(CENTOS_PERL_NOTEST); do perl -MCPAN -e "CPAN::Shell->notest('install', \"$$m\";"; done
341 for m in $(CENTOS_PERL_LOCAL); do LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib perl -MCPAN -e "install \"$$m\";"; done
343 # We need to add /usr/local/lib to the ldconfig list of directories on CentOS,
344 # if it is not already there
346 if [ "$$(ldconfig -v 2> /dev/null | grep '^/usr/local/lib' | wc -l)" -eq 0 ]; then \
347 echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf; \
351 # vim:noet:sw=4:ts=4: