File pam-modules.spec of Package pam-modules.import4943
#
# spec file for package pam-modules
#
# 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
%if %{suse_version} >= 1100
%define enable_selinux 1
%else
%define enable_selinux 0
%endif
Name: pam-modules
Summary: Additional PAM Modules
Version: 11.4
Release: 3.<RELEASE4>
License: BSD3c ; GPLv2+
Group: System/Libraries
AutoReqProv: on
#
Source0: pam_unix2-2.7.4.tar.bz2
Source1: pam_pwcheck-3.12.5.tar.bz2
Source2: pam_homecheck-2.0.tar.bz2
Source5: pam_make-1.2.tar.bz2
Source6: baselibs.conf
Source21: unix2_chkpwd.c
Source41: unix2_chkpwd.8
Source50: dlopen.sh
#
Patch: pam-modules-10.3-pam_make-fix-open.dif
Patch1: pam_unix2-2.7.4-CVE-2011-2483.diff
Patch2: pam_unix2-2.7.4-retvalmagic.diff
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: permissions
Requires: libxcrypt-crypt_blowfish >= 1.2
BuildRequires: libxcrypt-devel pam-devel
BuildRequires: cracklib-devel
%if %{enable_selinux}
BuildRequires: libselinux-devel
%endif
# bug437293
%ifarch ppc64
Obsoletes: pam-modules-64bit
%endif
%description
PAM (Pluggable Authentication Modules) is a system security tool that
allows system administrators to set authentication policies without
having to recompile programs that do authentication.
This package contains additional PAM Modules, which are necessary for a
working SuSE Linux System: pam_unix2, pam_pwcheck and pam_homecheck
%prep
%setup -q -c %{name} -b1 -b2 -b5
%patch
%patch1 -p0
%patch2 -p0
%build
pushd pam_unix2-*
autoreconf -f
popd
for i in * ; do
cd $i;
CFLAGS="$RPM_OPT_FLAGS" ./configure --enable-selinux \
--enable-blowfish-bug-compatmode \
--libdir=/%{_lib} --mandir=%{_mandir}
make %{?_smp_mflags}
cd ..
done
gcc -o $RPM_BUILD_DIR/unix2_chkpwd $RPM_OPT_FLAGS %{SOURCE21} -lpam
%install
mkdir -p $RPM_BUILD_ROOT/sbin
install -m 755 $RPM_BUILD_DIR/unix2_chkpwd $RPM_BUILD_ROOT/sbin/
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}
for i in * ; do
cd $i;
make DESTDIR=$RPM_BUILD_ROOT install
cd ..
done
#
# Remove stuff we don't wish to have now:
#
rm -rf $RPM_BUILD_ROOT/usr/{include,lib}
rm -rf $RPM_BUILD_ROOT/%{_lib}/security/*.la
# Check for module problems. Specifically, check that every module we just
# installed can actually be loaded by a minimal PAM-aware application.
for module in $RPM_BUILD_ROOT/%{_lib}/security/pam*.so ; do
if ! sh $RPM_SOURCE_DIR/dlopen.sh -lpam -ldl ${module} ; then
exit 1
fi
done
#
# Install READMEs of PAM modules
#
DOC=$RPM_BUILD_ROOT%{_defaultdocdir}/pam
mkdir -p $DOC/modules
for i in pam_*/README ; do
cp -fpv ${i} $DOC/modules/README.`dirname ${i}`
done
install -m 644 $RPM_SOURCE_DIR/unix2_chkpwd.8 $RPM_BUILD_ROOT%{_mandir}/man8/
# Remove default/passwd file
rm $RPM_BUILD_ROOT/etc/default/passwd
# Find lang files
%{find_lang} pam_unix2
%{find_lang} pam_pwcheck pam_unix2.lang
%{find_lang} pam_make pam_unix2.lang
%post
%run_permissions
%clean
rm -rf $RPM_BUILD_ROOT
%verifyscript
%verify_permissions -e /sbin/unix2_chkpwd
%files -f pam_unix2.lang
%defattr(-,root,root,755)
%doc %{_defaultdocdir}/pam
%verify(not mode) %attr(4755,root,shadow) /sbin/unix2_chkpwd
%attr(755,root,root) /%{_lib}/security/pam_homecheck.so
%attr(755,root,root) /%{_lib}/security/pam_make.so
%attr(755,root,root) /%{_lib}/security/pam_pwcheck.so
%attr(755,root,root) /%{_lib}/security/pam_unix2.so
%attr(644,root,root) %doc %{_mandir}/man8/pam_make.8.gz
%attr(644,root,root) %doc %{_mandir}/man8/pam_pwcheck.8.gz
%attr(644,root,root) %doc %{_mandir}/man8/pam_unix2.8.gz
%attr(644,root,root) %doc %{_mandir}/man8/unix2_chkpwd.8.gz
%changelog