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.2-1
45 LIBDBI_HOST=http://open-ils.org/~erickson/evergreen
48 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
62 libcache-memcached-perl\
70 libclass-dbi-abstractsearch-perl\
73 libdatetime-timezone-perl\
77 libuniversal-require-perl\
78 libclass-dbi-sqlite-perl\
82 libfile-find-rule-perl\
83 libdatetime-format-builder-perl\
98 libspreadsheet-writeexcel-perl\
104 postgresql-client-8.1\
105 postgresql-contrib-8.1\
106 postgresql-plperl-8.1\
107 postgresql-server-dev-8.1
111 postgresql-client-8.2\
112 postgresql-contrib-8.2\
113 postgresql-plperl-8.2\
114 postgresql-server-dev-8.2
122 app-portage/gentoolkit\
133 dev-perl/Cache-Memcached\
135 dev-perl/DateTime-TimeZone\
139 dev-perl/Log-Log4perl\
140 dev-perl/Text-Aspell\
141 dev-perl/Unix-Syslog\
143 dev-perl/XML-LibXSLT\
146 dev-perl/libwww-perl\
147 dev-perl/Template-Toolkit\
149 dev-perl/Text-CSV_XS\
150 dev-perl/Spreadsheet-WriteExcel\
160 Class::DBI::AbstractSearch\
174 # generic CPAN modules
176 DateTime::Format::ISO8601 \
177 TMTM/Class-DBI-0.96.tar.gz \
178 RHANDOM/Net-Server-0.90.tar.gz \
179 MARC::Charset MARC::File::XML\
183 # ----------------------------------------------------------------------------
186 @echo "please specify an OS" && exit 0
189 # these should be the same for any distro
190 install: install_yaz install_cpan install_js_sm install_libdbi
192 debian: install_pgsql_debian install_debs install debian_sys_config
194 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
196 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
199 # - COMMON TARGETS ---------------------------------------------------------
201 # Install the CPAN modules
203 for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
207 if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
208 tar xzf $(YAZ).tar.gz
209 cd $(YAZ) && ./configure && make && make install
211 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
213 if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
214 if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
215 tar -zxf $(LIBJS).tar.gz
216 tar -zxf $(LIBJS_PERL).tar.gz
217 cd js/src/ && make -f Makefile.ref
218 mkdir -p $(JS_INSTALL_PREFIX)/include/js/
219 cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
220 cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
221 cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
222 cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
223 cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
226 # Install libdbi and the postgres drivers
228 if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
229 if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
230 tar -zxf $(LIBDBI).tar.gz
231 tar -zxf $(LIBDBI_DRIVERS).tar.gz
232 cd $(LIBDBI) && ./configure --disable-docs && make all install
233 cd $(LIBDBI_DRIVERS) && ./configure \
234 --disable-docs --with-pgsql --enable-libdbi && make all install
238 make -C $(LIBDBI) clean
239 make -C $(LIBDBI_DRIVERS) clean
240 make -C $(LIBJS_PERL) clean
241 make -f Makefile.ref -C js/src/ clean
244 # ------------------------------------------------------------------
245 # - DEBIAN ---------------------------------------------------------
248 # link the apache modules in
249 for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
251 # adds a placeholder module so apxs will be happy
252 if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
253 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
254 >> /etc/apache2/httpd.conf; \
257 # Install the debian-specific dependencies
259 apt-get install $(DEBS)
261 install_pgsql_debian:
262 apt-get install $(PGSQL_DEBIAN)
264 install_pgsql_ubuntu:
265 apt-get install $(PGSQL_UBUNTU)
267 # ------------------------------------------------------------------
268 # - GENTOO ---------------------------------------------------------
274 for m in $(GENTOO_RC); do rc-update add $$m default; done;
277 for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
279 # ------------------------------------------------------------------