]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/extras/Makefile.install
added prereqs for credit card processing
[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) 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-dev\
102         python-setuptools\
103         libfreezethaw-perl\
104         libbusiness-creditcard-perl\
105         libbusiness-onlinepayment-perl\
106         libbusiness-onlinepayment-authorizenet-perl
107
108
109 PGSQL_DEBIAN = \
110         postgresql-8.1\
111         postgresql-client-8.1\
112         postgresql-contrib-8.1\
113         postgresql-plperl-8.1\
114         postgresql-server-dev-8.1
115
116 PGSQL_UBUNTU = \
117         postgresql-8.2\
118         postgresql-client-8.2\
119         postgresql-contrib-8.2\
120         postgresql-plperl-8.2\
121         postgresql-server-dev-8.2
122
123 GENTOOS = \
124     vim\
125     ntp\
126     memcached\
127     libmemcache\
128     net-misc/telnet-bsd\
129     app-portage/gentoolkit\
130     gsasl\
131     ejabberd\
132     mod_perl\
133     yaz\
134     aspell-en\
135     net-fs/nfs-utils\
136     dev-libs/apr\
137     dev-db/libpq\
138     dev-db/postgresql\
139     dev-perl/Email-Send\
140     dev-perl/Cache-Memcached\
141     dev-perl/DateTime\
142     dev-perl/DateTime-TimeZone\
143     dev-perl/DBI\
144     dev-perl/DBD-Pg\
145     dev-perl/GD-Graph3d\
146     dev-perl/Log-Log4perl\
147     dev-perl/Text-Aspell\
148     dev-perl/Unix-Syslog\
149     dev-perl/XML-LibXML\
150     dev-perl/XML-LibXSLT\
151     dev-perl/XML-Simple\
152     dev-perl/Net-Jabber\
153     dev-perl/libwww-perl\
154     dev-perl/Template-Toolkit\
155     dev-perl/Error\
156     dev-perl/Text-CSV_XS\
157     dev-perl/Spreadsheet-WriteExcel\
158     dev-perl/Tie-IxHash\
159         dev-perl/FreezeThaw
160
161 GENTOO_RC = \
162     ejabberd\
163     memcached\
164     portmap
165
166 GENTOO_PERL = \
167     UNIVERSAL::require\
168     Class::DBI::AbstractSearch\
169     MARC::Record \
170     Net::Z3950::ZOOM \
171     Text::CSV
172
173 DEB_APACHE_MODS = \
174     expires\
175     include\
176     proxy\
177     proxy_http\
178     rewrite\
179     ssl
180  
181
182 # generic CPAN modules
183 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\
188     JSON::XS\
189     SRU \
190     Net::Z3950::ZOOM \
191         Business::CreditCard::Object
192
193
194 # ----------------------------------------------------------------------------
195
196 all: 
197         @echo "please specify an OS" && exit 0
198
199
200 # these should be the same for any distro
201 install: install_yaz install_cpan install_js_sm install_libdbi 
202
203 debian: install_pgsql_debian install_debs install debian_sys_config
204
205 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
206
207 ubuntu: install_pgsql_ubuntu install_debs install debian_sys_config
208
209
210 # - COMMON TARGETS ---------------------------------------------------------
211
212 # Install the CPAN modules
213 install_cpan: 
214         for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
215
216
217 install_yaz:    
218         if [ ! -d $(YAZ) ]; then wget $(YAZ_HOST)/$(YAZ).tar.gz; fi;
219         tar xzf $(YAZ).tar.gz
220         cd $(YAZ) && ./configure && make && make install
221
222 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
223 install_js_sm: 
224         if [ ! -f $(LIBJS).tar.gz ]; then wget $(LIBJS_URL); fi;
225         if [ ! -f $(LIBJS_PERL).tar.gz ]; then wget $(LIBJS_PERL_URL); fi;
226         tar -zxf $(LIBJS).tar.gz
227         tar -zxf $(LIBJS_PERL).tar.gz
228         cd js/src/ && make -f Makefile.ref
229         mkdir -p $(JS_INSTALL_PREFIX)/include/js/
230         cp js/src/*.h $(JS_INSTALL_PREFIX)/include/js/
231         cp js/src/*.tbl $(JS_INSTALL_PREFIX)/include/js/
232         cp js/src/Linux_All_DBG.OBJ/*.so $(JS_INSTALL_PREFIX)/lib/
233         cp js/src/Linux_All_DBG.OBJ/*.a $(JS_INSTALL_PREFIX)/lib/
234         cd $(LIBJS_PERL) && perl Makefile.PL -E4X && make && make test && make install
235
236
237 # Install libdbi and the postgres drivers
238 install_libdbi:
239         if [ ! -d $(LIBDBI) ]; then wget $(LIBDBI_HOST)/$(LIBDBI).tar.gz; fi;
240         if [ ! -d $(LIBDBI_DRIVERS) ]; then wget $(LIBDBI_HOST)/$(LIBDBI_DRIVERS).tar.gz; fi;
241         tar -zxf $(LIBDBI).tar.gz
242         tar -zxf $(LIBDBI_DRIVERS).tar.gz
243         cd $(LIBDBI) && ./configure --disable-docs && make all install
244         cd $(LIBDBI_DRIVERS) && ./configure  \
245                 --disable-docs --with-pgsql --enable-libdbi && make all install  
246
247
248 clean:
249         make -C $(LIBDBI) clean
250         make -C $(LIBDBI_DRIVERS) clean
251         make -C $(LIBJS_PERL) clean
252         make -f Makefile.ref -C js/src/ clean
253
254
255 # ------------------------------------------------------------------
256 # - DEBIAN ---------------------------------------------------------
257
258 debian_sys_config: 
259         # link the apache modules in
260         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
261         
262         # adds a placeholder module so apxs will be happy
263         if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
264                 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
265                         >> /etc/apache2/httpd.conf; \
266         fi;
267
268 # Install the debian-specific dependencies
269 install_debs:
270         apt-get install $(DEBS)
271
272 install_pgsql_debian:
273         apt-get install $(PGSQL_DEBIAN)
274
275 install_pgsql_ubuntu:
276         apt-get install $(PGSQL_UBUNTU)
277
278 # ------------------------------------------------------------------
279 # - GENTOO ---------------------------------------------------------
280
281 install_gentoos:
282         emerge -n $(GENTOOS)
283
284 install_gentoo_rc:
285         for m in $(GENTOO_RC); do rc-update add $$m default; done;
286
287 install_gentoo_perl:
288         for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
289
290 # ------------------------------------------------------------------
291     
292