From 545ff2307021967458a9c51f57dd2518329469743ec67eab43faec8520a95e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 21 Apr 2020 09:20:23 +0000 Subject: [PATCH] - Use update-alternatives for the binary OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-epubmerge?expand=0&rev=5 --- python-epubmerge.changes | 5 +++++ python-epubmerge.spec | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/python-epubmerge.changes b/python-epubmerge.changes index f4083d9..e17eced 100644 --- a/python-epubmerge.changes +++ b/python-epubmerge.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 21 09:20:06 UTC 2020 - Tomáš Chvátal + +- Use update-alternatives for the binary + ------------------------------------------------------------------- Mon Apr 20 16:57:11 UTC 2020 - Matej Cepl diff --git a/python-epubmerge.spec b/python-epubmerge.spec index ef9862c..25713ac 100644 --- a/python-epubmerge.spec +++ b/python-epubmerge.spec @@ -24,12 +24,14 @@ Version: 2.9.0 Release: 0 Summary: EpubMerge Calibre Plugin License: GPL-3.0-only -Group: Development/Languages/Python URL: https://github.com/JimmXinu/EpubMerge Source: https://github.com/JimmXinu/EpubMerge/archive/v%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %python_subpackages @@ -64,11 +66,18 @@ merged books comments. These options are stored by Library. %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%python_clone -a %{buildroot}%{_bindir}/%{upnamedown} + +%post +%python_install_alternative %{upnamedown} + +%postun +%python_uninstall_alternative %{upnamedown} %files %{python_files} %license LICENSE %doc README.md -%{_bindir}/%{upnamedown} +%python_alternative %{_bindir}/%{upnamedown} %{python_sitelib}/%{upname}* %changelog