Blame SPECS/nss-pam-ldapd.spec

34628c
%global nssdir /%{_lib}
34628c
%global pamdir /%{_lib}/security
34628c
34628c
%define _hardened_build 1
34628c
34628c
Name:           nss-pam-ldapd
34628c
Version:        0.9.9
34628c
Release:        3%{?dist}
34628c
Summary:        An nsswitch module which uses directory servers
34628c
License:        LGPLv2+
34628c
URL:            http://arthurdejong.org/nss-pam-ldapd/
34628c
Source0:        http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-%{version}.tar.gz
34628c
Source1:        http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-%{version}.tar.gz.sig
34628c
Source3:        nslcd.tmpfiles
34628c
Source4:        nslcd.service
34628c
34628c
# Pylint tests fail w/o certain imports and are not needed for nslcd anyway,
34628c
# plus, we don't ship the python utilities
34628c
Patch0001:      0001-Disable-pylint-tests.patch
34628c
Patch0002:      0002-Watch-for-uint32_t-overflows.patch
34628c
34628c
BuildRequires:  openldap-devel, krb5-devel
34628c
BuildRequires:  autoconf, automake
34628c
BuildRequires:  pam-devel
34628c
BuildRequires:  systemd-units
34628c
%{?systemd_requires}
34628c
34628c
# Pull in nscd, which is recommended.
34628c
Recommends:     nscd
34628c
34628c
Obsoletes:      nss-ldapd < 0.7
34628c
Provides:       nss-ldapd = %{version}-%{release}
34628c
34628c
# Obsolete PADL's nss_ldap
34628c
Provides:       nss_ldap = 265-12
34628c
Obsoletes:      nss_ldap < 265-11
34628c
34628c
# Obsolete PADL's pam_ldap
34628c
Provides:       pam_ldap = 185-15
34628c
Obsoletes:      pam_ldap < 185-15
34628c
34628c
%description
34628c
The nss-pam-ldapd daemon, nslcd, uses a directory server to look up name
34628c
service information (users, groups, etc.) on behalf of a lightweight
34628c
nsswitch module.
34628c
34628c
%prep
34628c
%autosetup -p1
34628c
autoreconf -f -i
34628c
34628c
%build
34628c
%configure --libdir=%{nssdir} \
34628c
           --disable-utils \
34628c
           --with-pam-seclib-dir=%{pamdir}
