14
0
forked from pool/python-scour

- Convert to pip-based build and libalternatives

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-scour?expand=0&rev=22
This commit is contained in:
2025-06-12 09:23:12 +00:00
committed by Git OBS Bridge
parent 30f81ace1c
commit a3e97703c3
2 changed files with 19 additions and 14 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jun 12 09:21:47 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build and libalternatives
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jun 6 12:07:19 UTC 2023 - pgajdos@suse.com Tue Jun 6 12:07:19 UTC 2023 - pgajdos@suse.com

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-scour # spec file for package python-scour
# #
# Copyright (c) 2023 SUSE LLC # Copyright (c) 2025 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -17,6 +17,7 @@
%define oldpython python %define oldpython python
%bcond_without libalternatives
Name: python-scour Name: python-scour
Version: 0.38.2 Version: 0.38.2
Release: 0 Release: 0
@@ -27,20 +28,22 @@ URL: https://github.com/oberstet/scour
Source: https://github.com/scour-project/scour/archive/v%{version}/scour-%{version}.tar.gz Source: https://github.com/scour-project/scour/archive/v%{version}/scour-%{version}.tar.gz
# https://github.com/scour-project/scour/pull/306 # https://github.com/scour-project/scour/pull/306
Patch0: python-scour-no-python2.patch Patch0: python-scour-no-python2.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module xml} BuildRequires: %{python_module xml}
BuildRequires: alts
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildRequires: unzip BuildRequires: unzip
Requires: alts
Requires: python-setuptools Requires: python-setuptools
%ifpython2
Requires: python-xml
%endif
Requires(post): update-alternatives
Requires(postun):update-alternatives
Conflicts: %{oldpython}-scour < 0.37 Conflicts: %{oldpython}-scour < 0.37
Provides: scour = %{version} Provides: scour = %{version}
BuildArch: noarch BuildArch: noarch
%ifpython2
Requires: python-xml
%endif
%python_subpackages %python_subpackages
%description %description
@@ -55,27 +58,24 @@ The goal of scour is to provide an identically rendered image.
sed -i '/^#!/ d' scour/{scour.py,yocto_css.py,svg_transform.py} sed -i '/^#!/ d' scour/{scour.py,yocto_css.py,svg_transform.py}
%build %build
%python_build %pyproject_wheel
%install %install
%python_install %pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/scour %python_clone -a %{buildroot}%{_bindir}/scour
%check %check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python test_scour.py %python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python test_scour.py
%post %pre
%python_install_alternative scour %python_libalternatives_reset_alternative scour
%postun
%python_uninstall_alternative scour
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%doc *.md %doc *.md
%python_alternative %{_bindir}/scour %python_alternative %{_bindir}/scour
%{python_sitelib}/scour/ %{python_sitelib}/scour/
%{python_sitelib}/scour-*.egg-info %{python_sitelib}/scour-%{version}*-info
%changelog %changelog