python-pikepdf/python-pikepdf.spec

87 lines
1.8 KiB
RPMSpec
Raw Normal View History

2018-08-22 20:22:49 +00:00
%global srcname pikepdf
Name: python-%{srcname}
2022-10-23 03:07:16 +00:00
Version: 6.2.1
2021-09-22 06:21:51 +00:00
Release: %autorelease
2018-08-22 20:22:49 +00:00
Summary: Read and write PDFs with Python, powered by qpdf
License: MPLv2.0
URL: https://github.com/pikepdf/pikepdf
2021-09-22 06:21:51 +00:00
Source0: %pypi_source
2022-02-13 10:34:50 +00:00
2018-08-22 20:22:49 +00:00
BuildRequires: gcc-c++
2022-09-24 01:07:39 +00:00
BuildRequires: qpdf-devel >= 11.1.0
2018-08-22 20:22:49 +00:00
BuildRequires: python3-devel
2019-01-05 08:09:56 +00:00
# Tests:
2019-01-13 10:20:51 +00:00
BuildRequires: poppler-utils
2018-08-22 20:22:49 +00:00
%description
2019-07-23 00:44:35 +00:00
pikepdf is a Python library for reading and writing PDF files. pikepdf is
based on QPDF, a powerful PDF manipulation and repair library.
2018-08-22 20:22:49 +00:00
%package -n python3-%{srcname}
Summary: %{summary}
%description -n python3-%{srcname}
2019-07-23 00:44:35 +00:00
pikepdf is a Python library for reading and writing PDF files. pikepdf is
based on QPDF, a powerful PDF manipulation and repair library.
2018-08-22 20:22:49 +00:00
%package -n python-%{srcname}-doc
Summary: pikepdf documentation
2021-08-19 09:04:11 +00:00
# Not autorequired because it's a Fedora-specific subpackage.
2018-08-22 20:22:49 +00:00
BuildRequires: python3-ipython-sphinx
%description -n python-%{srcname}-doc
Documentation for pikepdf
%prep
2021-09-22 06:21:51 +00:00
%autosetup -n %{srcname}-%{version} -p1
2018-08-22 20:22:49 +00:00
2021-08-21 10:06:39 +00:00
# Drop coverage requirements
sed -i -e '/coverage/d' -e '/pytest-cov/d' setup.cfg
2018-08-22 20:22:49 +00:00
# We don't build docs against the installed version, so force the version.
sed -i -e "s/release = .\+/release = '%{version}'/g" docs/conf.py
2021-08-19 09:04:11 +00:00
%generate_buildrequires
%pyproject_buildrequires -r -x docs -x test
2018-08-22 20:22:49 +00:00
%build
2021-08-19 09:04:11 +00:00
%pyproject_wheel
2018-08-22 20:22:49 +00:00
# generate html docs
2021-12-19 09:36:20 +00:00
export PYTHONPATH="%{pyproject_build_lib}"
2018-08-22 20:22:49 +00:00
pushd docs
2021-12-19 09:36:20 +00:00
sphinx-build-3 . ../html
2018-08-22 20:22:49 +00:00
popd
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%install
2021-08-19 09:04:11 +00:00
%pyproject_install
%pyproject_save_files %{srcname}
2018-08-22 20:22:49 +00:00
%check
2020-06-20 22:09:47 +00:00
%{pytest} -ra
2018-08-22 20:22:49 +00:00
2021-08-19 09:04:11 +00:00
%files -n python3-%{srcname} -f %{pyproject_files}
2018-09-24 22:45:30 +00:00
%license LICENSE.txt
2018-10-14 02:03:41 +00:00
%doc README.md
2018-08-22 20:22:49 +00:00
%files -n python-%{srcname}-doc
%doc html
2018-09-24 22:45:30 +00:00
%license LICENSE.txt
2018-08-22 20:22:49 +00:00
%changelog
2021-07-31 08:18:10 +00:00
%autochangelog