Skip to content

Instantly share code, notes, and snippets.

@jnumm
Created January 4, 2016 21:09
Show Gist options
  • Select an option

  • Save jnumm/9ac22a6caa50e95a6cc0 to your computer and use it in GitHub Desktop.

Select an option

Save jnumm/9ac22a6caa50e95a6cc0 to your computer and use it in GitHub Desktop.
Fedora-style RPM spec for pentobi
Name: pentobi
Version: 11.0
Release: 1%{?dist}
Summary: Program to play the board game Blokus
License: GPLv3
URL: http://pentobi.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
BuildRequires: cmake gcc-c++ qt5-qtsvg-devel qt5-qttools-devel
BuildRequires: extra-cmake-modules kf5-kio-devel
BuildRequires: desktop-file-utils libappstream-glib
%description
Pentobi is a computer opponent for the board game Blokus with
support for Classic, Duo, Junior, Trigon, and Nexos game variants.
Different levels of playing strength are available. Pentobi can
save and load games along with comments and move variations.
%package kde-thumbnailer
Summary: KDE thumbnailer for Pentobi game files
Enhances: dolphin
%description kde-thumbnailer
This package contains a KDE plugin to display thumbnails of
Pentobi game files.
%prep
%autosetup
%build
export CXXFLAGS="%{optflags} -O3"
%cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DPENTOBI_BUILD_KDE_THUMBNAILER=ON \
-DPENTOBI_BUILD_TESTS=ON
make %{?_smp_mflags} VERBOSE=1
%install
%make_install
%check
make %{?_smp_mflags} test
desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml
%post
/usr/bin/update-desktop-database &> /dev/null || :
/bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
/usr/bin/update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
/usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%{_bindir}/*
%{_datadir}/appdata/*.appdata.xml
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/mime/packages/*.xml
%{_datadir}/thumbnailers/*
%{_datadir}/%{name}/
%{_datadir}/help/*/%{name}/
%{_mandir}/man6/*
%files kde-thumbnailer
%{_libdir}/qt5/plugins/*.so
%{_datadir}/kservices5/*.desktop
%changelog
* Mon Jan 04 2016 Juhani Numminen <[email protected]> - 11.0-1
- Created by borrowing from existing pentobi.spec files
- Add subpackage kde-thumbnailer
- Build with -O3 to make higher levels faster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment