17
0

Compare commits

4 Commits

2 changed files with 23 additions and 12 deletions

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Jun 9 15:06:09 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives
-------------------------------------------------------------------
Tue Jun 3 11:55:19 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jan 9 21:49:51 UTC 2024 - Dirk Müller <dmueller@suse.com> Tue Jan 9 21:49:51 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-portpicker # spec file for package python-portpicker
# #
# Copyright (c) 2024 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
@@ -16,7 +16,7 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without libalternatives
Name: python-portpicker Name: python-portpicker
Version: 1.6.0 Version: 1.6.0
Release: 0 Release: 0
@@ -25,12 +25,14 @@ License: Apache-2.0
Group: Development/Libraries/Python Group: Development/Libraries/Python
URL: https://github.com/google/python_portpicker URL: https://github.com/google/python_portpicker
Source0: https://files.pythonhosted.org/packages/source/p/portpicker/portpicker-%{version}.tar.gz Source0: https://files.pythonhosted.org/packages/source/p/portpicker/portpicker-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: net-tools-deprecated BuildRequires: net-tools-deprecated
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires(post): update-alternatives Requires: alts
Requires(postun):update-alternatives
BuildArch: noarch BuildArch: noarch
%python_subpackages %python_subpackages
@@ -44,26 +46,25 @@ harnesses that launch local servers.
test -f setup.py || echo "import setuptools; setuptools.setup()" > setup.py test -f setup.py || echo "import setuptools; setuptools.setup()" > setup.py
%build %build
%python_build %pyproject_wheel
%install %install
%python_install %pyproject_install
%python_clone -a %{buildroot}%{_bindir}/portserver.py %python_clone -a %{buildroot}%{_bindir}/portserver.py
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python src/tests/portpicker_test.py %python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python src/tests/portpicker_test.py
%post %pre
%python_install_alternative portserver.py %python_libalternatives_reset_alternative portserver.py
%postun
%python_uninstall_alternative portserver.py
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%doc CONTRIBUTING.md README.md %doc CONTRIBUTING.md README.md
%{python_sitelib}/* %{python_sitelib}/portpicker.py
%pycache_only %{python_sitelib}/__pycache__/portpicker*
%{python_sitelib}/portpicker-%{version}*-info
# import asyncio # import asyncio
%python_alternative %{_bindir}/portserver.py %python_alternative %{_bindir}/portserver.py