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>

View File

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