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