1 # ---------------------------------------------------------------------
2 # Author: Bill Erickson <erickson@esilibrary.com>
4 # Makefile to install prerequisites for OpenSRF and Evergreen
6 # Currently supports Debian (etch) 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 gentoo
16 # This makefile has been tested much more with Debian than Gentoo.
18 # Gentoo (especially amd64) requires a good bit of masked package
19 # mangling for some packages. These are not documented here because
20 # they will continue to evolve
22 # ---------------------------------------------------------------------
25 # Gentoo needs explicit versions on many of these packages
26 # to simulate a "blessed" set of packages
27 # Also, I (think) Gentoo has a javascript::spidermonkey package that does
28 # not require fetching the sources externally ... needs testing/updating in here
32 LIBJS_PERL=JavaScript-SpiderMonkey-0.19
33 LIBJS_URL=ftp://ftp.mozilla.org/pub/mozilla.org/js/$(LIBJS).tar.gz
34 LIBJS_PERL_URL=ftp://mirror.datapipe.net/pub/CPAN/authors/id/T/TB/TBUSCH/$(LIBJS_PERL).tar.gz
35 # used for installing libjs lib and header files
36 JS_INSTALL_PREFIX=/usr/
39 # The libdbi sources can be fetched from sourceforge.net. They are stored on
40 # the open-ils.org site now for ease of direct linking
42 LIBDBI_DRIVERS=libdbi-drivers-0.8.2-1
43 LIBDBI_HOST=http://open-ils.org/~erickson/evergreen
46 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
61 libcache-memcached-perl\
69 libclass-dbi-abstractsearch-perl\
72 libdatetime-timezone-perl\
76 libuniversal-require-perl\
77 libclass-dbi-sqlite-perl\
81 libfile-find-rule-perl\
82 libdatetime-format-builder-perl\
97 libspreadsheet-writeexcel-perl\
108 app-portage/gentoolkit\
119 dev-perl/Cache-Memcached\
121 dev-perl/DateTime-TimeZone\
125 dev-perl/Log-Log4perl\
126 dev-perl/Text-Aspell\
127 dev-perl/Unix-Syslog\
129 dev-perl/XML-LibXSLT\
132 dev-perl/libwww-perl\
133 dev-perl/Template-Toolkit\
135 dev-perl/Text-CSV_XS\
136 dev-perl/Spreadsheet-WriteExcel\
146 Class::DBI::AbstractSearch\
160 # generic CPAN modules
162 DateTime::Format::ISO8601 \
163 TMTM/Class-DBI-0.96.tar.gz \
164 RHANDOM/Net-Server-0.90.tar.gz \
165 MARC::Charset MARC::File::XML\
169 # ----------------------------------------------------------------------------
172 @echo "please specify an OS" && exit 0
175 # these should be the same for any distro
176 install: install_yaz install_cpan install_js_sm install_libdbi
178 debian: install_debs install debian_sys_config
180 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
183 # - COMMON TARGETS ---------------------------------------------------------
185 # Install the CPAN modules
187 for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
191 if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
192 tar xzf $(YAZ).tar.gz
193 cd $(YAZ) && ./configure && make && make install
195 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
197 if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
198 if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
199 tar -zxf $(LIBJS).tar.gz
200 tar -zxf $(LIBJS_PERL).tar.gz
201 cd js/src/ && make -f Makefile.ref
202 mkdir -p $(JS_INSTALL_PREFIX)/include/js/
203 cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
204 cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
205 cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
206 cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
207 cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
210 # Install libdbi and the postgres drivers
212 if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
213 if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
214 tar -zxf $(LIBDBI).tar.gz
215 tar -zxf $(LIBDBI_DRIVERS).tar.gz
216 cd $(LIBDBI) && ./configure --disable-docs && make all install
217 cd $(LIBDBI_DRIVERS) && ./configure \
218 --disable-docs --with-pgsql --enable-libdbi && make all install
222 make -C $(LIBDBI) clean
223 make -C $(LIBDBI_DRIVERS) clean
224 make -C $(LIBJS_PERL) clean
225 make -f Makefile.ref -C js/src/ clean
228 # ------------------------------------------------------------------
229 # - DEBIAN ---------------------------------------------------------
232 # link the apache modules in
233 for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
235 # adds a placeholder module so apxs will be happy
236 if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
237 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
238 >> /etc/apache2/httpd.conf; \
241 # Install the debian-specific dependencies
243 apt-get install $(DEBS)
247 # ------------------------------------------------------------------
248 # - GENTOO ---------------------------------------------------------
254 for m in $(GENTOO_RC); do rc-update add $$m default; done;
257 for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
259 # ------------------------------------------------------------------