diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-15 11:38:15 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-15 13:42:04 -0400 |
commit | ecd6aa105c55994db06993bab3c967247656bacb (patch) | |
tree | 6fb59e45ce555430577ee83fc35cf1a3b8b5cad0 /contrib | |
parent | 70694ae643677327d58912d00681096b1ab86863 (diff) | |
download | sssd-ecd6aa105c55994db06993bab3c967247656bacb.tar.gz sssd-ecd6aa105c55994db06993bab3c967247656bacb.tar.bz2 sssd-ecd6aa105c55994db06993bab3c967247656bacb.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')
-rw-r--r-- | contrib/sssd.spec.in | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index e5a4ed52..9972ebbd 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: @@ -65,7 +67,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 @@ -80,7 +82,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 @@ -106,7 +108,7 @@ BuildRequires: gettext-devel BuildRequires: pkgconfig BuildRequires: findutils -%if 0%{?rhel} == 5 +%if 0%{?is_rhel5} > 0 BuildRequires: glib2-devel %else BuildRequires: libunistring-devel |