pam-config/pam-config.spec
Thorsten Kukuk b7d13a96be - No %ghost entries anymore, common-*-pc files are now real config
files for better tracking of modifications.
- Update to version 0.91
  - Adjust for Linux-PAM 1.3.0
  - Automatically replace obsolete PAM modules no longer installed
  - Extend error messates

OBS-URL: https://build.opensuse.org/package/show/Linux-PAM/pam-config?expand=0&rev=78
2016-05-31 13:43:07 +00:00

97 lines
3.0 KiB
RPMSpec

#
# spec file for package pam-config
#
# Copyright (c) 2016 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 http://bugs.opensuse.org/
#
Name: pam-config
Summary: Modify common PAM configuration files
License: GPL-2.0
Group: System/Management
Version: 0.91
Release: 0
PreReq: pam >= 1.3.0
Url: https://github.com/SUSE/pam-config
Source: %{name}-%{version}.tar.bz2
Source1: common-account-pc
Source2: common-auth-pc
Source3: common-password-pc
Source4: common-session-pc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
pam-config is a command line utility to maintain the common PAM
configuration files included by most PAM application configuration
files. It can be used to configure a system for different network or
hardware based authentication schemes. pam-config can also
add/adjust/remove other PAM modules and their options.
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d
install -m 644 %SOURCE1 $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/
install -m 644 %SOURCE2 $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/
install -m 644 %SOURCE3 $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/
install -m 644 %SOURCE4 $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/
%{find_lang} pam-config
%post
if [ "$1" = "1" ]; then
pam-config --debug --create --force
else
pam-config --debug --update ||:
fi
%postun
if [ $1 = 0 ]; then
# Deinstall
dir=/etc/security
for conf in pam_unix2.conf pam_pwcheck.conf ; do
if [ -f $dir/$conf.pam-config-backup -a ! -f $dir/$conf ]; then
mv -v $dir/$conf.pam-config-backup $dir/$conf
fi
done
dir=/etc/pam.d
for pamd in common-account common-auth common-password common-session ; do
if [ -f $dir/$pamd.pam-config-backup -a -L $dir/$pamd ]; then
rm -v $dir/$pamd && mv -v $dir/$pamd.pam-config-backup $dir/$pamd
fi
# common-*-pc are ghost, so we have to move them away...
if [ -f $dir/$pamd-pc ]; then
mv -v $dir/$pamd-pc $dir/$pamd-pc.bak
fi
done
fi
%files -f pam-config.lang
%defattr(-,root,root)
%{_sbindir}/pam-config
%doc %{_mandir}/man8/pam-config.8*
%config %{_sysconfdir}/pam.d/common-account-pc
%config %{_sysconfdir}/pam.d/common-auth-pc
%config %{_sysconfdir}/pam.d/common-password-pc
%config %{_sysconfdir}/pam.d/common-session-pc
%changelog