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 http://bugs.opensuse.org/
#

# 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
%endif
Url:            http://www.thkukuk.de/pam/pwdutils/
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

%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.



%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.



%prep
%setup -q
%patch0
%patch1 -p1

%build
%configure --with-ldap-conf-file=/etc/ldap.conf \
%ifnarch hppa
	--enable-selinux \
%else
	--disable-selinux \
%endif
	--enable-pam_rpasswd --libdir=%{_libdir}
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}
/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

%clean
rm -rf $RPM_BUILD_ROOT

%preun rpasswd
%stop_on_removal rpasswdd

%postun rpasswd
%restart_on_update rpasswdd
%insserv_cleanup

%files -f pwdutils.lang
%defattr(-,root,root,755)
%doc AUTHORS NEWS README THANKS
%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
%{_bindir}/sg
%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*
%{_sbindir}/chpasswd
%{_sbindir}/groupadd
%{_sbindir}/groupdel
%{_sbindir}/groupmod
%{_sbindir}/grpck
%{_sbindir}/grpconv
%{_sbindir}/grpunconv
%{_sbindir}/pwck
%{_sbindir}/pwconv
%{_sbindir}/pwunconv
%{_sbindir}/useradd
%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
%{_sbindir}/userdel
%{_sbindir}/usermod
%{_sbindir}/vigr
%{_sbindir}/vipw
%dir %{_libdir}/pwdutils
%{_libdir}/pwdutils/liblog_syslog.so.1*

%files plugin-audit
%defattr(-,root,root,755)
%{_libdir}/pwdutils/liblog_audit.so.1*

%files rpasswd
%defattr(-,root,root,755)
%config(noreplace) /etc/rpasswd.conf
%config /etc/pam.d/rpasswd
%config /etc/init.d/rpasswdd
/%{_lib}/security/pam_rpasswd.so
%{_bindir}/rpasswd
%{_sbindir}/rcrpasswdd
%{_sbindir}/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*

%changelog
openSUSE Build Service is sponsored by