From 9f61a65cbcf3d51624ff25aa631835662e7aadf8 Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Aug 03 2022 07:43:48 +0000 Subject: Add a spec template for pyproject-rpm-macros --- diff --git a/Makefile.am b/Makefile.am index bb6f7c6..d55f397 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,7 +15,7 @@ man8_MANS = rpmdev-rmdevelrpms.8 dist_pkgsysconf_DATA = curlrc newspec.conf rmdevelrpms.conf \ spectemplate-lib.spec spectemplate-minimal.spec \ spectemplate-perl.spec spectemplate-php-pear.spec \ - spectemplate-python.spec spectemplate-ruby.spec \ + spectemplate-python.spec spectemplate-pyproject.spec spectemplate-ruby.spec \ spectemplate-ocaml.spec spectemplate-R.spec spectemplate-dummy.spec \ template.init diff --git a/spectemplate-pyproject.spec b/spectemplate-pyproject.spec new file mode 100644 index 0000000..15d5a65 --- /dev/null +++ b/spectemplate-pyproject.spec @@ -0,0 +1,60 @@ +Name: python-... +Version: ... +Release: 1%{?dist} +Summary: ... + +License: ... +URL: https://... +# use a source from git forge or PyPI: +Source: %{url}/archive/v%{version}/...-%{version}.tar.gz / %{pypi_source ...} + +# for pure Python packages: +BuildArch: noarch +# for packages with extension modules: +BuildRequires: gcc + +BuildRequires: python3-devel + +%global _description %{expand: +...} + +%description %_description + +%package -n python3-... +Summary: %{summary} + +%description -n python3-... %_description + + +%prep +%autosetup -p1 -n ...-%{version} + + +%generate_buildrequires +# use the appropriate flags to get all test dependencies: +%pyproject_buildrequires -x... / -t + + +%build +%pyproject_wheel + + +%install +%pyproject_install +# list the installed top-level Python module names: +%pyproject_save_files ... + + +%check +# testing the package is mandatory, at least somehow: +%tox / %pytest / %pyproject_check_import ... + + +%files -n python3-... -f %{pyproject_files} +%doc README.* +# only add LICENSE / COPYING if not included in %%{pyproject_files} +%license LICENSE / COPYING +%{_bindir}/... + + +%changelog