50b3cc131f9970002dfdc915214552aac9de8040
[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 (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-squeeze
14 #       - or -
15 #       make -f Makefile.install ubuntu-lucid
16 #       - or -
17 #       make -f Makefile.install ubuntu-precise
18 #       - or -
19 #       make -f Makefile.install fedora
20 #
21 # ---------------------------------------------------------------------
22
23 # Make any assumptions about the shell being used explicit
24 SHELL=/bin/bash 
25
26 # 64 or 32 bit os?
27 LBITS=$(shell getconf LONG_BIT)
28
29 APT_TOOL=apt-get -yq
30
31 # Debian dependencies
32 DEBS =  \
33         apache2-mpm-prefork\
34         apache2-prefork-dev\
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         libmodule-build-perl\
56         libnet-dns-perl\
57         libnet-jabber-perl\
58         libperl-dev\
59         libreadline-dev\
60         librpc-xml-perl\
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         psmisc\
76         python-dev\
77         python-libxml2\
78         python-setuptools\
79         tar\
80         zlib1g-dev
81
82 FEDORAS = \
83         autoconf \
84         automake \
85         check \
86         check-devel \
87         ejabberd \
88         expat-devel \
89         gcc \
90         gdbm-devel \
91         httpd \
92         httpd-devel \
93         less \
94         libgcrypt-devel \
95         libmemcached \
96         libmemcached-devel \
97         libtool \
98         libxml2-devel \
99         libxml2-python \
100         libxslt-devel \
101         make \
102         memcached \
103         mod_perl \
104         perl-Cache-Memcached \
105         perl-Class-DBI \
106         perl-Class-DBI-AbstractSearch \
107         perl-Class-DBI-SQLite \
108         perl-DateTime-Format-Builder \
109         perl-DateTime-Format-ISO8601 \
110         perl-DateTime-Format-Mail \
111         perl-DateTime-Set \
112         perl-devel \
113         perl-Error \
114         perl-File-Find-Rule \
115         perl-JSON-XS \
116         perl-libwww-perl \
117         perl-Log-Log4perl \
118         perl-Module-Build \
119         perl-Net-DNS \
120         perl-Net-Jabber \
121         perl-Net-Server \
122         perl-RPC-XML \
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_UBUNTU_LUCID = \
158         libmemcached-dev\
159         libxml-libxml-perl \
160         libxml-libxslt-perl
161
162 EXTRA_DEBS_UBUNTU_PRECISE = \
163         libmemcached-dev\
164         libxml-libxml-perl \
165         libxml-libxslt-perl \
166         ncurses-dev
167
168 # ----------------------------------------------------------------------------
169
170 all: 
171         @echo "please specify an OS" && exit 0
172
173
174 debian-squeeze: generic_debian squeeze
175 squeeze: install_extra_debs_squeeze
176 generic_debian: install_debs debian_sys_config
177
178 fedora: install_fedora_rpms
179
180 ubuntu-lucid: generic_ubuntu lucid
181 ubuntu-precise: generic_ubuntu precise
182 lucid: install_extra_debs install_extra_debs_lucid
183 precise: install_extra_debs install_extra_debs_precise
184 generic_ubuntu: install_debs debian_sys_config
185
186 # ------------------------------------------------------------------
187 # - DEBIAN ---------------------------------------------------------
188
189 debian_sys_config: 
190         # link the apache modules in
191         for m in $(DEB_APACHE_MODS); do a2enmod $$m; done;
192
193         # adds a placeholder module so apxs will be happy
194         if [ ! "$$(grep mod_placeholder /etc/apache2/httpd.conf)" ]; then \
195                 echo -e "#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so" \
196                         >> /etc/apache2/httpd.conf; \
197         fi;
198
199 # Install the debian-specific dependencies
200 install_debs:
201         $(APT_TOOL) install $(DEBS)
202
203 # Install the debian-specific dependencies for more modern distros
204 install_extra_debs:
205         $(APT_TOOL) install $(EXTRA_DEBS)
206
207 install_extra_debs_squeeze: install_extra_debs
208         $(APT_TOOL) install $(EXTRA_DEBS_SQUEEZE)
209
210 # Install even more packaged dependencies on modern distros
211 install_extra_debs_lucid:
212         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_LUCID)
213
214 install_extra_debs_precise:
215         $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_PRECISE)
216
217 # Fedora
218 install_fedora_rpms:
219         yum -y install $(FEDORAS)
220
221 # vim:noet:sw=4:ts=4: