File gamehub.spec of Package gamehub
%define name gamehub
%define release 0
%define gamehubtar gamehub-dev-%{version}
Summary: Unified library for all your games
Name: %{name}
Version: 0
Release: %{release}
Source0: %{gamehubtar}.tar.gz
Source99: gamehub.rpmlintrc
License: GPL-3.0+
Group: Amusements/Games/Other
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
Url: https://github.com/tkashkin/GameHub
# Common build dependencies
BuildRequires: desktop-file-utils
BuildRequires: update-desktop-files
BuildRequires: ninja
BuildRequires: meson >= 0.36
BuildRequires: vala
BuildRequires: cmake
%if 0%{?sle_version} > 151000 && 0%{?is_opensuse}
%else
%if 0%{?suse_version} > 1500
#Tumbleweed
%else
BuildRequires: gcc8
%endif
%endif
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
#BuildRequires: meson
BuildRequires: pkgconfig
#BuildRequires: update-desktop-files
#BuildRequires: vala >= 0.40.8
BuildRequires: pkgconfig(gdk-3.0)
BuildRequires: pkgconfig(gee-0.8)
BuildRequires: pkgconfig(glib-2.0)
#BuildRequires: pkgconfig(granite) >= 0.5
BuildRequires: granite-devel >= 5.2.0
BuildRequires: libunity-devel
BuildRequires: pkgconfig(gtk+-3.0) >= 3.22
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(libsoup-2.4)
BuildRequires: pkgconfig(polkit-gobject-1)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(webkit2gtk-4.0)
BuildRequires: intltool
#BuildRequires: libappstream-glib
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(unity)
#Recommends: %{name}-lang
Recommends: dosbox
Recommends: file-roller
Recommends: innoextract
Recommends: wine
#Optional
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xtst)
BuildRequires: libmanette-devel
# Needed to workaround "directories not owned by a package" issue
BuildRequires: hicolor-icon-theme
%description
Unified library for all your games, written in Vala using GTK+3, designed for elementary OS.
Features
GameHub allows to view, download, install, run and uninstall games from supported sources.
%lang_package
%prep
%setup -q -n %{gamehubtar}
%build
branch=dev
commit=3eda1c373ba954dff781f8b7229e2bcee1b2e046
commit_short="$(c=${commit}; echo ${c:0:7})"
%meson -Dgit_branch="${branch}" -Dgit_commit="${commit}" -Dgit_commit_short="${commit_short}" -Duse_libunity=false
%meson_build
#CFLAGS="$CFLAGS -O0" meson --prefix=/usr build -Ddistro=generic
##%endif
#ninja -C build
%check
##%ameson_test
%install
%meson_install
%suse_update_desktop_file -r com.github.tkashkin.gamehub GTK Game Amusement
%find_lang com.github.tkashkin.gamehub %{name}.lang
%fdupes %{buildroot}/%{_datadir}
# dirlist HiDPI icons (see: hicolor/index.theme)
touch $PWD/dir.lst
_dirlist=$PWD/dir.lst
pushd %{buildroot}
find ./ | while read _list; do
echo $_list | grep '[0-9]\@[0-9]' || continue
_path=$(echo $_list | sed 's/[^/]//')
if ! ls ${_path%/*}; then
grep -xqs "\%dir\ ${_path%/*}" $_dirlist || echo "%dir ${_path%/*}" >> $_dirlist
fi
done
popd
#DESTDIR=%{buildroot} ninja -C build install
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%icon_theme_cache_post
%desktop_database_post
%files -f dir.lst
%license COPYING
%doc README.md
%{_bindir}/%{name}
%{_bindir}/com.github.tkashkin.gamehub
%{_bindir}/com.github.tkashkin.gamehub-overlayfs-helper
%{_datadir}/applications/com.github.tkashkin.gamehub.desktop
%{_datadir}/glib-2.0/schemas/com.github.tkashkin.gamehub.gschema.xml
%{_datadir}/icons/hicolor/*/apps/com.github.tkashkin.gamehub.??g
%{_datadir}/metainfo/com.github.tkashkin.gamehub.appdata.xml
%{_datadir}/polkit-1/actions/com.github.tkashkin.gamehub.policy
%{_datadir}/com.github.tkashkin.gamehub/
%files lang -f %{name}.lang
%changelog