File akaneiro-launcher.spec of Package akaneiro-launcher

Name:           akaneiro-launcher
Version:        0.2.6
Release:        6
Summary:        Akaneiro Game Launcher
License:        GPL-3.0+
Group:          Games
URL:            http://www.spicyhorse.com/
Source0:        launcher_0.2.6.orig.tar.gz
Source1:        launcher_0.2.6.orig-akaneiro.tar.gz

BuildRequires: gcc-c++
BuildRequires: libtorrent-rasterbar-devel libqt4-devel
%if 0%{?suse_version}
BuildRequires: hicolor-icon-theme
BuildRequires: update-desktop-files
%endif


%description
Akaneiro game launcher.

Keeps your game up to date.
Uses p2p magic to deliver best games for you.


%prep
# Unpack Source0 into launcher/ instead of %{name}-%{version}/
%setup -q -n launcher
# Unpack Source1 under launcher/ without removing/recreating
%setup -q -T -D -a 1 -n launcher


%build
# TODO: fix libtorrent-rasterbar to avoid this hacks
echo "QMAKE_LFLAGS += -lrt -lssl -lcrypto" >> launcher.pro 

%if 0%{?fedora}
%{_qt4_qmake}
%endif

%if 0%{?suse_version}
qmake
%endif
make %{?_smp_mflags}


%install
# install binary
mkdir -p $RPM_BUILD_ROOT%{_bindir}
install -m 0755 launcher $RPM_BUILD_ROOT%{_bindir}/akaneiro-launcher

# install the .desktop file
mv game_config/akaneiro-launcher.desktop .
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications

install -p akaneiro-launcher.desktop $RPM_BUILD_ROOT%{_datadir}/applications/akaneiro-launcher.desktop

%if 0%{?suse_version}
%suse_update_desktop_file -r akaneiro-launcher Game RolePlaying
%endif

# install game_config dir
mkdir -p $RPM_BUILD_ROOT%{_datadir}/spicyhorse/akaneiro-launcher
cp -a game_config/ $RPM_BUILD_ROOT%{_datadir}/spicyhorse/akaneiro-launcher

#
# Additional sections
#

%if 0%{?suse_version} >= 1140
%post
%desktop_database_post
%icon_theme_cache_post
%endif


%if 0%{?suse_version} >= 1140
%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif

#
# Packaged Files and changelog
#

%files
%{_bindir}/akaneiro-launcher
%dir %{_datadir}/spicyhorse
%{_datadir}/spicyhorse/akaneiro-launcher
%{_datadir}/applications/akaneiro-launcher.desktop

%changelog
* Tue May 14 2013 Alexandr Kutuzov <alexandr@spicyhorse.com> 0.2.6-6
- Branding fixes: proper category in desktop file. Spec cleanup.

* Mon May 06 2013 Will Woods <wwoods@redhat.com> 0.2.6-5
- Fixed up spec for Fedora