]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/extras/Makefile.install
Now that OpenSRF has its own prereq installer, take a first
[working/Evergreen.git] / Open-ILS / src / extras / Makefile.install
1 # ---------------------------------------------------------------------
2 # Author: Bill Erickson <erickson@esilibrary.com>
3 #
4 # Makefile to install prerequisites for OpenSRF and Evergreen
5 #
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
9 #
10 # usage:
11 #       make -f Makefile.install debian
12 #       - or -
13 #       make -f Makefile.install ubuntu
14 #       - or -
15 #       make -f Makefile.install centos
16 #       - or -
17 #       make -f Makefile.install rhel
18 #       - or -
19 #       make -f Makefile.install gentoo
20 #
21 # Notes:
22 #
23 #       This makefile has been tested much more with Debian than CentOS, Gentoo, or RHEL.
24 #
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
28 #
29 # ---------------------------------------------------------------------
30  
31 # Make any assumptions about the shell being used explicit
32 SHELL=/bin/bash 
33
34 # XXX
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
39
40 LIBJS=js-1.7.0
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/
46
47
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
50 LIBDBI=libdbi-0.8.3
51 LIBDBI_DRIVERS=libdbi-drivers-0.8.3
52 LIBDBI_HOST=http://open-ils.org/~denials/evergreen
53
54 # We need a recent version of Yaz
55 # Debian Lenny and Ubuntu 8.10 come with 3.0.34
56 YAZ=yaz-3.0.38
57 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
58
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/
62
63 APT_TOOL=aptitude
64
65 # Debian dependencies
66 DEBS =  \
67         aspell\
68         aspell-en\
69         libbusiness-creditcard-perl\
70         libbusiness-onlinepayment-authorizenet-perl\
71         libbusiness-onlinepayment-perl\
72         libclass-dbi-pg-perl\
73         libdatetime-format-builder-perl\
74         libdatetime-format-mail-perl\
75         libdatetime-perl\
76         libdatetime-timezone-perl\
77         libemail-send-perl\
78         libgd-graph3d-perl\
79         libmarc-record-perl\
80         libole-storage-lite-perl\
81         libpq-dev\
82         libspreadsheet-writeexcel-perl\
83         libtext-aspell-perl\
84         libtext-csv-perl\
85         libtext-csv-perl
86
87 CENTOS = \
88         aspell \
89         aspell-devel \
90         aspell-en \
91         gd-devel \
92         perl-DBD-Pg
93
94 PGSQL_CENTOS = \
95         postgresql \
96         postgresql-contrib \
97         postgresql-devel \
98         postgresql-pl \
99         postgresql-server
100
101 # Avoids a weak reference error that otherwise sinks DateTime:Format:ISO8601
102 CENTOS_PERL_FORCE = \
103         Scalar::Util
104
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
110
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
114
115 CENTOS_PERL = \
116         Business::CreditCard \
117         Class::DBI::Pg \
118         DateTime \
119         DateTime::TimeZone \
120         DateTime::Format::Builder \
121         GD::Graph3d \
122         MARC::Record \
123         Net::Z3950::ZOOM \
124         Spreadsheet::WriteExcel \
125         Text::Aspell \
126         Text::CSV
127
128 PGSQL_DEBIAN = \
129         postgresql-8.1\
130         postgresql-client-8.1\
131         postgresql-contrib-8.1\
132         postgresql-plperl-8.1\
133         postgresql-server-dev-8.1
134
135 PGSQL_UBUNTU = \
136         postgresql-8.2\
137         postgresql-client-8.2\
138         postgresql-contrib-8.2\
139         postgresql-plperl-8.2\
140         postgresql-server-dev-8.2
141
142 GENTOOS = \
143     yaz\
144     aspell-en\
145     dev-db/libpq\
146     dev-db/postgresql\
147     dev-perl/Email-Send\
148     dev-perl/DateTime\
149     dev-perl/DateTime-TimeZone\
150     dev-perl/DBD-Pg\
151     dev-perl/GD-Graph3d\
152     dev-perl/Text-Aspell\
153     dev-perl/Template-Toolkit\
154     dev-perl/Text-CSV_XS\
155     dev-perl/Spreadsheet-WriteExcel
156
157 GENTOO_PERL = \
158     MARC::Record \
159     Net::Z3950::ZOOM \
160     Text::CSV
161
162 DEB_APACHE_MODS = \
163     expires\
164     include\
165     proxy\
166     proxy_http\
167     rewrite\
168     ssl
169  
170
171 # generic CPAN modules
172 CPAN_MODULES = \
173     Business::CreditCard::Object \
174     MARC::Charset MARC::File::XML \
175     Net::Z3950::ZOOM \
176     SRU
177
178 # ----------------------------------------------------------------------------
179
180 all: 
181         @echo "please specify an OS" && exit 0
182
183 # these should be the same for any distro
184 install: install_yaz install_cpan install_js_sm install_libdbi 
185
186 centos: install_centos_pgsql install_centos_rpms install install_centos_perl create_ld_local
187
188 debian: install_pgsql_debian install_debs install debian_sys_config
189
190 gentoo: install_gentoos install_gentoo_perl install
191
192 rhel: centos
193
194 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
195
196
197 # - COMMON TARGETS ---------------------------------------------------------
198
199 # Install the CPAN modules
200 install_cpan: 
201         for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
202
203 # Install a known working version of YAZ
204 install_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
208
209 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
210 install_js_sm: 
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
222
223
224 # Install libdbi and the postgres drivers
225 install_libdbi:
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  
233
234
235 clean:
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
240
241
242 # ------------------------------------------------------------------
243 # - DEBIAN ---------------------------------------------------------
244
245 debian_sys_config: 
246         # link the apache modules in
247         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
248
249 # Install the debian-specific dependencies
250 install_debs:
251         $(APT_TOOL) install $(DEBS)
252
253 install_pgsql_debian:
254         $(APT_TOOL) install $(PGSQL_DEBIAN)
255
256 install_pgsql_ubuntu:
257         $(APT_TOOL) install $(PGSQL_UBUNTU)
258
259 # ------------------------------------------------------------------
260 # - GENTOO ---------------------------------------------------------
261
262 install_gentoos:
263         emerge -n $(GENTOOS)
264
265 install_gentoo_perl:
266         for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
267
268 # ------------------------------------------------------------------
269     
270
271 # CENTOS
272 install_centos_rpms:
273         yum -y install $(CENTOS)
274
275 install_centos_pgsql:
276         yum -y install $(PGSQL_CENTOS)
277
278 install_centos_perl:
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
283
284 # We need to add /usr/local/lib to the ldconfig list of directories on CentOS,
285 # if it is not already there
286 create_ld_local:
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; \
289                 ldconfig; \
290         fi;
291
292 # vim:noet:sw=4:ts=4: