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