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