#98 Add a spec template for pyproject-rpm-macros
Merged 2 years ago by ngompa. Opened 2 years ago by churchyard.
churchyard/rpmdevtools pyproject  into  main

file modified
+1 -1
@@ -15,7 +15,7 @@ 

  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

  

@@ -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

no initial comment

rebased onto 125ee84

2 years ago

I'd add a license file placeholder. Recently, I found a GPL package that was imported to Fedora without any license file :(.

1 new commit added

  • fixup! Add a spec template for pyproject-rpm-macros
2 years ago

Good point about the %pyproject_files part. I always forget that. I'd probably include a slash between the second COPYING and LICENSE, but meh. Maybe also add how to check (rpm -qpL foo.rpm)?

2 new commits added

  • fixup! Add a spec template for pyproject-rpm-macros
  • Add a spec template for pyproject-rpm-macros
2 years ago

Slash removed. I want to keep the comments to a minimum, this is not a guide but a template.

rebased onto 9f61a65

2 years ago

Looks fine to me. Theoretically multiple distributions could be using the pyproject macros, so...

Pull-Request has been merged by ngompa

2 years ago
Metadata