File marsshooter.spec of Package marsshooter
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: marsshooter
Version: 0.7.5
Release: 0
License: GPL-3.0+
Summary: M.A.R.S. - a ridiculous shooter
Url: http://mars-game.sourceforge.net/
Group: Amusements/Games/Action/Shoot
# https://github.com/thelaui/M.A.R.S.
# rm -fr cmake data_src ext_libs_for_windows
# chmod -x data/locales/Polish.txt
# dos2unix credits.txt license.txt
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}.desktop
# PATCH-FEATURE-OPENSUSE marsshooter-0.7.2-path_searches.patch adam@mizerski.pl -- remove unneeded path searches
Source2: %{name}-0.7.2-path_searches.patch.in
BuildRequires: cmake
BuildRequires: fribidi-devel >= 0.19.2
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: sfml2-devel >= 2.0
BuildRequires: taglib-devel
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glu)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
%if 0%{?fedora_version}
BuildRequires: desktop-file-utils
%endif
%description
It is a game for two players, flying with ships in a two-dimensional space setting, governed by the laws of gravity.
It features:
* awesome 2D-graphics with an unique style
* a stunning amount of particles
* single- and multiplayer-support
* an artificial intelligence using an aggro-system, which reacts differentlyupon varying situations
* many impressive weapons
* customizable ships
* a very sexy GUI
* several game modes: Sacceball, TeamDeathmatch, Cannonkeep, Deathmatch, Grave-Itation Pit
%prep
%setup -q
sed 's|@DATADIR@|%{_datadir}|g' %{SOURCE2} | patch -p1
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" src/Menu/menus.cpp
%build
cmake . \
-DCMAKE_CXX_FLAGS="%optflags" \
-DCMAKE_INSTALL_PREFIX=%{_prefix}
make VERBOSE=1 %{?_smp_mflags}
%install
install -D -m 755 mars %{buildroot}%{_bindir}/%{name}
install -D -d %{buildroot}%{_datadir}/%{name}
cp -r data/* %{buildroot}%{_datadir}/%{name}
install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
install -D -m 644 resources/mars.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%endif
%if 0%{?fedora_version}
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
%endif
%clean
rm -rf %{buildroot}
%if 0%{?suse_version}
%post
%icon_theme_cache_post || true
%postun
%icon_theme_cache_postun || true
%endif
%if 0%{?fedora_version} || (0%{?suse_version} && 0%{?suse_version} <= 1130)
%post
gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || true
%postun
gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || true
%endif
%if 0%{?mandriva_version}
%post
%update_icon_cache hicolor || true
%update_menus
%postun
%update_icon_cache hicolor || true
%clean_menus
%endif
%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%changelog