LP#1383828 Jessie/Trusty installer Apache "mpm" repairs
[OpenSRF.git] / src / extras / Makefile.install
1 # ---------------------------------------------------------------------
2 # Author: Bill Erickson <erickson@esilibrary.com>
3 # Author: Dan Scott <dscott@laurentian.ca>
4 #
5 # Makefile to install prerequisites for OpenSRF
6 #
7 # Currently supports Debian (jessie/wheezy/squeeze), Ubuntu (precise/trusty)
8 # and Fedora (16).
9 #
10 # Installs Perl prereqs, libjs with Perl wrapper
11 #
12 # usage:
13 #       make -f Makefile.install debian-jessie
14 #       - or -
15 #       make -f Makefile.install debian-wheezy
16 #       - or -
17 #       make -f Makefile.install debian-squeeze
18 #       - or -
19 #       make -f Makefile.install ubuntu-precise
20 #       - or -
21 #       make -f Makefile.install ubuntu-trusty
22 #       - or -
23 #       make -f Makefile.install fedora
24 #
25 # ---------------------------------------------------------------------
26
27 # Make any assumptions about the shell being used explicit
28 SHELL=/bin/bash 
29
30 # 64 or 32 bit os?
31 LBITS=$(shell getconf LONG_BIT)
32
33 APT_TOOL=apt-get -yq
34
35 # Debian dependencies
36 DEBS =  \
37         apache2-mpm-prefork\
38         apache2-prefork-dev\
39         autoconf\
40         automake\
41         build-essential\
42         check\
43         ejabberd\
44         less\
45         libapache2-mod-perl2\
46         libcache-memcached-perl\
47         libclass-dbi-abstractsearch-perl\
48         libclass-dbi-sqlite-perl\
49         libdatetime-format-builder-perl\
50         libdatetime-format-mail-perl\
51         libdatetime-perl\
52         libdatetime-timezone-perl\
53         liberror-perl\
54         libexpat1-dev\
55         libfile-find-rule-perl\
56         libgcrypt11-dev \
57         libgdbm-dev \
58         liblog-log4perl-perl\
59         libmodule-build-perl\
60         libnet-dns-perl\
61         libperl-dev\
62         libreadline-dev\
63         libtemplate-perl\
64         libtest-pod-perl\
65         libtie-ixhash-perl\
66         libtool\
67         libuniversal-require-perl\
68         libunix-syslog-perl\
69         libwww-perl\
70         libxml2-dev\
71         libxml-libxml-perl\
72         libxml-libxslt-perl\
73         libxml-simple-perl\
74         libxslt1-dev\
75         memcached\
76         pkg-config\
77         python-coverage\
78         psmisc\
79         python-dev\
80         python-libxml2\
81         python-memcache\
82         python-nose\
83         python-pyxmpp\
84         python-setuptools\
85         python-simplejson\
86         tar\
87         zlib1g-dev
88
89 FEDORAS = \
90         autoconf \
91         automake \
92         check \
93         check-devel \
94         ejabberd \
95         expat-devel \
96         gcc \
97         gdbm-devel \
98         httpd \
99         httpd-devel \
100         less \
101         libgcrypt-devel \
102         libmemcached \
103         libmemcached-devel \
104         libtool \
105         libxml2-devel \
106         libxml2-python \
107         libxslt-devel \
108         make \
109         memcached \
110         mod_perl \
111         perl-Cache-Memcached \
112         perl-Class-DBI \
113         perl-Class-DBI-AbstractSearch \
114         perl-Class-DBI-SQLite \
115         perl-DateTime-Format-Builder \
116         perl-DateTime-Format-ISO8601 \
117         perl-DateTime-Format-Mail \
118         perl-DateTime-Set \
119         perl-devel \
120         perl-Error \
121         perl-File-Find-Rule \
122         perl-JSON-XS \
123         perl-libwww-perl \
124         perl-Log-Log4perl \
125         perl-Module-Build \
126         perl-Net-DNS \
127         perl-Net-Server \
128         perl-SQL-Abstract-Limit \
129         perl-Template-Toolkit \
130         perl-Test-Deep \
131         perl-Test-Exception \
132         perl-Test-Pod \
133         perl-Tie-IxHash \
134         perl-UNIVERSAL-require \
135         perl-Unix-Syslog \
136         perl-XML-LibXML \
137         perl-XML-LibXSLT \
138         perl-XML-Simple \
139         psmisc \
140         python-devel \
141         python-dns \
142         python-memcached \
143         python-setuptools \
144         python-simplejson \
145         readline-devel \
146         tar
147
148 DEB_APACHE_MODS = \
149         ssl
150
151 EXTRA_DEBS = \
152         libdatetime-format-iso8601-perl \
153         libjson-xs-perl \
154         libnet-server-perl
155
156 EXTRA_DEBS_SQUEEZE = \
157         libmemcached-dev \
158         libmemcached-tools \
159         libxml-libxml-perl \
160         libxml-libxslt-perl
161
162 EXTRA_DEBS_WHEEZY = \
163         libmemcached-dev \
164         libmemcached-tools \
165         libxml-libxml-perl \
166         libxml-libxslt-perl \
167         libncurses5-dev
168
169 EXTRA_DEBS_JESSIE = \
170         libmemcached-dev \
171         libmemcached-tools \
172         libxml-libxml-perl \
173         libxml-libxslt-perl \
174         libncurses5-dev
175
176 EXTRA_DEBS_UBUNTU_PRECISE = \
177         libmemcached-dev\
178         libxml-libxml-perl \
179         libxml-libxslt-perl \
180         ncurses-dev
181
182 EXTRA_DEBS_UBUNTU_TRUSTY = \
183         libmemcached-dev\
184         libxml-libxml-perl \
185         libxml-libxslt-perl \
186         ncurses-dev
187
188 # ----------------------------------------------------------------------------
189
190 all: 
191         @echo "please specify an OS" && exit 0
192
193
194 debian-jessie: generic_debian jessie
195 debian-wheezy: generic_debian wheezy
196 debian-squeeze: generic_debian squeeze
197 jessie: install_extra_debs_jessie apache_mpm_prefork_mods
198 wheezy: install_extra_debs_wheezy
199 squeeze: install_extra_debs_squeeze
200 generic_debian: install_debs debian_sys_config
201
202 fedora: install_fedora_rpms
203
204 ubuntu-precise: generic_ubuntu precise
205 ubuntu-trusty: generic_ubuntu trusty apache_mpm_prefork_mods
206 precise: install_extra_debs install_extra_debs_precise
207 trusty: install_extra_debs install_extra_debs_trusty
208 generic_ubuntu: install_debs debian_sys_config
209
210 # ------------------------------------------------------------------
211 # - DEBIAN ---------------------------------------------------------
212
213 debian_sys_config: 
214         # link the apache modules in
215         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
216
217         # adds a placeholder module so apxs will be happy
218         if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
219                 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
220                         >> /etc/apache2/httpd.conf; \
221         fi;
222
223 # Install the debian-specific dependencies
224 install_debs:
225         $(APT_TOOL) install $(DEBS)
226
227 # Install the debian-specific dependencies for more modern distros
228 install_extra_debs:
229         $(APT_TOOL) install $(EXTRA_DEBS)
230
231 install_extra_debs_jessie: install_extra_debs
232         $(APT_TOOL) install $(EXTRA_DEBS_JESSIE)
233
234 install_extra_debs_wheezy: install_extra_debs
235         $(APT_TOOL) install $(EXTRA_DEBS_WHEEZY)
236
237 install_extra_debs_squeeze: install_extra_debs
238         $(APT_TOOL) install $(EXTRA_DEBS_SQUEEZE)
239
240 # Install even more packaged dependencies on modern distros
241 install_extra_debs_precise:
242         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_PRECISE)
243
244 install_extra_debs_trusty:
245         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_TRUSTY)
246
247 # Some OSes activate the Apache mpm_event module by default.
248 # OpenSRF requires prefork.
249 apache_mpm_prefork_mods:
250         a2dismod mpm_event
251         a2enmod mpm_prefork
252
253 # Fedora
254 install_fedora_rpms:
255         yum -y install $(FEDORAS)
256
257 # vim:noet:sw=4:ts=4: