From 8d67c328f1006498e3cbe2faff4c6c186a3a2f86 Mon Sep 17 00:00:00 2001
From: factory-maintainer <>
Date: Jun 11 2025 17:05:07 +0000
Subject: Update python-haproxyctl to version 0.5 / rev 5 via SR 1284875


https://build.opensuse.org/request/show/1284875
by user factory-maintainer + anag_factory
Automatic submission by obs-autosubmit

---

diff --git a/packages/p/python-haproxyctl/.files b/packages/p/python-haproxyctl/.files
index 0cea2a1..ae66da6 100644
Binary files a/packages/p/python-haproxyctl/.files and b/packages/p/python-haproxyctl/.files differ
diff --git a/packages/p/python-haproxyctl/.rev b/packages/p/python-haproxyctl/.rev
index 6b60db2..5312bd8 100644
--- a/packages/p/python-haproxyctl/.rev
+++ b/packages/p/python-haproxyctl/.rev
@@ -31,4 +31,12 @@
     <comment></comment>
     <requestid>1280665</requestid>
   </revision>
+  <revision rev="5" vrev="5">
+    <srcmd5>214e778597aae08e2bcdb109e8afda57</srcmd5>
+    <version>0.5</version>
+    <time>1749659706</time>
+    <user>anag_factory</user>
+    <comment>Automatic submission by obs-autosubmit</comment>
+    <requestid>1284875</requestid>
+  </revision>
 </revisionlist>
diff --git a/packages/p/python-haproxyctl/python-haproxyctl.changes b/packages/p/python-haproxyctl/python-haproxyctl.changes
index 8dba1e1..50fc70b 100644
--- a/packages/p/python-haproxyctl/python-haproxyctl.changes
+++ b/packages/p/python-haproxyctl/python-haproxyctl.changes
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+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
diff --git a/packages/p/python-haproxyctl/python-haproxyctl.spec b/packages/p/python-haproxyctl/python-haproxyctl.spec
index f6dac76..638725b 100644
--- a/packages/p/python-haproxyctl/python-haproxyctl.spec
+++ b/packages/p/python-haproxyctl/python-haproxyctl.spec
@@ -16,6 +16,11 @@
 #
 
 
+%if 0%{?suse_version} > 1500
+%bcond_without libalternatives
+%else
+%bcond_with libalternatives
+%endif
 Name:           python-haproxyctl
 Version:        0.5
 Release:        0
@@ -31,6 +36,13 @@ 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,7 +54,7 @@ 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} .
@@ -61,11 +73,18 @@ 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