From e34554a9667adc84dfdb511dca0e4d048392cb030913e6cd457de19d0eb23376 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 26 Dec 2021 20:27:22 +0000 Subject: [PATCH] Accepting request 942271 from home:darix:apps - port to the pyproject build to get the commandline for weasyprint back (boo#1194029) OBS-URL: https://build.opensuse.org/request/show/942271 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-weasyprint?expand=0&rev=9 --- python-weasyprint.changes | 6 ++++++ python-weasyprint.spec | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/python-weasyprint.changes b/python-weasyprint.changes index 3d29e22..0dee7d7 100644 --- a/python-weasyprint.changes +++ b/python-weasyprint.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Dec 22 23:52:20 UTC 2021 - Marcus Rueckert + +- port to the pyproject build to get the commandline for weasyprint + back (boo#1194029) + ------------------------------------------------------------------- Thu Dec 16 11:37:31 UTC 2021 - Ben Greiner diff --git a/python-weasyprint.spec b/python-weasyprint.spec index 09259d5..c954b98 100644 --- a/python-weasyprint.spec +++ b/python-weasyprint.spec @@ -29,9 +29,13 @@ Group: Development/Languages/Python URL: https://github.com/Kozea/WeasyPrint Source: https://files.pythonhosted.org/packages/source/w/weasyprint/weasyprint-%{version}.tar.gz Source100: python-weasyprint-rpmlintrc +BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 39.2.0} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun):update-alternatives Requires: libgobject-2_0-0 Requires: pango Requires: python-Pillow >= 4.0.0 @@ -82,19 +86,28 @@ designed for pagination, and meant to be easy to hack on. sed -i '/addopts/d' pyproject.toml %build -%python_build +export PYTHONPATH=$PWD +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%python_clone -a %{buildroot}%{_bindir}/weasyprint %check # gh#Kozea/WeasyPrint#1503 %pytest -k 'not (test_relative_links_missing_base_link or test_links)' tests +%post +%python_install_alternative weasyprint + +%postun +%python_uninstall_alternative weasyprint + %files %{python_files} %doc README.rst %license LICENSE +%python_alternative %{_bindir}/weasyprint %{python_sitelib}/weasyprint %{python_sitelib}/weasyprint-%{version}*-info