File sgt-launcher.spec of Package sgt-launcher

#
# spec file for package sgt-launcher
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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  _name  sgtlauncher
%define  aname  org.bluesabre.SgtLauncher
Name:           sgt-launcher
Version:        @SERVICE@
Release:        0
Summary:        A launcher for Simon Tatham's Portable Puzzle Collection
License:        GPL-3.0+
Group:          Amusements/Games/Other
Url:            https://launchpad.net/sgt-launcher
Source:         %{name}-%{version}.tar.xz
BuildRequires:  fdupes
# Needed for typelib() - Requires.
BuildRequires:  gobject-introspection
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  python3-distutils-extra
BuildRequires:  python3-gobject
Requires:       puzzles
Requires:       python3-gobject
Requires:       python3-gobject-Gdk
Requires:       python3-xcffib
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
SGT Puzzle Launcher (sgt-launcher) is a GTK+ 3 launcher application for Simon
Tatham's Portable Puzzle Collection. The launcher embeds each game into it's
window and wraps game functionality into the UI to make for an improved
experience.

%lang_package

%prep
%setup -q

%build
python3 ./setup.py build

%install
python3 ./setup.py install -O1 \
    --prefix="%{_prefix}" \
    --root="%{buildroot}"
rm -rf %{buildroot}%{_datadir}/doc

%find_lang %{name}

# Python byte compile.
pushd %{buildroot}%{python3_sitelib}/%{_name}_lib/__pycache__
%py3_compile -O ..
popd
%fdupes %{buildroot}%{python3_sitelib}/%{_name}_lib/__pycache__/

%if 0%{?suse_version} <= 1320
%post
%icon_theme_cache_post

%postun
%icon_theme_cache_postun
%endif

%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README
%dir %{_prefix}/games
%dir %{_datadir}/metainfo
%{_prefix}/games/%{name}
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{aname}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%{_datadir}/pixmaps/%{name}.??g
%{_datadir}/%{name}
%{_mandir}/man?/%{name}.?%{ext_man}
%{python3_sitelib}/sgt_launcher-*-py%{py3_ver}.egg-info
%{python3_sitelib}/%{_name}/
%{python3_sitelib}/%{_name}_lib/

%files lang -f %{name}.lang
%defattr(-,root,root)

%changelog
openSUSE Build Service is sponsored by