]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/extras/Makefile.install
LP#1777180: Add zip/unzip to prerequisites
[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 (trusty/xenial)
8 # and Fedora (16).
9 #
10 # Installs Perl prereqs, libjs with Perl wrapper
11 #
12 # usage:
13 #       make -f Makefile.install debian-stretch
14 #       - or -
15 #       make -f Makefile.install debian-jessie
16 #       - or -
17 #       make -f Makefile.install debian-wheezy
18 #       - or -
19 #       make -f Makefile.install ubuntu-trusty
20 #       - or -
21 #       make -f Makefile.install ubuntu-xenial
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         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         libmemcached-dev \
58         libmemcached-tools \
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         unzip\
88         zip\
89         zlib1g-dev
90
91 FEDORAS = \
92         autoconf \
93         automake \
94         check \
95         check-devel \
96         ejabberd \
97         expat-devel \
98         gcc \
99         gdbm-devel \
100         httpd \
101         httpd-devel \
102         less \
103         libgcrypt-devel \
104         libmemcached \
105         libmemcached-devel \
106         libtool \
107         libxml-libxml-perl \
108         libxml-libxslt-perl \
109         libxml2-devel \
110         libxml2-python \
111         libxslt-devel \
112         make \
113         memcached \
114         mod_perl \
115         perl-Cache-Memcached \
116         perl-Class-DBI \
117         perl-Class-DBI-AbstractSearch \
118         perl-Class-DBI-SQLite \
119         perl-DateTime-Format-Builder \
120         perl-DateTime-Format-ISO8601 \
121         perl-DateTime-Format-Mail \
122         perl-DateTime-Set \
123         perl-devel \
124         perl-Error \
125         perl-File-Find-Rule \
126         perl-JSON-XS \
127         perl-libwww-perl \
128         perl-Log-Log4perl \
129         perl-Module-Build \
130         perl-Net-DNS \
131         perl-Net-Server \
132         perl-SQL-Abstract-Limit \
133         perl-Template-Toolkit \
134         perl-Test-Deep \
135         perl-Test-Exception \
136         perl-Test-Pod \
137         perl-Tie-IxHash \
138         perl-UNIVERSAL-require \
139         perl-Unix-Syslog \
140         perl-XML-LibXML \
141         perl-XML-LibXSLT \
142         perl-XML-Simple \
143         psmisc \
144         python-devel \
145         python-dns \
146         python-memcached \
147         python-setuptools \
148         python-simplejson \
149         readline-devel \
150         tar
151
152 DEB_APACHE_MODS = \
153         ssl
154
155 EXTRA_DEBS = \
156         libdatetime-format-iso8601-perl \
157         libjson-xs-perl \
158         libnet-server-perl
159
160 EXTRA_DEBS_WHEEZY = \
161         apache2-mpm-prefork \
162         apache2-prefork-dev \
163         libncurses5-dev
164
165 EXTRA_DEBS_JESSIE = \
166         apache2-mpm-prefork \
167         apache2-prefork-dev \
168         libncurses5-dev
169
170 EXTRA_DEBS_DEBIAN_STRETCH = \
171         apache2 \
172         apache2-dev \
173         libncurses5-dev
174
175 EXTRA_DEBS_UBUNTU_TRUSTY = \
176         apache2-mpm-prefork \
177         apache2-prefork-dev \
178         ncurses-dev
179
180 EXTRA_DEBS_UBUNTU_XENIAL = \
181         apache2 \
182         apache2-dev \
183         libncurses5-dev
184
185 # ----------------------------------------------------------------------------
186
187 all: 
188         @echo "please specify an OS" && exit 0
189
190
191 debian-stretch: generic_debian stretch apache_mpm_prefork_mods apache_perl_mod
192 debian-jessie: generic_debian jessie apache_mpm_prefork_mods
193 debian-wheezy: generic_debian wheezy
194 stretch: install_extra_debs install_extra_debs_stretch debian_sys_config
195 jessie: install_extra_debs_jessie debian_sys_config
196 wheezy: install_extra_debs_wheezy debian_sys_config
197 generic_debian: install_debs
198
199 fedora: install_fedora_rpms
200
201 ubuntu-trusty: generic_ubuntu trusty apache_mpm_prefork_mods
202 ubuntu-xenial: generic_ubuntu xenial apache_mpm_prefork_mods apache_perl_mod
203 trusty: install_extra_debs install_extra_debs_trusty debian_sys_config
204 xenial: install_extra_debs install_extra_debs_xenial debian_sys_config
205 generic_ubuntu: install_debs
206
207 # ------------------------------------------------------------------
208 # - DEBIAN ---------------------------------------------------------
209
210 debian_sys_config: 
211         # link the apache modules in
212         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
213
214 # Install the debian-specific dependencies
215 install_debs:
216         $(APT_TOOL) install $(DEBS)
217
218 # Install the debian-specific dependencies for more modern distros
219 install_extra_debs:
220         $(APT_TOOL) install $(EXTRA_DEBS)
221
222 install_extra_debs_stretch:
223         $(APT_TOOL) install $(EXTRA_DEBS_DEBIAN_STRETCH)
224
225 install_extra_debs_jessie: install_extra_debs
226         $(APT_TOOL) install $(EXTRA_DEBS_JESSIE)
227
228 install_extra_debs_wheezy: install_extra_debs
229         $(APT_TOOL) install $(EXTRA_DEBS_WHEEZY)
230
231 # Install even more packaged dependencies on modern distros
232 install_extra_debs_trusty:
233         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_TRUSTY)
234
235 install_extra_debs_xenial:
236         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_XENIAL)
237
238 # Some OSes activate the Apache mpm_event module by default.
239 # OpenSRF requires prefork.
240 apache_mpm_prefork_mods:
241         a2dismod mpm_event
242         a2enmod mpm_prefork
243
244 # Need to activate mod_perl on some O/S.
245 apache_perl_mod:
246         a2enmod perl
247
248 # Fedora
249 install_fedora_rpms:
250         yum -y install $(FEDORAS)
251
252 # vim:noet:sw=4:ts=4: