1 # ---------------------------------------------------------------------
2 # Author: Bill Erickson <erickson@esilibrary.com>
4 # Makefile to install prerequisites for OpenSRF and Evergreen
6 # Currently supports Debian (etch), Ubuntu (gutsy/hardy), and Gentoo.
7 # Working towards support of CentOS 5 / RHEL 5.
8 # Installs Perl prereqs, libjs with Perl wrapper, libdbi, libdbi-drivers, and libyaz
11 # make -f Makefile.install debian
13 # make -f Makefile.install ubuntu
15 # make -f Makefile.install centos
17 # make -f Makefile.install rhel
19 # make -f Makefile.install gentoo
23 # This makefile has been tested much more with Debian than CentOS, Gentoo, or RHEL.
25 # Gentoo (especially amd64) requires a good bit of masked package
26 # mangling for some packages. These are not documented here because
27 # they will continue to evolve
29 # ---------------------------------------------------------------------
31 # Make any assumptions about the shell being used explicit
35 # Gentoo needs explicit versions on many of these packages
36 # to simulate a "blessed" set of packages
37 # Also, I (think) Gentoo has a javascript::spidermonkey package that does
38 # not require fetching the sources externally ... needs testing/updating in here
41 LIBJS_PERL=JavaScript-SpiderMonkey-0.19
42 LIBJS_URL=ftp://ftp.mozilla.org/pub/mozilla.org/js/$(LIBJS).tar.gz
43 LIBJS_PERL_URL=ftp://mirror.datapipe.net/pub/CPAN/authors/id/T/TB/TBUSCH/$(LIBJS_PERL).tar.gz
44 # used for installing libjs lib and header files
45 JS_INSTALL_PREFIX=/usr/
48 # The libdbi sources can be fetched from sourceforge.net. They are stored on
49 # the open-ils.org site now for ease of direct linking
51 LIBDBI_DRIVERS=libdbi-drivers-0.8.3
52 LIBDBI_HOST=http://open-ils.org/~denials/evergreen
54 # We need a recent version of Yaz
55 # Debian Lenny and Ubuntu 8.10 come with 3.0.34
57 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
59 # Business::OnlinePayment is not packaged on CentOS/RHEL
60 PAY_ONLINE=Business-OnlinePayment-3.00_08.tar.gz
61 PAY_ONLINE_HOST=http://ftp.perl.org/pub/CPAN/authors/id/I/IV/IVAN/
69 libbusiness-creditcard-perl\
70 libbusiness-onlinepayment-authorizenet-perl\
71 libbusiness-onlinepayment-perl\
73 libdatetime-format-builder-perl\
74 libdatetime-format-mail-perl\
76 libdatetime-timezone-perl\
80 libole-storage-lite-perl\
82 libspreadsheet-writeexcel-perl\
101 # Avoids a weak reference error that otherwise sinks DateTime:Format:ISO8601
102 CENTOS_PERL_FORCE = \
105 # Some of these packages have stupid bugs in their test suites
106 # that are simply too painful to workaround
107 CENTOS_PERL_NOTEST = \
108 Business::OnlinePayment::AuthorizeNet \
109 DateTime::Format::Strptime
111 # This is a developer's version, but B:OP:AuthorizeNet depends on it
112 CENTOS_PERL_VERSION = \
113 IVAN/Business-OnlinePayment-3.00_08.tar.gz
116 Business::CreditCard \
120 DateTime::Format::Builder \
124 Spreadsheet::WriteExcel \
130 postgresql-client-8.1\
131 postgresql-contrib-8.1\
132 postgresql-plperl-8.1\
133 postgresql-server-dev-8.1
137 postgresql-client-8.2\
138 postgresql-contrib-8.2\
139 postgresql-plperl-8.2\
140 postgresql-server-dev-8.2
149 dev-perl/DateTime-TimeZone\
152 dev-perl/Text-Aspell\
153 dev-perl/Template-Toolkit\
154 dev-perl/Text-CSV_XS\
155 dev-perl/Spreadsheet-WriteExcel
171 # generic CPAN modules
173 Business::CreditCard::Object \
174 MARC::Charset MARC::File::XML \
178 # ----------------------------------------------------------------------------
181 @echo "please specify an OS" && exit 0
183 # these should be the same for any distro
184 install: install_yaz install_cpan install_js_sm install_libdbi
186 centos: install_centos_pgsql install_centos_rpms install install_centos_perl create_ld_local
188 debian: install_pgsql_debian install_debs install debian_sys_config
190 gentoo: install_gentoos install_gentoo_perl install
194 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
197 # - COMMON TARGETS ---------------------------------------------------------
199 # Install the CPAN modules
201 for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
203 # Install a known working version of YAZ
205 if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
206 tar xzf $(YAZ).tar.gz
207 cd $(YAZ) && ./configure && make && make install
209 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
211 if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
212 if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
213 tar -zxf $(LIBJS).tar.gz
214 tar -zxf $(LIBJS_PERL).tar.gz
215 cd js/src/ && make -f Makefile.ref
216 mkdir -p $(JS_INSTALL_PREFIX)/include/js/
217 cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
218 cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
219 cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
220 cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
221 cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
224 # Install libdbi and the postgres drivers
226 if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
227 if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
228 tar -zxf $(LIBDBI).tar.gz
229 tar -zxf $(LIBDBI_DRIVERS).tar.gz
230 cd $(LIBDBI) && ./configure --disable-docs && make all install
231 cd $(LIBDBI_DRIVERS) && ./configure \
232 --disable-docs --with-pgsql --enable-libdbi && make all install
236 make -C $(LIBDBI) clean
237 make -C $(LIBDBI_DRIVERS) clean
238 make -C $(LIBJS_PERL) clean
239 make -f Makefile.ref -C js/src/ clean
242 # ------------------------------------------------------------------
243 # - DEBIAN ---------------------------------------------------------
246 # link the apache modules in
247 for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
249 # Install the debian-specific dependencies
251 $(APT_TOOL) install $(DEBS)
253 install_pgsql_debian:
254 $(APT_TOOL) install $(PGSQL_DEBIAN)
256 install_pgsql_ubuntu:
257 $(APT_TOOL) install $(PGSQL_UBUNTU)
259 # ------------------------------------------------------------------
260 # - GENTOO ---------------------------------------------------------
266 for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
268 # ------------------------------------------------------------------
273 yum -y install $(CENTOS)
275 install_centos_pgsql:
276 yum -y install $(PGSQL_CENTOS)
279 for m in $(CENTOS_PERL_FORCE); do perl -MCPAN -e "CPAN::Shell->force(qw#install $$m#);"; done
280 for m in $(CENTOS_PERL); do perl -MCPAN -e "install \"$$m\";"; done
281 for m in $(CENTOS_PERL_VERSION); do perl -MCPAN -e "CPAN::Shell->install \"$$m\";"; done
282 for m in $(CENTOS_PERL_NOTEST); do perl -MCPAN -e "CPAN::Shell->notest('install', \"$$m\";"; done
284 # We need to add /usr/local/lib to the ldconfig list of directories on CentOS,
285 # if it is not already there
287 if [ "$$(ldconfig -v 2> /dev/null | grep '^/usr/local/lib' | wc -l)" -eq 0 ]; then \
288 echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf; \
292 # vim:noet:sw=4:ts=4: