--- /dev/null
+Index: pwdutils-3.2.19/lib/read-files.c
+===================================================================
+--- pwdutils-3.2.19.orig/lib/read-files.c
++++ pwdutils-3.2.19/lib/read-files.c
+@@ -30,8 +30,14 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <nss.h>
+-#include <bits/libc-lock.h>
++#include <pthread.h>
+ #define __libc_lock_t pthread_mutex_t
++#define __libc_lock_define_initialized(CLASS,NAME) \
++ CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
++#define __libc_lock_lock(NAME) \
++ pthread_mutex_lock, (&(NAME))
++#define __libc_lock_unlock(NAME) \
++ pthread_mutex_unlock, (&(NAME))
+
+ #include "read-files.h"
+
+Index: pwdutils-3.2.19/lib/read-files-group.c
+===================================================================
+--- pwdutils-3.2.19.orig/lib/read-files-group.c
++++ pwdutils-3.2.19/lib/read-files-group.c
+@@ -32,8 +32,14 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <nss.h>
+-#include <bits/libc-lock.h>
++#include <pthread.h>
+ #define __libc_lock_t pthread_mutex_t
++#define __libc_lock_define_initialized(CLASS,NAME) \
++ CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
++#define __libc_lock_lock(NAME) \
++ pthread_mutex_lock, (&(NAME))
++#define __libc_lock_unlock(NAME) \
++ pthread_mutex_unlock, (&(NAME))
+
+ #include "read-files.h"
+
Name: pwdutils
-BuildRequires: libtool
-BuildRequires: openssl-devel
-BuildRequires: pam-devel
-BuildRequires: gettext-tools
-Url: http://www.thkukuk.de/pam/pwdutils/
Version: 3.2.19
Release: 0
-Summary: Utilities to Manage User and Group Accounts
License: GPL-2.0
+Summary: Utilities to Manage User and Group Accounts
+Url: http://www.thkukuk.de/pam/pwdutils/
Group: System/Base
Source: pwdutils-%{version}.tar.bz2
Source3: useradd.default
Patch0: pam.patch
Patch1: pwdutils-no-add-needed.patch
+Patch2: pwdutils-glibc216.patch
+BuildRequires: gettext-tools
+BuildRequires: libtool
+BuildRequires: openssl-devel
+BuildRequires: pam-devel
%description
This package includes the necessary programs for converting plain
password files to the shadow password format, and managing user and
group accounts in both local files and in an LDAP database.
-
-
-
%prep
%setup -q
%patch0 -p1
%patch1
+%patch2 -p1
%build
%reconfigure --disable-ldap --libdir=%{_libdir} --disable-nls --disable-pam_rpasswd
make %{?_smp_mflags}
%install
-make install DESTDIR=$RPM_BUILD_ROOT
-rm -f $RPM_BUILD_ROOT%{_libdir}/pwdutils/lib*.so
-mkdir $RPM_BUILD_ROOT/%{_lib}
-mv $RPM_BUILD_ROOT%{_libdir}/security $RPM_BUILD_ROOT/%{_lib}
+%make_install
+rm -f %{buildroot}%{_libdir}/pwdutils/lib*.so
+#mkdir %{buildroot}/%{_lib}
+#mv %{buildroot}%{_libdir}/security %{buildroot}/%{_lib}
/sbin/ldconfig -n %{_libdir}/pwdutils
-rm -f $RPM_BUILD_ROOT%{_libdir}/pwdutils/*a
-rm -f $RPM_BUILD_ROOT/%{_lib}/security/*a
+rm -f %{buildroot}%{_libdir}/pwdutils/*a
+rm -f %{buildroot}/%{_lib}/security/*a
-rm -f %{buildroot}/etc/init.d/rpasswdd
-rm -f %{buildroot}/etc/pam.d/rpasswd
-rm -f %{buildroot}/etc/rpasswd.conf
+rm -f %{buildroot}%{_initddir}/rpasswdd
+rm -f %{buildroot}%{_sysconfdir}/pam.d/rpasswd
+rm -f %{buildroot}%{_sysconfdir}/rpasswd.conf
rm -f %{buildroot}/usr/bin/rpasswd
rm -f %{buildroot}/usr/sbin/rpasswdd
-ln -sf newgrp $RPM_BUILD_ROOT%{_bindir}/sg
-install -m 644 $RPM_SOURCE_DIR/useradd.default $RPM_BUILD_ROOT/etc/default/useradd
-echo ".so man8/useradd.8" > $RPM_BUILD_ROOT%{_mandir}/man8/adduser.8
+ln -sf newgrp %{buildroot}%{_bindir}/sg
+install -m 644 $RPM_SOURCE_DIR/useradd.default %{buildroot}%{_sysconfdir}/default/useradd
+echo ".so man8/useradd.8" > %{buildroot}%{_mandir}/man8/adduser.8
%docs_package
-%files
+%files
%defattr(-,root,root,755)
-%config /etc/login.defs
-%config /etc/pam.d/chage
-%config /etc/pam.d/chfn
-%config /etc/pam.d/chsh
-%config /etc/pam.d/passwd
-%config /etc/pam.d/shadow
-%config /etc/pam.d/useradd
-%config(noreplace) /etc/default/useradd
-%config(noreplace) /etc/default/passwd
-%dir /etc/pwdutils
-%config(noreplace) /etc/pwdutils/logging
+%config %{_sysconfdir}/login.defs
+%config %{_sysconfdir}/pam.d/chage
+%config %{_sysconfdir}/pam.d/chfn
+%config %{_sysconfdir}/pam.d/chsh
+%config %{_sysconfdir}/pam.d/passwd
+%config %{_sysconfdir}/pam.d/shadow
+%config %{_sysconfdir}/pam.d/useradd
+%config(noreplace) %{_sysconfdir}/default/useradd
+%config(noreplace) %{_sysconfdir}/default/passwd
+%dir %{_sysconfdir}/pwdutils
+%config(noreplace) %{_sysconfdir}/pwdutils/logging
%attr (4755,root,shadow) %{_bindir}/chage
%attr (4755,root,shadow) %{_bindir}/chfn
%attr (4755,root,shadow) %{_bindir}/chsh