From 702d2a164e00697c560acaa122f9f75f6ab3e592 Mon Sep 17 00:00:00 2001
From: nkrapp <>
Date: Jun 04 2025 19:16:01 +0000
Subject: Update python-catkin-pkg to version 1.0.0 / rev 9 via SR 1282805


https://build.opensuse.org/request/show/1282805
by user nkrapp + dimstar_suse
- fix usage of libalternatives

---

diff --git a/packages/p/python-catkin-pkg/.files b/packages/p/python-catkin-pkg/.files
index 1439a06..20db9b9 100644
Binary files a/packages/p/python-catkin-pkg/.files and b/packages/p/python-catkin-pkg/.files differ
diff --git a/packages/p/python-catkin-pkg/.rev b/packages/p/python-catkin-pkg/.rev
index 96df612..6b4cdda 100644
--- a/packages/p/python-catkin-pkg/.rev
+++ b/packages/p/python-catkin-pkg/.rev
@@ -113,4 +113,13 @@
     infrastructure/catkin_pkg/pull/337&gt;`_</comment>
     <requestid>1277898</requestid>
   </revision>
+  <revision rev="9" vrev="2">
+    <srcmd5>c4b96bc7720da06d652ba47faf5daa57</srcmd5>
+    <version>1.0.0</version>
+    <time>1749061805</time>
+    <user>dimstar_suse</user>
+    <comment>- fix usage of libalternatives
+</comment>
+    <requestid>1282805</requestid>
+  </revision>
 </revisionlist>
diff --git a/packages/p/python-catkin-pkg/python-catkin-pkg.changes b/packages/p/python-catkin-pkg/python-catkin-pkg.changes
index 51eca22..6c2d304 100644
--- a/packages/p/python-catkin-pkg/python-catkin-pkg.changes
+++ b/packages/p/python-catkin-pkg/python-catkin-pkg.changes
@@ -1,4 +1,9 @@
 -------------------------------------------------------------------
+Wed Jun  4 14:46:54 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
+
+- fix usage of libalternatives
+
+-------------------------------------------------------------------
 Thu May 15 21:30:25 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
 
 - Add missing rpmlintrc to the SPEC file.
diff --git a/packages/p/python-catkin-pkg/python-catkin-pkg.spec b/packages/p/python-catkin-pkg/python-catkin-pkg.spec
index 191b7de..4b77c65 100644
--- a/packages/p/python-catkin-pkg/python-catkin-pkg.spec
+++ b/packages/p/python-catkin-pkg/python-catkin-pkg.spec
@@ -16,6 +16,7 @@
 #
 
 
+%bcond_without libalternatives
 %define commands create_pkg find_pkg generate_changelog package_version prepare_release tag_changelog test_changelog
 Name:           python-catkin-pkg
 Version:        1.0.0
@@ -28,14 +29,14 @@ Source99:       python-catkin-pkg.rpmlintrc
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module wheel}
+BuildRequires:  alts
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+Requires:       alts
 Requires:       python-docutils
 Requires:       python-pyparsing
 Requires:       python-python-dateutil
 Requires:       python-setuptools
-Requires(post): alts
-Requires(postun): alts
 BuildArch:      noarch
 # SECTION test requirements
 BuildRequires:  %{python_module docutils}
@@ -50,8 +51,7 @@ BuildRequires:  %{python_module python-dateutil}
 Library for retrieving information about catkin packages.
 
 %prep
-%setup -q -n catkin_pkg-%{version}
-%autopatch -p1
+%autosetup -p1 -n catkin_pkg-%{version}
 
 %build
 %pyproject_wheel
@@ -68,15 +68,13 @@ export PYTHONPATH=$PWD/src
 # flake8 line length checks failing (E501)
 %pytest -k 'not test_flake8'
 
-%post
+%pre
+# If libalternatives is used: Removing old update-alternatives entries.
 for c in %{commands}; do
-  %python_install_alternative catkin_$c
+  %python_libalternatives_reset_alternative catkin_$c
 done
 
-%postun
-for c in %{commands}; do
-  %python_uninstall_alternative catkin_$c
-done
+# post and postun macro call is not needed with only libalternatives
 
 %files %{python_files}
 %license LICENSE