34628c
%make_build
34628c
34628c
%check
34628c
make check
34628c
34628c
%install
34628c
rm -rf $RPM_BUILD_ROOT
34628c
make install DESTDIR=$RPM_BUILD_ROOT
34628c
mkdir -p $RPM_BUILD_ROOT/{%{_libdir},%{_unitdir}}
34628c
install -p -m644 %{SOURCE4} $RPM_BUILD_ROOT/%{_unitdir}/
34628c
34628c
ln -s libnss_ldap.so.2 $RPM_BUILD_ROOT/%{nssdir}/libnss_ldap.so
34628c
34628c
sed -i -e 's,^uid.*,uid nslcd,g' -e 's,^gid.*,gid ldap,g' \
34628c
$RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
34628c
touch -r nslcd.conf $RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
34628c
mkdir -p -m 0755 $RPM_BUILD_ROOT/var/run/nslcd
34628c
mkdir -p -m 0755 $RPM_BUILD_ROOT/%{_tmpfilesdir}
34628c
install -p -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}.conf
34628c
34628c
%files
34628c
%defattr(-,root,root)
34628c
%doc AUTHORS ChangeLog COPYING HACKING NEWS README TODO
34628c
%{_sbindir}/*
34628c
%{nssdir}/*.so*
34628c
%{pamdir}/pam_ldap.so
34628c
%{_mandir}/*/*
34628c
%attr(0600,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/nslcd.conf
34628c
%attr(0644,root,root) %config(noreplace) %{_tmpfilesdir}/%{name}.conf
34628c
%{_unitdir}/nslcd.service
34628c
%attr(0775,nslcd,root) /var/run/nslcd
34628c
34628c
%pre
34628c
getent group  ldap  > /dev/null || \
34628c
/usr/sbin/groupadd -r -g 55 ldap
34628c
getent passwd nslcd > /dev/null || \
34628c
/usr/sbin/useradd -r -g ldap -c 'LDAP Client User' \
34628c
    -u 65 -d / -s /sbin/nologin nslcd 2> /dev/null || :
34628c
34628c
%post
34628c
# The usual stuff.
34628c
/sbin/ldconfig
34628c
%systemd_post nslcd.service
34628c
34628c
%preun
34628c
%systemd_preun nslcd.service
34628c
34628c
%postun
34628c
/sbin/ldconfig
34628c
%systemd_postun_with_restart nslcd.service
34628c
34628c
%changelog
34628c
* Wed May 30 2018 Jakub Hrozek <jhrozek@redhat.com> - 0.9.9-3
34628c
- Also change the pemissions on tmpfiles
34628c
- Related: rhbz#1583211 - nslcd, the local LDAP daemon, fails to start
34628c
                          with SELinux enabled
34628c
34628c
* Wed May 30 2018 Jakub Hrozek <jhrozek@redhat.com> - 0.9.9-2
34628c
- Apply a patch by Lukas Slebodnik to allow root to write to the
34628c
  /var/run/nslcd directory
34628c
- Resolves: rhbz#1583211 - nslcd, the local LDAP daemon, fails to start
34628c
                           with SELinux enabled
34628c
34628c
* Sun Apr  1 2018 Jakub Hrozek <jhrozek@redhat.com> - 0.9.9-1
34628c
- Upgrade to the latest upstream
34628c
  - Disable the python utilities
34628c
  - Don't bother with failing pylint test as we don't ship the python
34628c
    utilities
34628c
- Drop unused validname and exitcode patches, port strtoid overflow
34628c
  patch
34628c
34628c
* Sat Mar 31 2018 Jakub Hrozek <jhrozek@redhat.com> - 0.8.14-12
34628c
- Get rid of all conditions that are always true for both EPEL-7 and Fedora
34628c
  as it's quite unlikely we'd use this specfile on EPEL-6
34628c
- Remove the sysvinit script and all the scriptlets around it
34628c
- Unconditionally use systemd scriptlet macros and systemd_requires
34628c
- Unconditionally build the PAM module as the PADL module is long dead
34628c
- Remove the auto-migration of settings from nss_ldap as it's been
34628c
  long gone from Fedora
34628c
- Don't check /etc/sysconfig/authconfig as authconfig is on its way
34628c
  out from Fedora
34628c
- Use only spaces, not tabs, to stop my editor from looking like a
34628c
  Christmas tree
34628c
- Remove the obsolete Group stanza
34628c
- Make nscd Recommended, not Required
34628c
34628c
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-11
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
34628c
34628c
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-10
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
34628c
34628c
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-9
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
34628c
34628c
* Wed Feb  8 2017 Jakub Hrozek <jhrozek@redhat.com> 0.8.14-8
34628c
- Apply a patch from Stanislav Moravec to fix nslcd return code
34628c
34628c
* Tue Mar 29 2016 Nalin Dahyabhai <nalin@redhat.com> 0.8.14-7
34628c
- move the packaged tmpfiles.d file from /etc/tmpfiles.d to %%{_tmpfilesdir},
34628c
  per heads-up from Ville Skyttä on devel@
34628c
34628c
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-6
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
34628c
34628c
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.14-5
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
34628c
34628c
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.14-4
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
34628c
34628c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.14-3
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
34628c
34628c
* Wed May 07 2014 Nalin Dahyabhai <nalin@redhat.com> 0.8.14-2
34628c
- where we check for USELDAP=yes in /etc/sysconfig/authconfig as an indication
34628c
  of nss_ldap being in use, to decide whether to enable the nslcd service or
34628c
  not, also check for USELDAPAUTH=yes, which indicates pam_ldap is being used
34628c
34628c
* Sat Oct 05 2013 Jakub Hrozek <jhrozek@redhat.com>  0.8.14-1
34628c
- New upstream release 0.8.14
34628c
- Remove upstreamed patches
34628c
34628c
* Sat Oct 05 2013 Jakub Hrozek <jhrozek@redhat.com>  0.8.13-4
34628c
- Backport fixes for #1003011
34628c
34628c
* Sat Oct 05 2013 Jakub Hrozek <jhrozek@redhat.com>  0.8.13-3
34628c
- Build with _hardened_build macro
34628c
34628c
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.13-2
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
34628c
34628c
* Mon May  6 2013 Nalin Dahyabhai <nalin@redhat.com> 0.8.13-1
34628c
- update to 0.8.13
34628c
- correct a syntax error in the fix that was added for #832706
34628c
34628c
* Tue Apr 30 2013 Nalin Dahyabhai <nalin@redhat.com> 0.8.12-4
34628c
- in %%post, attempt to rewrite any instances of "map group uniqueMember ..."
34628c
  to be "map group member ..." in nslcd.conf, as the attribute name changed
34628c
  in 0.8.4 (via freeipa ticket #3589)
34628c
34628c
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.12-3
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
34628c
34628c
* Fri Jan 18 2013 Nalin Dahyabhai <nalin@redhat.com> 0.8.12-2
34628c
- drop local patch to make the client flush some more read buffers
34628c
34628c
* Fri Jan 18 2013 Nalin Dahyabhai <nalin@redhat.com> 0.8.12-1
34628c
- update to 0.8.12 (#846793)
34628c
- make building pam_ldap conditional on the targeted release
34628c
- add "After=named.service dirsrv.target slapd.service" to nslcd.service,
34628c
  to make sure that nslcd is started after them if they're to be started
34628c
  on the local system (#832706)
34628c
- alter the versioned Obsoletes: on pam_ldap to include the F18 package
34628c
- use %%{_unitdir} when deciding where to put systemd configuration, based
34628c
  on patch from Václav Pavlín (#850232)
34628c
- use new systemd macros for scriptlet hooks, when available, based on
34628c
  patch from Václav Pavlín (#850232)
34628c
34628c
* Sun Sep 09 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.17-1
34628c
- new upstream release 0.7.17
34628c
34628c
* Sun Aug 05 2012 Jakub Hrozek <jhrozek@redhat.com> - 0.7.16-5
34628c
- Obsolete PADL's nss_ldap
34628c
34628c
* Sat Aug 04 2012 Jakub Hrozek <jhrozek@redhat.com> - 0.7.16-4
34628c
- Build the PAM module, obsoletes PADL's pam-ldap (#856006)
34628c
34628c
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.16-3
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
34628c
34628c
* Mon May 14 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.16-2
34628c
- backport upstream revision r1659 related to broken pipe when
34628c
  requesting a large group
34628c
- use grep -E instead of egrep to avoid rpmlint warnings
34628c
34628c
* Sat Apr 28 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.16-1
34628c
- new upstream release 0.7.16
34628c
34628c
* Thu Mar 15 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.15-2
34628c
- Do not print "Broken Pipe" error message when requesting a large group
34628c
34628c
* Fri Mar 9 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.15-1
34628c
- new upstream release 0.7.15
34628c
34628c
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.14-3
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
34628c
34628c
* Fri Dec 16 2011 Jakub Hrozek <jhrozek@redhat.com> 0.7.14-2
34628c
- Do not overflow large UID/GID values on 32bit architectures
34628c
34628c
* Mon Nov 28 2011 Nalin Dahyabhai <nalin@redhat.com>
34628c
- use the same conditional test for deciding when to create the .so symlink as
34628c
  we do later on for deciding when to include it in the package (#757004)
34628c
34628c
* Fri Sep 23 2011 Jakub Hrozek <jhrozek@redhat.com> 0.7.14-1
34628c
- new upstream release 0.7.14
34628c
- obsoletes nss-pam-ldapd-0.7.x-buffers.patch
34628c
34628c
* Wed Aug 24 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-8
34628c
- include backported enhancement to take URIs in the form "dns:DOMAIN" in
34628c
  addition to the already-implemented "dns" (#730309)
34628c
34628c
* Thu Jul 14 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-7
34628c
- switch to only munging the contents of /etc/nslcd.conf on the very first
34628c
  install (#706454)
34628c
- make sure that we have enough space to parse any valid GID value when
34628c
  parsing a user's primary GID (#716822)
34628c
- backport support for the "validnames" option from SVN and use it to allow
34628c
  parentheses characters by modifying the default setting (#690870), then
34628c
  modify the default again to also allow shorter and shorter names to pass
34628c
  muster (#706860)
34628c
34628c
* Wed Jul 13 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-6
34628c
- convert to systemd-native startup (#716997)
34628c
34628c
* Mon Jun 13 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-5
34628c
- change the file path Requires: we have for pam_ldap into a package name
34628c
  Requires: (#601931)
34628c
34628c
* Wed Mar 30 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-4
34628c
- tag nslcd.conf with %%verify(not md5 size mtime), since we always tweak
34628c
  it in %%post (#692225)
34628c
34628c
* Tue Mar  1 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-3
34628c
- add a tmpfiles configuration to ensure that /var/run/nslcd is created when
34628c
  /var/run is completely empty at boot (#656643)
34628c
34628c
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.13-2
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
34628c
34628c
* Mon Dec 13 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-1
34628c
- update to 0.7.13
34628c
34628c
* Fri Oct 29 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.12-1
34628c
- update to 0.7.12
34628c
34628c
* Fri Oct 15 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.11-1
34628c
- update to 0.7.11
34628c
34628c
* Wed Sep 29 2010 jkeating - 0.7.10-2
34628c
- Rebuilt for gcc bug 634757
34628c
34628c
* Fri Sep 24 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.10-1
34628c
- update to 0.7.10
34628c
34628c
* Thu Sep 23 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.9-2
34628c
- when creating /var/run/nslcd in the buildroot, specify that 0755 is a
34628c
  permissions value and not another directory name (#636880)
34628c
34628c
* Mon Aug 30 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.9-1
34628c
- update to 0.7.9
34628c
34628c
* Wed Aug 18 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.8-1
34628c
- update to 0.7.8
34628c
34628c
* Wed Jul  7 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.7-1
34628c
- update to 0.7.7
34628c
34628c
* Mon Jun 28 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.6-3
34628c
- don't accidentally set multiple 'gid' settings in nslcd.conf, and try to
34628c
  clean up after older versions of this package that did (#608314)
34628c
34628c
* Thu May 27 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.6-2
34628c
- make inclusion of the .so symlink conditional on being on a sufficiently-
34628c
  new Fedora where pam_ldap isn't part of the nss_ldap package, so having
34628c
  this package conflict with nss_ldap doesn't require that pam_ldap be
34628c
  removed (#596691)
34628c
34628c
* Thu May 27 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.6-1
34628c
- update to 0.7.6
34628c
34628c
* Mon May 17 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.5-3
34628c
- switch to the upstream patch for #592411
34628c
34628c
* Fri May 14 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.5-2
34628c
- don't return an uninitialized buffer as the value for an optional attribute
34628c
  that isn't present in the directory server entry (#592411)
34628c
34628c
* Fri May 14 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.5-1
34628c
- update to 0.7.5
34628c
34628c
* Fri May 14 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.4-1
34628c
- update to 0.7.4
34628c
- stop trying to migrate retry timeout parameters from old ldap.conf files
34628c
- add an explicit requires: on nscd to make sure it's at least available on
34628c
  systems that are using nss-pam-ldapd; otherwise it's usually optional
34628c
34628c
* Tue Mar 23 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.3-1
34628c
- update to 0.7.3
34628c
34628c
* Thu Feb 25 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.2-2
34628c
- bump release for post-review commit
34628c
34628c
* Thu Feb 25 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.2-1
34628c
- add comments about why we have a .so link at all, and not a -devel subpackage
34628c
34628c
* Wed Jan 13 2010 Nalin Dahyabhai <nalin@redhat.com>
34628c
- obsolete/provides nss-ldapd
34628c
- import configuration from nss-ldapd.conf, too
34628c
34628c
* Tue Jan 12 2010 Nalin Dahyabhai <nalin@redhat.com>
34628c
- rename to nss-pam-ldapd
34628c
- also check for import settings in /etc/nss_ldap.conf and /etc/pam_ldap.conf
34628c
34628c
* Thu Sep 24 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.11-2
34628c
- rebuild
34628c
34628c
* Wed Sep 16 2009 Nalin Dahyabhai <nalin@redhat.com> 
34628c
- apply Mitchell Berger's patch to clean up the init script, use %%{_initddir},
34628c
  and correct the %%post so that it only thinks about turning on nslcd when
34628c
  we're first being installed (#522947)
34628c
- tell status() where the pidfile is when the init script is called for that
34628c
34628c
* Tue Sep  8 2009 Nalin Dahyabhai <nalin@redhat.com>
34628c
- fix typo in a comment, capitalize the full name for "LDAP Client User" (more
34628c
  from #516049)
34628c
34628c
* Wed Sep  2 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.11-1
34628c
- update to 0.6.11
34628c
34628c
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.10-4
34628c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
34628c
34628c
* Thu Jun 18 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.10-3
34628c
- update URL: and Source:
34628c
34628c
* Mon Jun 15 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.10-2
34628c
- add and own /var/run/nslcd
34628c
- convert hosts to uri during migration
34628c
34628c
* Thu Jun 11 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.10-1
34628c
- update to 0.6.10
34628c
34628c
* Fri Apr 17 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.8-1
34628c
- bump release number to 1 (part of #491767)
34628c
- fix which group we check for during %%pre (part of #491767)
34628c
34628c
* Tue Mar 24 2009 Nalin Dahyabhai <nalin@redhat.com>
34628c
- require chkconfig by package rather than path (Jussi Lehtola, part of #491767)
34628c
34628c
* Mon Mar 23 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.8-0.1
34628c
- update to 0.6.8
34628c
34628c
* Mon Mar 23 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.7-0.1
34628c
- start using a dedicated user
34628c
34628c
* Wed Mar 18 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.7-0.0
34628c
- initial package (#445965)