File pam-python3.spec of Package pam-python3

#
# spec file for package pam-python3
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%if 0%{?suse_version} < 1650
%define py3_min_ver 11
%endif
Name:           pam-python3
Version:        1.0.7+git.20220331.9641aa5
Release:        0
Summary:        A PAM Module that runs the Python interpreter
License:        AGPL-3.0-or-later
URL:            https://github.com/castlabs/pam-python
Source:         %{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM pam-python3-user-specified-python.patch badshah400@gmail.com -- Allow user-specified PYTHON_EXEC to be used for builds
Patch0:         pam-python3-user-specified-python.patch
BuildRequires:  pam-devel
BuildRequires:  pkgconfig
BuildRequires:  python3%{?py3_min_ver}-Sphinx
BuildRequires:  python3%{?py3_min_ver}-devel

%description
pam_python is a PAM module that runs the Python interpreter and so allows PAM
modules to be written in Python.

This package is based on the forked version at
https://github.com/castlabs/pam-python
that supports python3.

%package doc
Summary:        Documentation for pam-python3
BuildArch:      noarch

%description doc
pam_python is a PAM module that runs the Python interpreter and so allows PAM
modules to be written in Python.

This package provides documentation for writing python based PAM modules.

%prep
%autosetup -p1

%build
export PYTHON_EXEC=%{_bindir}/python3%{?py3_min_ver:.%py3_min_ver}
%make_build

%install
export LIBDIR=%{_pam_moduledir} DOCDIR=%{_docdir}/%{name}
%make_install

%files
%license agpl-3.0.txt
%doc ChangeLog.txt README.txt
%{_pam_moduledir}/*.so

%files doc
%{_docdir}/%{name}/examples/
%{_docdir}/%{name}/html/

%changelog
openSUSE Build Service is sponsored by