File gamehub.spec of Package gamehub

#
# spec file for package gamehub
#
# Copyright (c) 2019 Matt Lewandowsky <matt@dunno.wtf>
#
# 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 appname com.github.tkashkin.gamehub
%define sourcename GameHub
%define sourcever 0.16.3
%define sourceversion -6-dev
%define sourceext .tar.xz

Name:  gamehub
Version:  0.16.3
Release:  0
Summary:  All your games in one place
License:  GPL-3.0-or-later
Group:  Amusements/Games/Other
Url:            https://tkashkin.github.io/projects/gamehub/
Source0:        https://github.com/tkashkin/GameHub/archive/refs/tags/%{sourcename}-%{version}%{sourceext}
Source99:       %{name}-rpmlintrc
# See build below for reason behind obsinfo file
Source100:      %{sourcename}.obsinfo
Icon:           %{name}.gif

BuildRequires:  cmake
BuildRequires:  libmanette-devel
BuildRequires:  meson
BuildRequires:  vala
BuildRequires:  pkgconfig(gdk-3.0)
BuildRequires:  pkgconfig(gee-0.8)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(granite)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(json-glib-1.0)
BuildRequires:  pkgconfig(libsoup-2.4)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(polkit-gobject-1)
BuildRequires:  pkgconfig(webkit2gtk-4.0)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xtst)
#BuildRequires:  libunity-devel

Recommends:  %{name}-lang = %{version}

Recommends:  file-roller
Recommends:  dosbox
Recommends:  innoextract
Recommends:  scummvm
Recommends:  wine
# Steam's only a suggestion since it's not in an OSS repo.
Suggests:  steam
# Should other things be suggested? MAME and other emulators, maybe?
BuildRequires:  update-desktop-files
Requires(post):  update-desktop-files
Requires(postun):  update-desktop-files

%description
GameHub supports non-native games as well as native games for Linux.

GameHub supports multiple game sources and services:

* Steam
* GOG
* Humble Bundle
* itch.io

Locally installed games can also be added to GameHub.

It supports multiple compatibility layers for non-native games:

* Wine / Proton
* DOSBox
* RetroArch
* ScummVM
* WineWrap — a set of preconfigured wrappers for supported games;
* custom emulators

It also allows to add custom emulators.

GameHub supports WineWrap — a set of preconfigured wrappers for supported games.


%prep
%autosetup -n %{sourcename}-%{sourcever}
cp %{SOURCE100} .

%check

%build
# Upstream requested keeping debug symbols as well as adding more useful
# information to cause the binary to emit non-blank values for debugging.
# https://github.com/tkashkin/GameHub/issues/156#issuecomment-481709822
BRANCH="$(echo %{version} | awk '{gsub(/([[:digit:]]|\.)/,""); print}')"
COMMIT="$(awk '/commit/ {print $2}' %{sourcename}.obsinfo)"
HASH="$(echo ${COMMIT} | cut -c1-7)"
VER="$(echo %{version} | awk '{gsub(/([[:alpha:]])/,""); print}')"
%meson --buildtype=debug -Dgit_branch="${BRANCH}" -Dgit_commit="${COMMIT}" -Dgit_commit_short="${HASH}"

# Disable optimization per known issues:
# https://github.com/tkashkin/GameHub/issues/162
# https://github.com/tkashkin/GameHub/issues/112
unset CFLAGS
unset CXXFLAGS
unset FCFLAGS
unset FFLAGS
%meson_build

%install
%meson_install
# At this time, the @2 versions are identical to the regular
rm -rf "%{buildroot}/%{_datadir}/icons/hicolor/32x32@2/"
rm -rf "%{buildroot}/%{_datadir}/icons/hicolor/48x48@2/"
rm -rf "%{buildroot}/%{_datadir}/icons/hicolor/64x64@2/"
rm -rf "%{buildroot}/%{_datadir}/icons/hicolor/128x128@2/"
%find_lang %{appname}

%post
%desktop_database_post

%postun
%desktop_database_postun

%files
%license COPYING
%doc README.md
/usr/bin/
/usr/share/

%lang(ar) /usr/share/locale/ar/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(ca) /usr/share/locale/ca/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(cs) /usr/share/locale/cs/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(de) /usr/share/locale/de/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(el) /usr/share/locale/el/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(eo) /usr/share/locale/eo/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(es) /usr/share/locale/es/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(es_MX) /usr/share/locale/es_MX/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(fa) /usr/share/locale/fa/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(fi) /usr/share/locale/fi/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(fr) /usr/share/locale/fr/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(hi) /usr/share/locale/hi/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(hr) /usr/share/locale/hr/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(hu) /usr/share/locale/hu/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(id) /usr/share/locale/id/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(it) /usr/share/locale/it/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(ko) /usr/share/locale/ko/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(mr) /usr/share/locale/mr/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(nb_NO) /usr/share/locale/nb_NO/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(nl) /usr/share/locale/nl/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(pl) /usr/share/locale/pl/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(pt) /usr/share/locale/pt/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(pt_BR) /usr/share/locale/pt_BR/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(pt_PT) /usr/share/locale/pt_PT/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(ru) /usr/share/locale/ru/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(si) /usr/share/locale/si/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(sv) /usr/share/locale/sv/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(te) /usr/share/locale/te/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(tr) /usr/share/locale/tr/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(vi) /usr/share/locale/vi/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(zh_CN) /usr/share/locale/zh_CN/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(zh_HK) /usr/share/locale/zh_HK/LC_MESSAGES/com.github.tkashkin.gamehub.mo
%lang(zh_TW) /usr/share/locale/zh_TW/LC_MESSAGES/com.github.tkashkin.gamehub.mo

%changelog
openSUSE Build Service is sponsored by