]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/extras/Makefile.install
srfsh wants less, and it's not installed on minimal debian, so let's give it less.
[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) and Gentoo.  Installs Perl prereqs, 
7 # libjs with Perl wrapper, libdbi, libdbi-drivers, and libyaz
8 #
9 # usage:
10 #       make -f Makefile.install debian
11 #       - or -
12 #       make -f Makefile.install ubuntu
13 #       - or -
14 #       make -f Makefile.install gentoo
15 #
16 # Notes:
17 #
18 #       This makefile has been tested much more with Debian than Gentoo.
19 #
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
23 #
24 # ---------------------------------------------------------------------
25  
26 # XXX
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
31
32  
33 LIBJS=js-1.7.0
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/
39
40
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
43 LIBDBI=libdbi-0.8.3
44 LIBDBI_DRIVERS=libdbi-drivers-0.8.3
45 LIBDBI_HOST=http://open-ils.org/~denials/evergreen
46
47 YAZ=yaz-2.1.56
48 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
49
50 # Debian dependencies
51 DEBS =  \
52         build-essential\
53         syslog-ng\
54         psmisc\
55         ntpdate\
56         less\
57     memcached\
58     libxml2-dev\
59     libmodule-build-perl\
60     libexpat1-dev\
61     libmemcache-dev\
62     libperl-dev\
63     libcache-memcached-perl\
64         libtext-csv-perl\
65     libxml-libxml-perl\
66     libxslt1-dev\
67     libxml-libxslt-perl\
68     libwww-perl\
69     liberror-perl\
70     libclass-dbi-pg-perl\
71     libclass-dbi-abstractsearch-perl\
72     libtemplate-perl\
73     libtext-aspell-perl\
74     libdatetime-timezone-perl\
75     libdatetime-perl\
76     libunix-syslog-perl\
77     libgd-graph3d-perl\
78     libuniversal-require-perl\
79     libclass-dbi-sqlite-perl\
80     liblog-log4perl-perl\
81     libnet-jabber-perl\
82     libtest-pod-perl\
83     libfile-find-rule-perl\
84     libdatetime-format-builder-perl\
85     libmarc-record-perl\
86     librpc-xml-perl\
87     aspell\
88     aspell-en\
89     libxml-simple-perl\
90     libpq-dev\
91     libemail-send-perl\
92     ejabberd\
93     libtool\
94     apache2-mpm-prefork\
95     apache2-prefork-dev\
96     libapache2-mod-perl2\
97     libreadline5-dev\
98         libtext-csv-perl\
99         libspreadsheet-writeexcel-perl\
100         libtie-ixhash-perl\
101         python-setuptools 
102
103 PGSQL_DEBIAN = \
104         postgresql-8.1\
105         postgresql-client-8.1\
106         postgresql-contrib-8.1\
107         postgresql-plperl-8.1\
108         postgresql-server-dev-8.1
109
110 PGSQL_UBUNTU = \
111         postgresql-8.2\
112         postgresql-client-8.2\
113         postgresql-contrib-8.2\
114         postgresql-plperl-8.2\
115         postgresql-server-dev-8.2
116
117 GENTOOS = \
118     vim\
119     ntp\
120     memcached\
121     libmemcache\
122     net-misc/telnet-bsd\
123     app-portage/gentoolkit\
124     gsasl\
125     ejabberd\
126     mod_perl\
127     yaz\
128     aspell-en\
129     net-fs/nfs-utils\
130     dev-libs/apr\
131     dev-db/libpq\
132     dev-db/postgresql\
133     dev-perl/Email-Send\
134     dev-perl/Cache-Memcached\
135     dev-perl/DateTime\
136     dev-perl/DateTime-TimeZone\
137     dev-perl/DBI\
138     dev-perl/DBD-Pg\
139     dev-perl/GD-Graph3d\
140     dev-perl/Log-Log4perl\
141     dev-perl/Text-Aspell\
142     dev-perl/Unix-Syslog\
143     dev-perl/XML-LibXML\
144     dev-perl/XML-LibXSLT\
145     dev-perl/XML-Simple\
146     dev-perl/Net-Jabber\
147     dev-perl/libwww-perl\
148     dev-perl/Template-Toolkit\
149     dev-perl/Error\
150     dev-perl/Text-CSV_XS\
151     dev-perl/Spreadsheet-WriteExcel\
152     dev-perl/Tie-IxHash
153
154 GENTOO_RC = \
155     ejabberd\
156     memcached\
157     portmap
158
159 GENTOO_PERL = \
160     UNIVERSAL::require\
161     Class::DBI::AbstractSearch\
162     MARC::Record \
163     Net::Z3950::ZOOM \
164     Text::CSV
165
166 DEB_APACHE_MODS = \
167     expires\
168     include\
169     proxy\
170     proxy_http\
171     rewrite\
172     ssl
173  
174
175 # generic CPAN modules
176 CPAN_MODULES = \
177     DateTime::Format::ISO8601 \
178     TMTM/Class-DBI-0.96.tar.gz \
179     RHANDOM/Net-Server-0.90.tar.gz \
180     MARC::Charset MARC::File::XML\
181     Net::Z3950::ZOOM
182
183
184 # ----------------------------------------------------------------------------
185
186 all: 
187         @echo "please specify an OS" && exit 0
188
189
190 # these should be the same for any distro
191 install: install_yaz install_cpan install_js_sm install_libdbi 
192
193 debian: install_pgsql_debian install_debs install debian_sys_config
194
195 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
196
197 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
198
199
200 # - COMMON TARGETS ---------------------------------------------------------
201
202 # Install the CPAN modules
203 install_cpan: 
204         for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
205
206
207 install_yaz:    
208         if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
209         tar xzf $(YAZ).tar.gz
210         cd $(YAZ) && ./configure && make && make install
211
212 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
213 install_js_sm: 
214         if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
215         if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
216         tar -zxf $(LIBJS).tar.gz
217         tar -zxf $(LIBJS_PERL).tar.gz
218         cd js/src/ && make -f Makefile.ref
219         mkdir -p $(JS_INSTALL_PREFIX)/include/js/
220         cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
221         cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
222         cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
223         cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
224         cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
225
226
227 # Install libdbi and the postgres drivers
228 install_libdbi:
229         if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
230         if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
231         tar -zxf $(LIBDBI).tar.gz
232         tar -zxf $(LIBDBI_DRIVERS).tar.gz
233         cd $(LIBDBI) && ./configure --disable-docs && make all install
234         cd $(LIBDBI_DRIVERS) && ./configure  \
235                 --disable-docs --with-pgsql --enable-libdbi && make all install  
236
237
238 clean:
239         make -C $(LIBDBI) clean
240         make -C $(LIBDBI_DRIVERS) clean
241         make -C $(LIBJS_PERL) clean
242         make -f Makefile.ref -C js/src/ clean
243
244
245 # ------------------------------------------------------------------
246 # - DEBIAN ---------------------------------------------------------
247
248 debian_sys_config: 
249         # link the apache modules in
250         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
251         
252         # adds a placeholder module so apxs will be happy
253         if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
254                 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
255                         >> /etc/apache2/httpd.conf; \
256         fi;
257
258 # Install the debian-specific dependencies
259 install_debs:
260         apt-get install $(DEBS)
261
262 install_pgsql_debian:
263         apt-get install $(PGSQL_DEBIAN)
264
265 install_pgsql_ubuntu:
266         apt-get install $(PGSQL_UBUNTU)
267
268 # ------------------------------------------------------------------
269 # - GENTOO ---------------------------------------------------------
270
271 install_gentoos:
272         emerge -n $(GENTOOS)
273
274 install_gentoo_rc:
275         for m in $(GENTOO_RC); do rc-update add $$m default; done;
276
277 install_gentoo_perl:
278         for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
279
280 # ------------------------------------------------------------------
281     
282
283