1
0

Compare commits

5 Commits

2 changed files with 38 additions and 7 deletions

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Jun 4 13:16:23 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
- Add missing requirement on update-alternatives
- Migrate to libalternatives on Tumbleweed and Leap 16
-------------------------------------------------------------------
Tue May 27 15:22:32 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Thu Oct 13 07:19:29 UTC 2022 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-haproxyctl
#
# Copyright (c) 2022 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,8 +16,11 @@
#
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
Name: python-haproxyctl
Version: 0.5
Release: 0
@@ -27,10 +30,19 @@ Group: Development/Languages/Python
URL: https://github.com/neurogeek/haproxyctl
Source: https://github.com/neurogeek/haproxyctl/archive/v%{version}.tar.gz#/haproxyctl-%{version}.tar.gz
Source1: gpl-3.0.txt
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
%if %{with libalternatives}
Requires: alts
BuildRequires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
Requires: haproxy
BuildArch: noarch
%python_subpackages
@@ -42,16 +54,16 @@ info from the running instance and list available servers, together
with their status.
%prep
%setup -q -n haproxyctl-%{version}
%autosetup -p1 -n haproxyctl-%{version}
# The package is under GPL-3.0, as expressed in setup.py, but the
# license file is not included in the source code.
cp %{SOURCE1} .
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/haproxyctl
%python_expand %fdupes %{buildroot}%{$python_sitelib}
@@ -61,17 +73,25 @@ cp -a conf %{buildroot}%{_datadir}/$python-haproxyctl/}
%check
%{python_expand $python -m unittest discover -s haproxy/tests}
%if %{with libalternatives}
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative <package-name>
%else
%post
%python_install_alternative haproxyctl
%postun
%python_uninstall_alternative haproxyctl
%endif
%files %{python_files}
%doc README.md
%license gpl-3.0.txt
%dir %{_datadir}/%{python_flavor}-haproxyctl
%{python_sitelib}/*
%{python_sitelib}/haproxy
%{python_sitelib}/haproxyctl-%{version}*-info
%python_alternative %{_bindir}/haproxyctl
%{_datadir}/%{python_flavor}-haproxyctl/*