summaryrefslogtreecommitdiffstats
path: root/contrib/sssd.spec.in
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-05-15 11:38:15 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-05-15 13:42:29 -0400
commit7e4457f9a9245502685da14e04c0a3439ba01bc1 (patch)
treef51d0490893f9adcc9511dc2b6a23519bf87b0c4 /contrib/sssd.spec.in
parent0078eb3388ac62bb8f6ebf42ff929d681057dd74 (diff)
downloadsssd-7e4457f9a9245502685da14e04c0a3439ba01bc1.tar.gz
sssd-7e4457f9a9245502685da14e04c0a3439ba01bc1.tar.xz
sssd-7e4457f9a9245502685da14e04c0a3439ba01bc1.zip
RPM: Allow running 'make rpms' on RHEL 5 machines
Our previous detection for this was flawed, because the %{rhel} macro did not exist on the version of RPM shipped with RHEL 5, but it worked when building for RHEL 5 through mock. This new patch relies on grepping /etc/redhat-release for the version information. https://fedorahosted.org/sssd/ticket/1206
Diffstat (limited to 'contrib/sssd.spec.in')
-rw-r--r--contrib/sssd.spec.in12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index 583ccbff4..0c171657b 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -3,8 +3,10 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
-%if (0%{?rhel} == 5)
-%{!?is_rhel57: %global is_rhel57 %(%{__grep} -c "5\.[^0-6]" /etc/redhat-release)}
+%global is_rhel5 %(%{__grep} -c "release 5" /etc/redhat-release)
+%global rhel5_minor %(%{__grep} -o "5.[0-9]*" /etc/redhat-release |%{__sed} -s 's/5.//')
+
+%if 0%{?is_rhel5} > 0
%global with_unicode_lib --with-unicode-lib=glib2
# we don't want to provide private python extension libs
%{?filter_setup:
@@ -63,7 +65,7 @@ BuildRequires: automake
BuildRequires: libtool
BuildRequires: m4
%{?fedora:BuildRequires: popt-devel}
-%if 0%{?rhel} <= 5
+%if 0%{?is_rhel5} > 0
BuildRequires: popt
%endif
%if 0%{?rhel} >= 6
@@ -78,7 +80,7 @@ BuildRequires: libcollection-devel
BuildRequires: libini_config-devel
BuildRequires: dbus-devel
BuildRequires: dbus-libs
-%if 0%{?is_rhel57} > 0
+%if 0%{?rhel5_minor} >= 7
BuildRequires: openldap24-libs-devel
%else
BuildRequires: openldap-devel
@@ -104,7 +106,7 @@ BuildRequires: gettext-devel
BuildRequires: pkgconfig
BuildRequires: findutils
-%if 0%{?rhel} == 5
+%if 0%{?is_rhel5} > 0
BuildRequires: glib2-devel
%else
BuildRequires: libunistring-devel