## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # # We can generate PDF documentation as a substitute. Since the .rst sources are # complete (nothing like sphinx.ext.autodoc is used) and rather readable, # however, we package them directly to reduce the build-time dependencies and # produce a smaller package. %bcond doc_pdf 0 %global commit 1bb4e168b5931f88d9d49fe29d36cc0721ca14ff %global snapdate 20230818 Name: pythoncapi-compat Summary: Python C API compatibility # Upstream has never versioned this project. Version: 0^%{snapdate}git%(c='%{commit}'; echo "${c:0:7}") Release: %autorelease License: 0BSD URL: https://github.com/python/%{name} Source0: %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz # Man page hand-written for Fedora in groff_man(7) format based on --help Source1: upgrade_pythoncapi.py.1 BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: python3-devel %if %{with doc_pdf} BuildRequires: make BuildRequires: python3dist(sphinx) BuildRequires: python3-sphinx-latex BuildRequires: latexmk %endif # As a header-only library package (with an additional command-line tool # subpackage), the base package is arched so that it is compiled and tested on # all architectures; however, no compiled code is installed, and there are no # debugging symbols. %global debug_package %{nil} %global common_description %{expand: The pythoncapi-compat project can be used to write a C or C++ extension supporting a wide range of Python versions with a single code base. It is made of the pythoncapi_compat.h header file and the upgrade_pythoncapi.py script.} %description %{common_description} %package devel Summary: %{summary} # https://docs.fedoraproject.org/en-US/packaging-guidelines/#_packaging_header_only_libraries Provides: %{name}-static = %{version}-%{release} BuildArch: noarch %description devel %{common_description} This package provides the compatibility header library pythoncapi_compat.h. %package tools Summary: %{summary} BuildArch: noarch %description tools %{common_description} This package provides the command-line tool upgrade_pythoncapi.py. %package doc Summary: Documentation for %{name} BuildArch: noarch %description doc %{common_description} %prep %autosetup -n %{name}-%{commit} # Compiling with -Werror makes sense for upstream CI, but is probably too # brittle for downstream builds. sed -r -i "s/^([[:blank:]]*)(['\"]-Werror)/\1# \2/" tests/setup.py %generate_buildrequires pushd tests >/dev/null %pyproject_buildrequires popd >/dev/null %build pushd tests >/dev/null %pyproject_wheel popd >/dev/null %if %{with doc_pdf} %make_build -C docs latex SPHINXOPTS='-j%{?_smp_build_ncpus}' %make_build -C docs/build/latex LATEXMKOPTS='-quiet' %endif %install install -t '%{buildroot}%{_includedir}' -D -p -m 0644 pythoncapi_compat.h install -D -p -t '%{buildroot}%{_bindir}' upgrade_pythoncapi.py install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}' %py3_shebang_fix %{buildroot}%{_bindir}/upgrade_pythoncapi.py %check %{python3} runtests.py %files devel %license COPYING %{_includedir}/pythoncapi_compat.h %files tools %license COPYING %{_bindir}/upgrade_pythoncapi.py %{_mandir}/man1/upgrade_pythoncapi.py.1* %files doc %license COPYING # This primarily documents the script rather than the header. %doc README.rst %if %{with doc_pdf} # This is a source for the PDF documentation, but is useful as a standalone # documentation file as well. %doc docs/changelog.rst %doc docs/build/latex/pythoncapi_compat.pdf %else %doc docs/*.rst %endif %changelog * Fri Aug 18 2023 Benjamin A. Beasley - 0^20230818git1bb4e16-1 - Update to 0^20230818git1bb4e16 (Add `Py_IsFinalizing()` function.) * Wed Aug 16 2023 Benjamin A. Beasley - 0^20230816git91e323f-1 - Update to 0^20230816git91e323f * Fri Jul 21 2023 Fedora Release Engineering - 0^20230710git1911dd4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Tue Jul 11 2023 Benjamin A. Beasley - 0^20230710git1911dd4-1 - Update to 0^20230710git1911dd4 * Thu Jun 22 2023 Benjamin A. Beasley - 0^20230621git6c49cf3-1 - Update to 0^20230621git6c49cf3 * Tue Jun 20 2023 Benjamin A. Beasley - 0^20230601gite266312-2 - Use new (rpm 4.17.1+) bcond style * Thu Jun 01 2023 Benjamin A. Beasley - 0^20230601gite266312-1 - Update to 0^20230601gite266312 * Fri Mar 17 2023 Benjamin A. Beasley - 0^20221127git3779f12-5 - Don’t assume %%_smp_mflags is -j%%_smp_build_ncpus * Fri Jan 20 2023 Fedora Release Engineering - 0^20221127git3779f12-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Tue Jan 10 2023 Benjamin A. Beasley - 0^20221127git3779f12-3 - Do not compile tests with -Werror * Tue Jan 10 2023 Miro Hrončok - 0^20221127git3779f12-2 - Include the default Python shebang flags in /usr/bin/upgrade_pythoncapi.py * Mon Jan 09 2023 Benjamin A. Beasley - 0^20221127git3779f12-1 - Initial import (close RHBZ#2154546)