edf2641d3df3e62bfd4ebda26375c73a5446526b
[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         autoconf\
36         automake\
37         build-essential\
38         check\
39         ejabberd\
40         less\
41         libapache2-mod-perl2\
42         libcache-memcached-perl\
43         libclass-dbi-abstractsearch-perl\
44         libclass-dbi-sqlite-perl\
45         libdatetime-format-builder-perl\
46         libdatetime-format-mail-perl\
47         libdatetime-perl\
48         libdatetime-timezone-perl\
49         liberror-perl\
50         libexpat1-dev\
51         libfile-find-rule-perl\
52         libgcrypt11-dev \
53         libgdbm-dev \
54         liblog-log4perl-perl\
55     libmemcached-dev \
56     libmemcached-tools \
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         libxml-libxml-perl \
104         libxml-libxslt-perl \
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_WHEEZY = \
157     apache2-mpm-prefork \
158     apache2-prefork-dev \
159         libncurses5-dev
160
161 EXTRA_DEBS_JESSIE = \
162         apache2-mpm-prefork \
163         apache2-prefork-dev \
164         libncurses5-dev
165
166 EXTRA_DEBS_UBUNTU_PRECISE = \
167         apache2-mpm-prefork \
168         apache2-prefork-dev \
169         ncurses-dev
170
171 EXTRA_DEBS_UBUNTU_TRUSTY = \
172         apache2-mpm-prefork \
173         apache2-prefork-dev \
174         ncurses-dev
175
176 EXTRA_DEBS_UBUNTU_XENIAL = \
177         apache2 \
178         libncurses5-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 ubuntu-xenial: generic_ubuntu xenial apache_mpm_prefork_mods
197 precise: install_extra_debs install_extra_debs_precise
198 trusty: install_extra_debs install_extra_debs_trusty
199 xenial: install_extra_debs
200 generic_ubuntu: install_debs debian_sys_config
201
202 # ------------------------------------------------------------------
203 # - DEBIAN ---------------------------------------------------------
204
205 debian_sys_config: 
206         # link the apache modules in
207         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
208
209         # adds a placeholder module so apxs will be happy
210         if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
211                 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
212                         >> /etc/apache2/httpd.conf; \
213         fi;
214
215 # Install the debian-specific dependencies
216 install_debs:
217         $(APT_TOOL) install $(DEBS)
218
219 # Install the debian-specific dependencies for more modern distros
220 install_extra_debs:
221         $(APT_TOOL) install $(EXTRA_DEBS)
222
223 install_extra_debs_jessie: install_extra_debs
224         $(APT_TOOL) install $(EXTRA_DEBS_JESSIE)
225
226 install_extra_debs_wheezy: install_extra_debs
227         $(APT_TOOL) install $(EXTRA_DEBS_WHEEZY)
228
229 # Install even more packaged dependencies on modern distros
230 install_extra_debs_precise:
231         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_PRECISE)
232
233 install_extra_debs_trusty:
234         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_TRUSTY)
235
236 # Some OSes activate the Apache mpm_event module by default.
237 # OpenSRF requires prefork.
238 apache_mpm_prefork_mods:
239         a2dismod mpm_event
240         a2enmod mpm_prefork
241
242 # Fedora
243 install_fedora_rpms:
244         yum -y install $(FEDORAS)
245
246 # vim:noet:sw=4:ts=4: