1 # ---------------------------------------------------------------------
2 # Author: Bill Erickson <erickson@esilibrary.com>
4 # Makefile to install prerequisites for OpenSRF and Evergreen
6 # Currently supports Debian (etch), Ubuntu (gutsy) and Gentoo. Installs Perl prereqs,
7 # libjs with Perl wrapper, libdbi, libdbi-drivers, and libyaz
10 # make -f Makefile.install debian
12 # make -f Makefile.install ubuntu
14 # make -f Makefile.install gentoo
18 # This makefile has been tested much more with Debian than Gentoo.
20 # Gentoo (especially amd64) requires a good bit of masked package
21 # mangling for some packages. These are not documented here because
22 # they will continue to evolve
24 # ---------------------------------------------------------------------
27 # Gentoo needs explicit versions on many of these packages
28 # to simulate a "blessed" set of packages
29 # Also, I (think) Gentoo has a javascript::spidermonkey package that does
30 # not require fetching the sources externally ... needs testing/updating in here
34 LIBJS_PERL=JavaScript-SpiderMonkey-0.19
35 LIBJS_URL=ftp://ftp.mozilla.org/pub/mozilla.org/js/$(LIBJS).tar.gz
36 LIBJS_PERL_URL=ftp://mirror.datapipe.net/pub/CPAN/authors/id/T/TB/TBUSCH/$(LIBJS_PERL).tar.gz
37 # used for installing libjs lib and header files
38 JS_INSTALL_PREFIX=/usr/
41 # The libdbi sources can be fetched from sourceforge.net. They are stored on
42 # the open-ils.org site now for ease of direct linking
44 LIBDBI_DRIVERS=libdbi-drivers-0.8.3
45 LIBDBI_HOST=http://open-ils.org/~denials/evergreen
48 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
63 libcache-memcached-perl\
71 libclass-dbi-abstractsearch-perl\
74 libdatetime-timezone-perl\
78 libuniversal-require-perl\
79 libclass-dbi-sqlite-perl\
83 libfile-find-rule-perl\
84 libdatetime-format-builder-perl\
99 libspreadsheet-writeexcel-perl\
104 libbusiness-creditcard-perl\
105 libbusiness-onlinepayment-perl\
106 libbusiness-onlinepayment-authorizenet-perl
111 postgresql-client-8.1\
112 postgresql-contrib-8.1\
113 postgresql-plperl-8.1\
114 postgresql-server-dev-8.1
118 postgresql-client-8.2\
119 postgresql-contrib-8.2\
120 postgresql-plperl-8.2\
121 postgresql-server-dev-8.2
129 app-portage/gentoolkit\
140 dev-perl/Cache-Memcached\
142 dev-perl/DateTime-TimeZone\
146 dev-perl/Log-Log4perl\
147 dev-perl/Text-Aspell\
148 dev-perl/Unix-Syslog\
150 dev-perl/XML-LibXSLT\
153 dev-perl/libwww-perl\
154 dev-perl/Template-Toolkit\
156 dev-perl/Text-CSV_XS\
157 dev-perl/Spreadsheet-WriteExcel\
168 Class::DBI::AbstractSearch\
182 # generic CPAN modules
184 DateTime::Format::ISO8601 \
185 TMTM/Class-DBI-0.96.tar.gz \
186 RHANDOM/Net-Server-0.90.tar.gz \
187 MARC::Charset MARC::File::XML\
191 Business::CreditCard::Object \
192 XML::LibXML::XPathContext
195 # ----------------------------------------------------------------------------
198 @echo "please specify an OS" && exit 0
201 # these should be the same for any distro
202 install: install_yaz install_cpan install_js_sm install_libdbi
204 debian: install_pgsql_debian install_debs install debian_sys_config
206 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
208 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
211 # - COMMON TARGETS ---------------------------------------------------------
213 # Install the CPAN modules
215 for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
219 if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
220 tar xzf $(YAZ).tar.gz
221 cd $(YAZ) && ./configure && make && make install
223 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
225 if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
226 if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
227 tar -zxf $(LIBJS).tar.gz
228 tar -zxf $(LIBJS_PERL).tar.gz
229 cd js/src/ && make -f Makefile.ref
230 mkdir -p $(JS_INSTALL_PREFIX)/include/js/
231 cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
232 cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
233 cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
234 cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
235 cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
238 # Install libdbi and the postgres drivers
240 if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
241 if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
242 tar -zxf $(LIBDBI).tar.gz
243 tar -zxf $(LIBDBI_DRIVERS).tar.gz
244 cd $(LIBDBI) && ./configure --disable-docs && make all install
245 cd $(LIBDBI_DRIVERS) && ./configure \
246 --disable-docs --with-pgsql --enable-libdbi && make all install
250 make -C $(LIBDBI) clean
251 make -C $(LIBDBI_DRIVERS) clean
252 make -C $(LIBJS_PERL) clean
253 make -f Makefile.ref -C js/src/ clean
256 # ------------------------------------------------------------------
257 # - DEBIAN ---------------------------------------------------------
260 # link the apache modules in
261 for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
263 # adds a placeholder module so apxs will be happy
264 if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
265 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
266 >> /etc/apache2/httpd.conf; \
269 # Install the debian-specific dependencies
271 apt-get install $(DEBS)
273 install_pgsql_debian:
274 apt-get install $(PGSQL_DEBIAN)
276 install_pgsql_ubuntu:
277 apt-get install $(PGSQL_UBUNTU)
279 # ------------------------------------------------------------------
280 # - GENTOO ---------------------------------------------------------
286 for m in $(GENTOO_RC); do rc-update add $$m default; done;
289 for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
291 # ------------------------------------------------------------------