]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/extras/Makefile.install
1a2a63c0e6fd42732b2ce436efd2214adbf4aaf0
[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         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         libxml-libxml-perl \
106         libxml-libxslt-perl \
107         libxml2-devel \
108         libxml2-python \
109         libxslt-devel \
110         make \
111         memcached \
112         mod_perl \
113         perl-Cache-Memcached \
114         perl-Class-DBI \
115         perl-Class-DBI-AbstractSearch \
116         perl-Class-DBI-SQLite \
117         perl-DateTime-Format-Builder \
118         perl-DateTime-Format-ISO8601 \
119         perl-DateTime-Format-Mail \
120         perl-DateTime-Set \
121         perl-devel \
122         perl-Error \
123         perl-File-Find-Rule \
124         perl-JSON-XS \
125         perl-libwww-perl \
126         perl-Log-Log4perl \
127         perl-Module-Build \
128         perl-Net-DNS \
129         perl-Net-Server \
130         perl-SQL-Abstract-Limit \
131         perl-Template-Toolkit \
132         perl-Test-Deep \
133         perl-Test-Exception \
134         perl-Test-Pod \
135         perl-Tie-IxHash \
136         perl-UNIVERSAL-require \
137         perl-Unix-Syslog \
138         perl-XML-LibXML \
139         perl-XML-LibXSLT \
140         perl-XML-Simple \
141         psmisc \
142         python-devel \
143         python-dns \
144         python-memcached \
145         python-setuptools \
146         python-simplejson \
147         readline-devel \
148         tar
149
150 DEB_APACHE_MODS = \
151         ssl
152
153 EXTRA_DEBS = \
154         libdatetime-format-iso8601-perl \
155         libjson-xs-perl \
156         libnet-server-perl
157
158 EXTRA_DEBS_WHEEZY = \
159         apache2-mpm-prefork \
160         apache2-prefork-dev \
161         libncurses5-dev
162
163 EXTRA_DEBS_JESSIE = \
164         apache2-mpm-prefork \
165         apache2-prefork-dev \
166         libncurses5-dev
167
168 EXTRA_DEBS_DEBIAN_STRETCH = \
169         apache2 \
170         apache2-dev \
171         libncurses5-dev
172
173 EXTRA_DEBS_UBUNTU_TRUSTY = \
174         apache2-mpm-prefork \
175         apache2-prefork-dev \
176         ncurses-dev
177
178 EXTRA_DEBS_UBUNTU_XENIAL = \
179         apache2 \
180         apache2-dev \
181         libncurses5-dev
182
183 # ----------------------------------------------------------------------------
184
185 all: 
186         @echo "please specify an OS" && exit 0
187
188
189 debian-stretch: generic_debian stretch apache_mpm_prefork_mods apache_perl_mod
190 debian-jessie: generic_debian jessie apache_mpm_prefork_mods
191 debian-wheezy: generic_debian wheezy
192 stretch: install_extra_debs install_extra_debs_stretch debian_sys_config
193 jessie: install_extra_debs_jessie debian_sys_config
194 wheezy: install_extra_debs_wheezy debian_sys_config
195 generic_debian: install_debs
196
197 fedora: install_fedora_rpms
198
199 ubuntu-trusty: generic_ubuntu trusty apache_mpm_prefork_mods
200 ubuntu-xenial: generic_ubuntu xenial apache_mpm_prefork_mods apache_perl_mod
201 trusty: install_extra_debs install_extra_debs_trusty debian_sys_config
202 xenial: install_extra_debs install_extra_debs_xenial debian_sys_config
203 generic_ubuntu: install_debs
204
205 # ------------------------------------------------------------------
206 # - DEBIAN ---------------------------------------------------------
207
208 debian_sys_config: 
209         # link the apache modules in
210         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
211
212 # Install the debian-specific dependencies
213 install_debs:
214         $(APT_TOOL) install $(DEBS)
215
216 # Install the debian-specific dependencies for more modern distros
217 install_extra_debs:
218         $(APT_TOOL) install $(EXTRA_DEBS)
219
220 install_extra_debs_stretch:
221         $(APT_TOOL) install $(EXTRA_DEBS_DEBIAN_STRETCH)
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_trusty:
231         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_TRUSTY)
232
233 install_extra_debs_xenial:
234         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_XENIAL)
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 # Need to activate mod_perl on some O/S.
243 apache_perl_mod:
244         a2enmod perl
245
246 # Fedora
247 install_fedora_rpms:
248         yum -y install $(FEDORAS)
249
250 # vim:noet:sw=4:ts=4: