e2c15b1
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
e2c15b1
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
e2c15b1
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
e2c15b1
%endif
e2c15b1
e2c15b1
Summary:        PAM bindings for Python
e2c15b1
Name:           PyPAM
e2c15b1
Version:        0.5.0
e2c15b1
Release:        7%{?dist}
e2c15b1
Source0:        http://www.pangalactic.org/PyPAM/%{name}-%{version}.tar.gz
e2c15b1
Url:            http://www.pangalactic.org/PyPAM
e2c15b1
Patch0:         PyPAM-dlopen.patch
e2c15b1
License:        LGPLv2
e2c15b1
Group:          Development/Libraries
e2c15b1
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
e2c15b1
BuildRequires:  python2-devel pam-devel
e2c15b1
Requires:       python
e2c15b1
%filter_provides_in %{python_sitearch}/PAMmodule.so$
e2c15b1
%filter_setup
e2c15b1
e2c15b1
%description
e2c15b1
PAM (Pluggable Authentication Module) bindings for Python.
e2c15b1
e2c15b1
%prep
e2c15b1
%setup -q
e2c15b1
%patch0 -p1 -b .dlopen
e2c15b1
# remove prebuild rpm and others binaries
e2c15b1
rm -rf build dist
e2c15b1
e2c15b1
%build
e2c15b1
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
e2c15b1
e2c15b1
%install
e2c15b1
rm -rf $RPM_BUILD_ROOT
e2c15b1
%{__python} setup.py install --root=$RPM_BUILD_ROOT
e2c15b1
# Make sure we don't include binary files in the docs
e2c15b1
chmod 644 examples/pamtest.py
e2c15b1
rm -f examples/pamexample
e2c15b1
e2c15b1
%clean
e2c15b1
rm -rf $RPM_BUILD_ROOT
e2c15b1
e2c15b1
%files
e2c15b1
%defattr(-, root, root, -)
e2c15b1
%{python_sitearch}/PAMmodule.so
e2c15b1
%{python_sitearch}/*.egg-info
e2c15b1
%doc AUTHORS NEWS README ChangeLog COPYING INSTALL 
e2c15b1
%doc examples 
e2c15b1
e2c15b1
%changelog
e2c15b1
* Thu Aug 05 2010 Miroslav Suchý <msuchy@redhat.com> 0.5.0-7
e2c15b1
- 612998 - PyPAM do not work with python3 (msuchy@redhat.com)
e2c15b1
e2c15b1
* Thu Aug 05 2010 Miroslav Suchý <msuchy@redhat.com> 0.5.0-6
e2c15b1
- 612998 - fix condition for BR (msuchy@redhat.com)
e2c15b1
e2c15b1
* Thu Aug 05 2010 Miroslav Suchý <msuchy@redhat.com> 0.5.0-5
e2c15b1
- 612998 - return back BR for python
e2c15b1
e2c15b1
* Thu Aug 05 2010 Miroslav Suchý <msuchy@redhat.com> 0.5.0-4
e2c15b1
- 612998 - remove binaries. Just in case
e2c15b1
- 612998 - filter provide PAMmodule.so()(64bit)
e2c15b1
- 612998 - do not use INSTALLED_FILES feature, and enumerate files manualy
e2c15b1
- 612998 - use %%{__python} in %%build section
e2c15b1
- 612998 - fix buildrequires for PyPAM
e2c15b1
- 612998 - add macros for rhel5
e2c15b1
e2c15b1
* Fri Jul 09 2010 Miroslav Suchý <msuchy@redhat.com> 0.5.0-3
e2c15b1
- rebuild 
e2c15b1
e2c15b1
* Fri Jul 09 2010 Miroslav Suchý <msuchy@redhat.com> 0.5.0-2
e2c15b1
- rebase PyPAM-dlopen.patch to latest source
e2c15b1
e2c15b1
* Fri Jul 09 2010 Miroslav Suchý <msuchy@redhat.com> 0.5.0-1
e2c15b1
- rebase to PyPAM 0.5.0
e2c15b1
e2c15b1
* Fri Mar 06 2009 Devan Goodwin <dgoodwin@redhat.com> 0.4.2-26
e2c15b1
- Fix bad patch whitespace.
e2c15b1
e2c15b1
* Fri Feb 27 2009 Dennis Gilmore 0.4.2-25
e2c15b1
- rebuild to pick up ppc ppc64 ia64 arches
e2c15b1
e2c15b1
* Fri Feb 27 2009 Devan Goodwin <dgoodwin@redhat.com> 0.4.2-23
e2c15b1
- Rebuild for new rel-eng tools.
e2c15b1
e2c15b1
* Fri May 16 2008 Michael Mraka <michael.mraka@redhat.com> 0.4.2-20
e2c15b1
- fixed file ownership
e2c15b1
e2c15b1
* Tue Jun 22 2004 Mihai Ibanescu <misa@redhat.com> 0.4.2-5
e2c15b1
- Rebuilt
e2c15b1
e2c15b1
* Fri Jul 11 2003 Mihai Ibanescu <misa@redhat.com>
e2c15b1
- Adapted the original rpm to build with python 2.2