Skip file path adjustments on newer releases
Newer releases which don't have a separate /usr don't require any weird tricks when making symlinks from /usr/lib to /lib, and don't require us to do anything special to get PAM modules into /lib instead of /usr/lib. Still, keep paths the same as they were before on releases that went out before we made this change.
This commit is contained in:
parent
d117d3163d
commit
a080cbe21d
@ -12,6 +12,18 @@
|
|||||||
%global tmpfiles 0
|
%global tmpfiles 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# Fedora had it in F17, but moving things around in already-released versions
|
||||||
|
# is a bad idea, so pretend it didn't happen until F19.
|
||||||
|
%if 0%{?fedora} > 18 || 0%{?rhel} > 6
|
||||||
|
%global separate_usr 0
|
||||||
|
%global nssdir %{_libdir}
|
||||||
|
%global pamdir %{_libdir}/security
|
||||||
|
%else
|
||||||
|
%global separate_usr 1
|
||||||
|
%global nssdir /%{_lib}
|
||||||
|
%global pamdir /%{_lib}/security
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: nss-pam-ldapd
|
Name: nss-pam-ldapd
|
||||||
Version: 0.8.12
|
Version: 0.8.12
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
@ -70,7 +82,7 @@ nsswitch module.
|
|||||||
autoreconf -f -i
|
autoreconf -f -i
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --libdir=/%{_lib}
|
%configure --libdir=%{nssdir} --with-pam-seclib-dir=%{pamdir}
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -86,7 +98,9 @@ install -p -m755 %{SOURCE2} $RPM_BUILD_ROOT/%{_initddir}/nslcd
|
|||||||
%if %{systemd}
|
%if %{systemd}
|
||||||
install -p -m755 %{SOURCE4} $RPM_BUILD_ROOT/lib/systemd/system/
|
install -p -m755 %{SOURCE4} $RPM_BUILD_ROOT/lib/systemd/system/
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?fedora} > 13 || 0%{?rhel} > 5
|
%if 0%{?fedora} > 13 || 0%{?rhel} > 5
|
||||||
|
%if %{separate_usr}
|
||||||
# Follow glibc's convention and provide a .so symlink so that people who know
|
# Follow glibc's convention and provide a .so symlink so that people who know
|
||||||
# what to expect can link directly with the module.
|
# what to expect can link directly with the module.
|
||||||
if test %{_libdir} != /%{_lib} ; then
|
if test %{_libdir} != /%{_lib} ; then
|
||||||
@ -99,7 +113,11 @@ if test %{_libdir} != /%{_lib} ; then
|
|||||||
$RPM_BUILD_ROOT/%{_libdir}/libnss_ldap.so
|
$RPM_BUILD_ROOT/%{_libdir}/libnss_ldap.so
|
||||||
rm $RPM_BUILD_ROOT/rootfile
|
rm $RPM_BUILD_ROOT/rootfile
|
||||||
fi
|
fi
|
||||||
|
%else
|
||||||
|
ln -s libnss_ldap.so.2 $RPM_BUILD_ROOT/%{nssdir}/libnss_ldap.so
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
sed -i -e 's,^uid.*,uid nslcd,g' -e 's,^gid.*,gid ldap,g' \
|
sed -i -e 's,^uid.*,uid nslcd,g' -e 's,^gid.*,gid ldap,g' \
|
||||||
$RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
|
$RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
|
||||||
touch -r nslcd.conf $RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
|
touch -r nslcd.conf $RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
|
||||||
@ -116,8 +134,8 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc AUTHORS ChangeLog COPYING HACKING NEWS README TODO
|
%doc AUTHORS ChangeLog COPYING HACKING NEWS README TODO
|
||||||
%{_sbindir}/*
|
%{_sbindir}/*
|
||||||
/%{_lib}/*.so.*
|
%{nssdir}/*.so.*
|
||||||
/%{_lib}/security/pam_ldap.so
|
%{pamdir}/pam_ldap.so
|
||||||
%{_mandir}/*/*
|
%{_mandir}/*/*
|
||||||
%attr(0600,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/nslcd.conf
|
%attr(0600,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/nslcd.conf
|
||||||
%if %{tmpfiles}
|
%if %{tmpfiles}
|
||||||
|
Loading…
Reference in New Issue
Block a user