Name: biniax
Version: 1.2
Release: 5%{?dist}
Summary: A unique arcade logic game
Group: Amusements/Games
License: zlib
URL: http://www.biniax.com/
Source0: http://mordred.dir.bg/%{name}/%{name}-src.zip
Source1: %{name}.desktop
# Icon taken from the source, icon.ico
Source2: %{name}.png
# Fixes the path in gfx.c, snd.c. and creates a ~/.biniax subdir
# with "autosave" and "highscore" data. Patches send to upstream!
Patch0: %{name}-%{version}-gfx.patch
Patch1: %{name}-%{version}-snd.patch
Patch2: %{name}-%{version}-save.patch
Patch3: %{name}-%{version}-optflags.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: hicolor-icon-theme
BuildRequires: SDL-devel SDL_mixer-devel desktop-file-utils
%description
Biniax is a fancy and unique arcade logic game. It requires just a minute
to learn the rules and you will get hours of gameplay.
%prep
%setup -q -c -n %{name}
%patch0 -p0 -b .gfx
%patch1 -p0 -b .snd
%patch2 -p0 -b .save
%patch3 -p0 -b .optflags
# Needed because of this rpmlint warning "W: wrong-file-end-of-line-encoding"
sed -i 's/\r//' Readme.txt LICENSE.txt
# Set datadir prefix, snd.patch and gfx.patch
sed -i 's!@DATADIR@!%{_datadir}!' desktop/gfx.c
sed -i 's!@DATADIR@!%{_datadir}!' desktop/snd.c
%build
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/data
install -p -m 755 biniax $RPM_BUILD_ROOT%{_bindir}/%{name}
install -p -m 644 data/* $RPM_BUILD_ROOT%{_datadir}/%{name}/data/
# below the desktop file and icon stuff
desktop-file-install \
--dir=$RPM_BUILD_ROOT%{_datadir}/applications \
%{SOURCE1}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
install -p -m 0644 %{SOURCE2} \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%clean
rm -rf $RPM_BUILD_ROOT
%post
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
%postun
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
%files
%defattr(-,root,root,-)
%doc LICENSE.txt Readme.txt
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%changelog
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Sat Oct 25 2008 Stefan Posdzich <cheekyboinc@foresightlinux.org> - 1.2-4
- Add datadir prefix, snd.patch and gfx.patch
- Remove obsolete desktop-file-install --vendor="fedora"
* Sat Oct 25 2008 Stefan Posdzich <cheekyboinc@foresightlinux.org> - 1.2-3
- Cosmetic corrections
* Sat Oct 18 2008 Stefan Posdzich <cheekyboinc@foresightlinux.org> - 1.2-2
- Add fix for "W: wrong-file-end-of-line-encoding"
- Add RPM_OPT_FLAGS patch
- Add more macros to spec
- Add more info to .desktop file
- Changed summary
- Remove BuildRequires: dos2unix
* Tue Aug 05 2008 Stefan Posdzich <cheekyboinc@foresightlinux.org> - 1.2-1
- Initial SPEC file