pam-usermode.spec
author dermotm
Mon, 24 Jul 2006 12:30:39 +0000
branchgnome-2-10
changeset 19949 94f49bf19351
parent 19719 d184ca39d269
permissions -rw-r--r--
access control test #4

#
# spec file for package pam-usermode
#
# Copyright (c) 2005 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

Name:			pam-usermode
License:		GPL or BSD
Group:			System Environment/Base
Version:		0.77.4
Release:		40
Distribution:		Java Desktop System
Vendor:			Sun Microsystems, Inc.
Summary:		A PAM module which gives extra permissions to users at the console
Source:			pam-usermode-%{version}.tar.bz2
Patch1:                 pam-usermode-01-fixup-console-perms.diff
BuildRoot:		%{_tmppath}/%{name}-%{version}-build
Docdir:			%{_defaultdocdir}/doc
Autoreqprov:		on

%define			_sbindir /sbin
%define			_sysconfdir /etc
%define			_libdir /lib

%define			glib_version 2.4.0
%define			pam_version 0.77

Requires:		glib2 >= %{glib_version}
Requires:		pam >= %{pam_version}
BuildRequires:		glib2-devel >= %{glib_version}
BuildRequires:		pam-devel >= %{pam_version}

%description
The pam_console module exists to change file permissions when users
log on at the console, and to change them back when they log out of
the console.  It also cooperates with the pam_listfile module to
make it possible to allow users who are at the console to run
various programs that would otherwise be restricted to root only.

%prep
%setup -q
%patch1


%build
%ifos linux
if [ -x /usr/bin/getconf ]; then
  CPUS=`getconf _NPROCESSORS_ONLN`
fi
%else
  CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
%endif
if test "x$CPUS" = "x" -o $CPUS = 0; then
  CPUS=1
fi

CFLAGS="$RPM_OPT_FLAGS"				\
./configure --prefix=%{_prefix}			\
	    --libdir=%{_libdir}			\
	    --sbindir=%{_sbindir}		\
	    --mandir=%{_mandir}			\
	    --sysconfdir=%{_sysconfdir}
make -j $CPUS

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
#Clean up unpackaged files
rm $RPM_BUILD_ROOT%{_libdir}/security/*.a
rm $RPM_BUILD_ROOT%{_libdir}/security/*.la

# Forcibly strip binaries
strip $RPM_BUILD_ROOT/sbin/*

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%dir /var/run/console
%dir %{_sysconfdir}/security/console.apps
%config(noreplace) %{_sysconfdir}/security/console.perms
%{_sbindir}/pam_console_apply
%attr(4511,root,root) %{_sbindir}/pam_timestamp_check
%{_libdir}/security/pam_console.so
%{_libdir}/security/pam_timestamp.so
%{_mandir}/man*/*

%changelog
* Wed Jul 07 2004 - [email protected]
- ported to rpm4

* Wed Jul 07 2004 - [email protected]
- added "-j $CPUS" to make to speed up builds

* Thu Feb 26 2004 - <[email protected]>
- Update Distro

* Thu Oct 09 2003 - <[email protected]>
- Sync with Red Hat's pam-0.77-3

* Sun Jul 27 2003 - <[email protected]>
- Install man pages correctly

* Fri Jul 25 2003 - <[email protected]>
- Include pam_timestamp

* Mon Jul 21 2003 - <[email protected]>
- fix patch so console devices actually match against something.

* Thu Jul 17 2003 - <[email protected]>
- disable changing device permissions. pam_devperms does that.
- make /dev/tty* match as a console device

* Thu Jul 10 2003 - <[email protected]>
- Let the crack begin