LP#1162907: don't require installing RPC::XML
[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 (wheezy/squeeze), Ubuntu (lucid/precise)
8 # and Fedora (16).
9 #
10 # Installs Perl prereqs, libjs with Perl wrapper
11 #
12 # usage:
13 #       make -f Makefile.install debian-wheezy
14 #       - or -
15 #       make -f Makefile.install debian-squeeze
16 #       - or -
17 #       make -f Makefile.install ubuntu-lucid
18 #       - or -
19 #       make -f Makefile.install ubuntu-precise
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         libnet-jabber-perl\
60         libperl-dev\
61         libreadline-dev\
62         libtemplate-perl\
63         libtest-pod-perl\
64         libtie-ixhash-perl\
65         libtool\
66         libuniversal-require-perl\
67         libunix-syslog-perl\
68         libwww-perl\
69         libxml2-dev\
70         libxml-libxml-perl\
71         libxml-libxslt-perl\
72         libxml-simple-perl\
73         libxslt1-dev\
74         memcached\
75         pkg-config\
76         psmisc\
77         python-dev\
78         python-libxml2\
79         python-setuptools\
80         tar\
81         zlib1g-dev
82
83 FEDORAS = \
84         autoconf \
85         automake \
86         check \
87         check-devel \
88         ejabberd \
89         expat-devel \
90         gcc \
91         gdbm-devel \
92         httpd \
93         httpd-devel \
94         less \
95         libgcrypt-devel \
96         libmemcached \
97         libmemcached-devel \
98         libtool \
99         libxml2-devel \
100         libxml2-python \
101         libxslt-devel \
102         make \
103         memcached \
104         mod_perl \
105         perl-Cache-Memcached \
106         perl-Class-DBI \
107         perl-Class-DBI-AbstractSearch \
108         perl-Class-DBI-SQLite \
109         perl-DateTime-Format-Builder \
110         perl-DateTime-Format-ISO8601 \
111         perl-DateTime-Format-Mail \
112         perl-DateTime-Set \
113         perl-devel \
114         perl-Error \
115         perl-File-Find-Rule \
116         perl-JSON-XS \
117         perl-libwww-perl \
118         perl-Log-Log4perl \
119         perl-Module-Build \
120         perl-Net-DNS \
121         perl-Net-Jabber \
122         perl-Net-Server \
123         perl-SQL-Abstract-Limit \
124         perl-Template-Toolkit \
125         perl-Test-Deep \
126         perl-Test-Exception \
127         perl-Test-Pod \
128         perl-Tie-IxHash \
129         perl-UNIVERSAL-require \
130         perl-Unix-Syslog \
131         perl-XML-LibXML \
132         perl-XML-LibXSLT \
133         perl-XML-Simple \
134         psmisc \
135         python-devel \
136         python-dns \
137         python-memcached \
138         python-setuptools \
139         python-simplejson \
140         readline-devel \
141         tar
142
143 DEB_APACHE_MODS = \
144         ssl
145
146 EXTRA_DEBS = \
147         libdatetime-format-iso8601-perl \
148         libjson-xs-perl \
149         libnet-server-perl
150
151 EXTRA_DEBS_SQUEEZE = \
152         libmemcached-dev \
153         libmemcached-tools \
154         libxml-libxml-perl \
155         libxml-libxslt-perl
156
157 EXTRA_DEBS_WHEEZY = \
158         libmemcached-dev \
159         libmemcached-tools \
160         libxml-libxml-perl \
161         libxml-libxslt-perl \
162         libncurses5-dev
163
164 EXTRA_DEBS_UBUNTU_LUCID = \
165         libmemcached-dev\
166         libxml-libxml-perl \
167         libxml-libxslt-perl
168
169 EXTRA_DEBS_UBUNTU_PRECISE = \
170         libmemcached-dev\
171         libxml-libxml-perl \
172         libxml-libxslt-perl \
173         ncurses-dev
174
175 # ----------------------------------------------------------------------------
176
177 all: 
178         @echo "please specify an OS" && exit 0
179
180
181 debian-wheezy: generic_debian wheezy
182 debian-squeeze: generic_debian squeeze
183 wheezy: install_extra_debs_wheezy
184 squeeze: install_extra_debs_squeeze
185 generic_debian: install_debs debian_sys_config
186
187 fedora: install_fedora_rpms
188
189 ubuntu-lucid: generic_ubuntu lucid
190 ubuntu-precise: generic_ubuntu precise
191 lucid: install_extra_debs install_extra_debs_lucid
192 precise: install_extra_debs install_extra_debs_precise
193 generic_ubuntu: install_debs debian_sys_config
194
195 # ------------------------------------------------------------------
196 # - DEBIAN ---------------------------------------------------------
197
198 debian_sys_config: 
199         # link the apache modules in
200         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
201
202         # adds a placeholder module so apxs will be happy
203         if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
204                 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
205                         >> /etc/apache2/httpd.conf; \
206         fi;
207
208 # Install the debian-specific dependencies
209 install_debs:
210         $(APT_TOOL) install $(DEBS)
211
212 # Install the debian-specific dependencies for more modern distros
213 install_extra_debs:
214         $(APT_TOOL) install $(EXTRA_DEBS)
215
216 install_extra_debs_wheezy: install_extra_debs
217         $(APT_TOOL) install $(EXTRA_DEBS_WHEEZY)
218
219 install_extra_debs_squeeze: install_extra_debs
220         $(APT_TOOL) install $(EXTRA_DEBS_SQUEEZE)
221
222 # Install even more packaged dependencies on modern distros
223 install_extra_debs_lucid:
224         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_LUCID)
225
226 install_extra_debs_precise:
227         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_PRECISE)
228
229 # Fedora
230 install_fedora_rpms:
231         yum -y install $(FEDORAS)
232
233 # vim:noet:sw=4:ts=4: