]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/extras/Makefile.install
365be27a475c93d09bab69053f5667764552d1ff
[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) 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 gentoo
13 #
14 # Notes:
15 #
16 #       This makefile has been tested much more with Debian than Gentoo.
17 #
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
21 #
22 # ---------------------------------------------------------------------
23  
24 # XXX
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
29
30  
31 LIBJS=js-1.60
32 LIBJS_PERL=JavaScript-SpiderMonkey-0.17
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/
37
38
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
41 LIBDBI=libdbi-0.8.2
42 LIBDBI_DRIVERS=libdbi-drivers-0.8.2-1
43 LIBDBI_HOST=http://open-ils.org/~erickson/evergreen
44
45 YAZ=yaz-2.1.56
46 YAZ_HOST=http://ftp.indexdata.dk/pub/yaz
47
48 # Debian dependencies
49 DEBS =  \
50         build-essential\
51         syslog-ng\
52         psmisc\
53         ntpdate\
54     memcached\
55     postgresql-client\
56     libxml2-dev\
57     libmodule-build-perl\
58     libexpat1-dev\
59     libmemcache-dev\
60     libperl-dev\
61     libcache-memcached-perl\
62         libtext-csv-perl\
63     libxml-libxml-perl\
64     libxslt1-dev\
65     libxml-libxslt-perl\
66     libwww-perl\
67     liberror-perl\
68     libclass-dbi-pg-perl\
69     libclass-dbi-abstractsearch-perl\
70     libtemplate-perl\
71     libtext-aspell-perl\
72     libdatetime-timezone-perl\
73     libdatetime-perl\
74     libunix-syslog-perl\
75     libgd-graph3d-perl\
76     libuniversal-require-perl\
77     libclass-dbi-sqlite-perl\
78     liblog-log4perl-perl\
79     libnet-jabber-perl\
80     libtest-pod-perl\
81     libfile-find-rule-perl\
82     libdatetime-format-builder-perl\
83     libmarc-record-perl\
84     librpc-xml-perl\
85     aspell\
86     aspell-en\
87     libxml-simple-perl\
88     libpq-dev\
89     libemail-send-perl\
90     ejabberd\
91     libtool\
92     apache2-mpm-prefork\
93     apache2-prefork-dev\
94     libapache2-mod-perl2\
95     libreadline5-dev\
96         libtext-csv-perl\
97         libspreadsheet-writeexcel-perl\
98         libtie-ixhash-perl
99
100
101
102 GENTOOS = \
103     vim\
104     ntp\
105     memcached\
106     libmemcache\
107     net-misc/telnet-bsd\
108     app-portage/gentoolkit\
109     gsasl\
110     ejabberd\
111     mod_perl\
112     yaz\
113     aspell-en\
114     net-fs/nfs-utils\
115     dev-libs/apr\
116     dev-db/libpq\
117     dev-db/postgresql\
118     dev-perl/Email-Send\
119     dev-perl/Cache-Memcached\
120     dev-perl/DateTime\
121     dev-perl/DateTime-TimeZone\
122     dev-perl/DBI\
123     dev-perl/DBD-Pg\
124     dev-perl/GD-Graph3d\
125     dev-perl/Log-Log4perl\
126     dev-perl/Text-Aspell\
127     dev-perl/Unix-Syslog\
128     dev-perl/XML-LibXML\
129     dev-perl/XML-LibXSLT\
130     dev-perl/XML-Simple\
131     dev-perl/Net-Jabber\
132     dev-perl/libwww-perl\
133     dev-perl/Template-Toolkit\
134     dev-perl/Error\
135         dev-perl/Text-CSV_XS\
136         dev-perl/Spreadsheet-WriteExcel\
137         dev-perl/Tie-IxHash
138
139 GENTOO_RC = \
140     ejabberd\
141     memcached\
142     portmap
143
144 GENTOO_PERL = \
145     UNIVERSAL::require\
146     Class::DBI::AbstractSearch\
147     MARC::Record \
148     Net::Z3950::ZOOM \
149         Text::CSV
150
151 DEB_APACHE_MODS = \
152     expires\
153     include\
154     proxy\
155     proxy_http\
156     rewrite\
157     ssl
158  
159
160 # generic CPAN modules
161 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\
166         Net::Z3950::ZOOM
167
168
169 # ----------------------------------------------------------------------------
170
171 all: 
172         @echo "please specify an OS" && exit 0
173
174
175 # these should be the same for any distro
176 install: install_yaz install_cpan install_js_sm install_libdbi 
177
178 debian: install_debs install debian_sys_config
179
180 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
181
182
183 # - COMMON TARGETS ---------------------------------------------------------
184
185 # Install the CPAN modules
186 install_cpan: 
187         for m in $(CPAN_MODULES); do perl -MCPAN -e "install \"$$m\";"; done
188
189
190 install_yaz:    
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
194
195 # Install the custom spidermonkey libs and JavaScript-SpiderMonkey Perl modules
196 install_js_sm: 
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 JavaScript-SpiderMonkey-0.17 && perl Makefile.PL -E4X && make && make test && make install
208
209
210 # Install libdbi and the postgres drivers
211 install_libdbi:
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  
219
220
221 clean:
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
226
227
228 # ------------------------------------------------------------------
229 # - DEBIAN ---------------------------------------------------------
230
231 debian_sys_config: 
232         # link the apache modules in
233         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
234         
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; \
239         fi;
240
241 # Install the debian-specific dependencies
242 install_debs:
243         apt-get install $(DEBS)
244
245
246
247 # ------------------------------------------------------------------
248 # - GENTOO ---------------------------------------------------------
249
250 install_gentoos:
251         emerge -n $(GENTOOS)
252
253 install_gentoo_rc:
254         for m in $(GENTOO_RC); do rc-update add $$m default; done;
255
256 install_gentoo_perl:
257         for m in $(GENTOO_PERL); do perl -MCPAN -e "install \"$$m\";"; done
258
259 # ------------------------------------------------------------------
260     
261
262