File python-oauth2-clientd.spec of Package oauth2-clientd

# # spec file for package oauth2-clientd
#
# Copyright (c) 2021 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/
#

%define needs_explicit_requires %(test -e /usr/lib/rpm/fileattrs/pythondist.attr || echo 1)
%define pkgname oauth2-clientd
%define python_literal python

Name:           python-%{pkgname}
Version:        0.10.0
Release:        0
Summary:	OAUTH2 client caching daemon
License:        GPL-2.0
URL:            https://github.com/jeffmahoney/oauth2-clientd
Group:		Productivity/Networking/Security
Source:         %{pkgname}-%{version}.tar.xz
Source1:	%{name}-rpmlintrc
%{?sle15_python_module_pythons}
BuildRequires:	%{python_module setuptools}
BuildRequires:  python-rpm-generators
BuildRequires:  fdupes
BuildRequires:	%{pythons}
BuildRequires:	%{python_module pip}
BuildRequires:	%{python_module wheel}
Requires:	python-atomicwrites
Requires:	python-cryptography
Requires:	python-%{python_literal}-daemon
Requires:	python-requests-oauthlib
Requires:	(python3 >= 3.7 or python3-importlib_resources)
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides:	oauth2-clientd = %{version}
Obsoletes:	oauth2-clientd < %{version}
BuildArch:	noarch
%python_subpackages

%description
oauth2-clientd is a daemon that obtains, refreshes, and secures OAUTH2
credentials for use by other software.

%prep
%setup -n %{pkgname}-%{version}
sed -i -e 's/version =.*/version = "%{version}"/' pyproject.toml

%build
#python3 setup.py build
%pyproject_wheel

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/oauth2-clientd
%{python_expand %fdupes %{buildroot}%{$python_sitelib}}

%post
%python_install_alternative %{pkgname}

%postun
%python_uninstall_alternative %{pkgname}

%files %{python_files}
%license LICENSE
%doc README.md
%python_alternative %{_bindir}/oauth2-clientd
%{python_sitelib}/oauth2_clientd-%{version}.dist-info/
%{python_sitelib}/oauth2_clientd/

%changelog
openSUSE Build Service is sponsored by