pam_python.so is not readily available on RHEL systems. Here's how to create an RPM from Russell's tar.gz:
- download pam-python.1.0.4.tar.gz to ~/rpmbuild/SOURCES
- copy/paste pam-python.spec from below in ~/rpmbuild/SPECS/
- copy/paste pam-python-1.0.4-fix-compile-rhel.patch from below in ~/rpmbuild/SOURCES
- rpmbuild -bb ~/rpmbuild/SPECS/pam-python.spec
Name: pam-python
Version: 1.0.4
Release: 1%{?dist}
Summary: PAM module for Python
Group: System Environment/Libraries
License: AGPL 3.0
Vendor: Russell Stuart
URL: http://pam-python.sourceforge.net/
Source0: %{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: pam-devel
BuildRequires: python-devel
BuildRequires: python-sphinx
BuildRequires: gcc
BuildRequires: make
Requires: python
Patch0: pam-python-1.0.4-fix-compile-rhel.patch
%description
Pam-python is a PAM Module that runs the Python interpreter, thus allowing PAM Modules to be written in Python.
%prep
%setup -q
%patch0 -p0
%build
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install LIBDIR=/%{_lib}/security DESTDIR=%{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
/%{_lib}/security/pam_python.so
%doc /usr/share/doc/pam_python/examples/pam_deny.py
%doc /usr/share/doc/pam_python/examples/pam_nologin.py
%doc /usr/share/doc/pam_python/examples/pam_permit.py
%doc /usr/share/doc/pam_python/html/_sources/pam_python.txt
%doc /usr/share/doc/pam_python/html/_static/basic.css
%doc /usr/share/doc/pam_python/html/_static/default.css
%doc /usr/share/doc/pam_python/html/_static/doctools.js
%doc /usr/share/doc/pam_python/html/_static/file.png
%doc /usr/share/doc/pam_python/html/_static/jquery.js
%doc /usr/share/doc/pam_python/html/_static/minus.png
%doc /usr/share/doc/pam_python/html/_static/plus.png
%doc /usr/share/doc/pam_python/html/_static/pygments.css
%doc /usr/share/doc/pam_python/html/_static/searchtools.js
%doc /usr/share/doc/pam_python/html/genindex.html
%doc /usr/share/doc/pam_python/html/index.html
%doc /usr/share/doc/pam_python/html/objects.inv
%doc /usr/share/doc/pam_python/html/pam_python.html
%doc /usr/share/doc/pam_python/html/search.html
%doc /usr/share/doc/pam_python/html/searchindex.js
%changelog
--- src/pam_python_old.c 2015-12-12 08:48:52.427887790 +0100
+++ src/pam_python.c 2015-12-12 08:49:01.241664132 +0100
@@ -23,6 +23,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <Python.h>
+
#define PAM_SM_AUTH
#define PAM_SM_ACCOUNT
#define PAM_SM_SESSION
@@ -33,7 +35,6 @@
#undef _POSIX_C_SOURCE
-#include <Python.h>
#include <dlfcn.h>
#include <signal.h>
#include <structmember.h>