File python-pkgbuilder.spec of Package python-pkgbuilder
#
# spec file for package python-pkgbuilder
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-pkgbuilder
Version: 4.3.0
Release: 0
License: BSD-3-Clause
Summary: Python 3 AUR helper
Url: https://github.com/Kwpolska/pkgbuilder
Group: Development/Languages/Python
Source: https://github.com/Kwpolska/pkgbuilder/archive/v%{version}.tar.gz#/pkgbuilder-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools}
# SECTION test requirements
BuildRequires: %{python_module requests}
BuildRequires: %{python_module pyalpm}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module srcinfo}
# /SECTION
BuildRequires: fdupes
Requires: python-pyalpm
Requires: python-requests
Requires: python-srcinfo
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%lang_package -n python3-pkgbuilder
%description
An AUR helper (and library) in Python 3.
%prep
%setup -q -n pkgbuilder-%{version}
%build
%python_build
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/pkgbuilder
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%find_lang pkgbuilder
%check
%pytest
%post
%python_install_alternative pkgbuilder
%postun
%python_uninstall_alternative pkgbuilder
%files %{python_files}
%doc AUTHORS CHANGELOG.rst README README.rst
%license LICENSE
%python_alternative %{_bindir}/pkgbuilder
%python_alternative %{_bindir}/pb
%{python_sitelib}/*
%doc %{_mandir}/man8/pb.8.gz
%doc %{_mandir}/man8/pkgbuilder.8.gz
%post
%python_install_alternative pkgbuilder
%postun
%python_uninstall_alternative pkgbuilder
%files %{python_files lang} -f pkgbuilder.lang
%changelog