2800b49530
This macro save generates file section to %pyproject_files. It should simplify %files section and allow to build by some automatic machinery Supposed use case in Fedora: %install %pyproject_install %pyproject_save_files requests _requests %files -n python3-requests -f %{pyproject_files} %doc README.rst %license LICENSE Automatic build of arbitrary packages (e.g. in Copr): %install %pyproject_install %pyproject_save_files * +bindir // save all modules with executables %files -n python3-requests -f %{pyproject_files} Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
56 lines
1.3 KiB
RPMSpec
56 lines
1.3 KiB
RPMSpec
%global modname isort
|
|
|
|
Name: python-%{modname}
|
|
Version: 4.3.21
|
|
Release: 7%{?dist}
|
|
Summary: Python utility / library to sort Python imports
|
|
|
|
License: MIT
|
|
URL: https://github.com/timothycrosley/%{modname}
|
|
Source0: %{url}/archive/%{version}-2/%{modname}-%{version}-2.tar.gz
|
|
BuildArch: noarch
|
|
BuildRequires: pyproject-rpm-macros
|
|
|
|
%description
|
|
This package contains executables.
|
|
Building this tests that executables are not listed when +bindir is not used
|
|
with %%pyproject_save_files.
|
|
|
|
%package -n python3-%{modname}
|
|
Summary: %{summary}
|
|
|
|
%description -n python3-%{modname}
|
|
%{summary}.
|
|
|
|
|
|
%prep
|
|
%autosetup -n %{modname}-%{version}-2
|
|
|
|
|
|
%generate_buildrequires
|
|
%pyproject_buildrequires -r
|
|
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
|
|
%install
|
|
%pyproject_install
|
|
%pyproject_save_files isort
|
|
|
|
|
|
%check
|
|
# Internal check if the instalation outputs expected result
|
|
test -d %{buildroot}%{python3_sitelib}/%{modname}/
|
|
test -d %{buildroot}%{python3_sitelib}/%{modname}-%{version}.dist-info/
|
|
|
|
# Internal check that executables are not present when +bindir was not used with %%pyproject_save_files
|
|
grep -vF %{buildroot}%{_bindir}/%{modname} %{pyproject_files}
|
|
|
|
|
|
%files -n python3-%{modname} -f %{pyproject_files}
|
|
%doc README.rst *.md
|
|
%license LICENSE
|
|
%{_bindir}/%{modname}
|