File pam-modules.spec of Package pam-modules.23706

# spec file for package pam-modules
# Copyright (c) 2017 SUSE LINUX 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

%if %{suse_version} >= 1100
%define enable_selinux 1
%define enable_selinux 0

Name:           pam-modules
Summary:        Additional PAM Modules
License:        BSD-3-Clause and GPL-2.0
Group:          System/Libraries
Version:        12.1
Release:        0
Source0:        pam_unix2-2.9.1.tar.bz2
Source1:        pam_pwcheck-3.13.tar.bz2
Source2:        pam_homecheck-2.0.tar.bz2
Source3:        default.passwd
Source6:        baselibs.conf
Patch0:         0003-use-crypt_gensalt_rn-from-glibc.diff
Patch1:         0004-add-workarounds-for-blowfish-signedness-bug.diff
Patch2:         pam_unix2-glibc216.patch
Patch3:         pam_unix2-selinux.patch
Patch4:         pam-modules-automake.patch
# PATCH-FIX-SLE pam-bsc1197795-do-not-include-obsolete-header-files.patch bsc#1197795
Patch5:         pam-bsc1197795-do-not-include-obsolete-header-files.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         permissions
BuildRequires:  cracklib-devel
BuildRequires:  libtool
BuildRequires:  pam-devel
%if %{enable_selinux}
BuildRequires:  libselinux-devel
%if 0%{?suse_version} >= 1330
BuildRequires:  pkgconfig(libnsl)

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, obsolete PAM Modules sometimes
needed for migration: pam_unix2 and pam_pwcheck

%setup -q -c %{name} -a1 -a2
pushd pam_unix2-*
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch5 -p1

pushd pam_unix2-*
gettextize -f
for i in * ; do
  cd $i;
  autoreconf -fiv
  %configure --enable-selinux \
  make %{?_smp_mflags}
  cd ..

mkdir -p $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 ..
# 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.
export CC=%__cc
for module in $RPM_BUILD_ROOT/%{_lib}/security/pam*.so ; do
   if ! sh $RPM_SOURCE_DIR/ -lpam -ldl ${module} ; then
      exit 1
# Install READMEs of PAM modules
mkdir -p $DOC/modules
for i in pam_*/README ; do
  cp -fpv ${i} $DOC/modules/README.`dirname ${i}`
# Replace default/passwd file
install -m 644 %SOURCE3 $RPM_BUILD_ROOT/etc/default/passwd
# Find lang files
%{find_lang} pam_unix2
%{find_lang} pam_pwcheck pam_unix2.lang

%files -f pam_unix2.lang
%doc %{_defaultdocdir}/pam
%attr(644,root,root) %config(noreplace) /etc/default/passwd
%attr(755,root,root) /%{_lib}/security/
%attr(755,root,root) /%{_lib}/security/
%attr(755,root,root) /%{_lib}/security/
%attr(644,root,root) %doc %{_mandir}/man8/pam_pwcheck.8.gz
%attr(644,root,root) %doc %{_mandir}/man8/pam_unix2.8.gz

openSUSE Build Service is sponsored by