Adding CentOS 6 target to Makefile.install.
authorChris Sharp <csharp@georgialibraries.org>
Thu, 12 Dec 2013 02:27:59 +0000 (21:27 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 12 Dec 2013 02:27:59 +0000 (21:27 -0500)
Adding EPEL (https://fedoraproject.org/wiki/EPEL) repo to
CentOS 6 allows us to install the same RPMs as come with
Fedora.

Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
src/extras/Makefile.install

index 0d24677..47c074b 100644 (file)
@@ -19,6 +19,8 @@
 #      make -f Makefile.install ubuntu-precise
 #      - or -
 #      make -f Makefile.install fedora
+#      - or -
+#      make -f Makefile.install centos
 #
 # ---------------------------------------------------------------------
 
@@ -30,6 +32,10 @@ LBITS=$(shell getconf LONG_BIT)
 
 APT_TOOL=apt-get -yq
 
+# CentOS needs the EPEL repository
+EPEL_HOST=http://dl.fedoraproject.org/pub/epel/6/x86_64
+EPEL_PKG=epel-release-6-8.noarch.rpm
+
 # Debian dependencies
 DEBS =  \
        apache2-mpm-prefork\
@@ -80,7 +86,7 @@ DEBS =  \
        tar\
        zlib1g-dev
 
-FEDORAS = \
+RPMS = \
        autoconf \
        automake \
        check \
@@ -184,7 +190,8 @@ wheezy: install_extra_debs_wheezy
 squeeze: install_extra_debs_squeeze
 generic_debian: install_debs debian_sys_config
 
-fedora: install_fedora_rpms
+fedora: install_rpms
+centos: install_epel install_rpms
 
 ubuntu-lucid: generic_ubuntu lucid
 ubuntu-precise: generic_ubuntu precise
@@ -226,8 +233,18 @@ install_extra_debs_lucid:
 install_extra_debs_precise:
        $(APT_TOOL) install $(EXTRA_DEBS_UBUNTU_PRECISE)
 
-# Fedora
-install_fedora_rpms:
-       yum -y install $(FEDORAS)
+# CentOS
+install_epel:
+       if [ -n "$$(uname -r | grep el6)" ]; then \
+               if [ -z "$$(rpm -qa | grep epel)" ]; then \
+                       wget $(EPEL_HOST)/$(EPEL_PKG) ; \
+                       rpm -Uvh $(EPEL_PKG) ; \
+               fi; \
+       fi;
+       yum update -y
+
+# Fedora/CentOS
+install_rpms:
+       yum -y install $(RPMS)
 
 # vim:noet:sw=4:ts=4: