File yabridget.spec of Package yabridget

# spec file for package yabridget
#
# Copyright (c) 2021 Fabio Pesari
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/

%define pythons python3

Name:          yabridget
Version:       0.3.1
Release:       0
Summary:       Qt-based GUI for yabridgectl
License:       GPL-3.0-or-later
Group:         Productivity/Multimedia/Sound
URL:           https://gitlab.com/fpesari/yabridget
Source0:       %{name}-%{version}.tar.gz
Patch0:        fix-gdaw-menu.patch
BuildRoot:     %{_tmppath}/%{name}-%{version}-build
BuildRequires: %{python_module setuptools}
Requires:      python3-qt5 python3-qt5-sip 
Requires:      yabridgectl
Requires(post):   update-alternatives
Requires(postun): update-alternatives
BuildArch:     noarch

%python_subpackages

%description
yabridget is a simple Qt-based GUI for yabridgectl.

%prep
%setup -q
%autopatch -p1

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/yabridget
mkdir -p %{buildroot}%{_datadir}/{applications,pixmaps}
install -m 644 share/%{name}.desktop %{buildroot}%{_datadir}/applications
install -m 644 share/yabridget.xpm %{buildroot}%{_datadir}/pixmaps/

%post
%python_install_alternative yabridget

%postun
%python_uninstall_alternative yabridget

%files
%doc README.md CONTRIBUTORS
%license LICENSE licenses/Oxygen.txt
%{python_sitelib}/*
%{_datadir}/applications/yabridget.desktop
%{_datadir}/pixmaps/yabridget.xpm
%python_alternative %{_bindir}/yabridget

%changelog
openSUSE Build Service is sponsored by