File pyglossary.spec of Package pyglossary

#
# spec file for package pyglossary
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#

%define python3_version 3
%define python_sitelib %(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')

Name:           pyglossary
Version:        4.7.0
Release:        1
Summary:        Working on glossaries (dictionary files)

License:        GPL-3.0-only
URL:            https://github.com/ilius/pyglossary
Source0:        %{url}/archive/refs/tags/%{version}.tar.gz

BuildRequires:  python311-setuptools
BuildRequires:  python311-devel
BuildRequires:  desktop-file-utils
BuildArch:      noarch

%description
A tool for converting dictionary files aka glossaries.

%prep
%setup -q

%check

%build

%install
mkdir -p %{buildroot}/usr/share/doc/pyglossary/
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix}

install -D -m 644 %{_builddir}/%{name}-%{version}/pkg/pyglossary.desktop %{buildroot}%{_datadir}/applications/pyglossary.desktop
install -D -m 644 %{_builddir}/%{name}-%{version}/res/pyglossary.png  %{buildroot}%{_datadir}/pixmaps/pyglossary.png
cp -r %{_builddir}/%{name}-%{version}/doc/* %{buildroot}%{_datadir}/doc/pyglossary/

desktop-file-install --dir %{buildroot}%{_datadir}/applications \
                      --delete-original \
                      %{buildroot}%{_datadir}/applications/pyglossary.desktop

%files
%{_bindir}/pyglossary
%{_datadir}/applications/pyglossary.desktop
%{_datadir}/pixmaps/pyglossary.png
%{_datadir}/pyglossary/
%{_datadir}/doc/pyglossary/
/usr/lib/python3.11/site-packages/pyglossary/
/usr/lib/python3.11/site-packages/pyglossary-4.7.0-py3.11.egg-info/

%changelog
openSUSE Build Service is sponsored by