File pwdutils.spec of Package pwdutils.import4943

# spec file for package pwdutils
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

%define enable_selinux 1

Name:           pwdutils
BuildRequires:  audit-devel libnscd-devel libxcrypt-devel openldap2-devel openslp-devel openssl-devel pam-devel
%if %{enable_selinux}
BuildRequires:  libselinux-devel
License:        GPLv2
Group:          System/Base
AutoReqProv:    on
Version:        3.2.14
Release:        4.<RELEASE5>
Summary:        Utilities to Manage User and Group Accounts
Requires:       pam-modules
Requires:       libxcrypt-crypt_blowfish >= 1.2
Source:         pwdutils-%{version}.tar.bz2
Source2:        ldap.conf
Source3:        useradd.default
Source4:        baselibs.conf
Patch0:         %{name}-selinux-useradd.patch
Patch1:         pwdutils-3.2.14-CVE-2011-2483.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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.

%package plugin-audit
License:        GPLv2
Summary:        Plugin for the Linux Audit-Subsystem
Group:          System/Base
Requires:       pwdutils = %{version}
AutoReqProv:    on

%description plugin-audit
This package includes the plugin for the password/account management
utilities to use the Linux Audit-Subsystem for logging.

To enable this plugin, please add "audit" to /etc/pwdutils/logging.

%package rpasswd
License:        GPLv2
Summary:        Server/Client for secure remote password changing
Group:          System/Base
Requires:       pwdutils = %{version}
AutoReqProv:    on

%description rpasswd
This package includes the server, client and a PAM module to change the
password remote in a secure way.

%setup -q
%patch1 -p1

%configure --with-ldap-conf-file=/etc/ldap.conf \
%ifnarch hppa
	--enable-selinux \
	--disable-selinux \
	--enable-pam_rpasswd --libdir=%{_libdir}
make %{?_smp_mflags}

rm -f $RPM_BUILD_ROOT%{_libdir}/pwdutils/lib*.so
mkdir $RPM_BUILD_ROOT/%{_lib}
mv $RPM_BUILD_ROOT%{_libdir}/security $RPM_BUILD_ROOT/%{_lib}
/sbin/ldconfig -n %{_libdir}/pwdutils
rm -f $RPM_BUILD_ROOT%{_libdir}/pwdutils/*a
rm -f $RPM_BUILD_ROOT/%{_lib}/security/*a
ln -sf ../../etc/init.d/rpasswdd $RPM_BUILD_ROOT%{_sbindir}/rcrpasswdd
ln -sf newgrp $RPM_BUILD_ROOT%{_bindir}/sg
install -m 644 $RPM_SOURCE_DIR/ldap.conf $RPM_BUILD_ROOT/etc
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
# Find all translations
%{find_lang} pwdutils


%preun rpasswd
%stop_on_removal rpasswdd

%postun rpasswd
%restart_on_update rpasswdd

%files -f pwdutils.lang
%attr(0644,root,root) %config(noreplace) /etc/ldap.conf
%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
%attr (4755,root,shadow) %{_bindir}/chage
%attr (4755,root,shadow) %{_bindir}/chfn
%attr (4755,root,shadow) %{_bindir}/chsh
%attr (4755,root,shadow) %{_bindir}/expiry
%attr (4755,root,shadow) %{_bindir}/gpasswd
%attr (4755,root,root) %{_bindir}/newgrp
%attr (4755,root,shadow) %{_bindir}/passwd
%doc %{_mandir}/man1/chage.1*
%doc %{_mandir}/man1/chfn.1*
%doc %{_mandir}/man1/chsh.1*
%doc %{_mandir}/man1/expiry.1*
%doc %{_mandir}/man1/gpasswd.1*
%doc %{_mandir}/man1/newgrp.1*
%doc %{_mandir}/man1/passwd.1*
%doc %{_mandir}/man1/sg.1*
%doc %{_mandir}/man5/login.defs.5*
%doc %{_mandir}/man8/adduser.8*
%doc %{_mandir}/man8/chpasswd.8*
%doc %{_mandir}/man8/groupadd.8*
%doc %{_mandir}/man8/groupdel.8*
%doc %{_mandir}/man8/groupmod.8*
%doc %{_mandir}/man8/grpck.8*
%doc %{_mandir}/man8/grpconv.8*
%doc %{_mandir}/man8/grpunconv.8*
%doc %{_mandir}/man8/pwck.8*
%doc %{_mandir}/man8/pwconv.8*
%doc %{_mandir}/man8/pwunconv.8*
%doc %{_mandir}/man8/useradd.8*
%doc %{_mandir}/man8/userdel.8*
%doc %{_mandir}/man8/usermod.8*
%doc %{_mandir}/man8/vigr.8*
%doc %{_mandir}/man8/vipw.8*
%verify(not md5 size mtime) %config(noreplace) %{_sbindir}/groupadd.local
%verify(not md5 size mtime) %config(noreplace) %{_sbindir}/useradd.local
%verify(not md5 size mtime) %config(noreplace) %{_sbindir}/userdel-pre.local
%verify(not md5 size mtime) %config(noreplace) %{_sbindir}/userdel-post.local
%dir %{_libdir}/pwdutils

%files plugin-audit

%files rpasswd
%config(noreplace) /etc/rpasswd.conf
%config /etc/pam.d/rpasswd
%config /etc/init.d/rpasswdd
%doc %{_mandir}/man1/rpasswd.1*
%doc %{_mandir}/man1/rpasswd.1*
%doc %{_mandir}/man5/rpasswd.conf.5*
%doc %{_mandir}/man8/pam_rpasswd.8*
%doc %{_mandir}/man8/rpasswdd.8*

openSUSE Build Service is sponsored by