moon-buggy/moon-buggy.spec
2009-02-23 20:58:27 +00:00

115 lines
3.6 KiB
RPMSpec

# Enable oldstyle to have a nearly nothing requiring package after rebuilding
%define oldstyle 0
Summary: Drive and jump with some kind of car across the moon
Name: moon-buggy
Version: 1.0.51
Release: 3%{?dist}
License: GPL+
Group: Amusements/Games
URL: http://seehuhn.de/pages/%{name}
Source0: http://seehuhn.de/media/programs/%{name}-%{version}.tar.gz
Source1: http://seehuhn.de/media/programs/%{name}-sound-%{version}.tar.gz
Source2: %{name}.desktop
Source3: %{name}-sound.desktop
Patch0: moon-buggy-1.0.51-pause.patch
Patch1: moon-buggy-1.0.51-sound.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
BuildRequires: ncurses-devel
%if !%{oldstyle}
BuildRequires: esound-devel, desktop-file-utils, autoconf, automake
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
Moon-buggy is a simple character graphics game where you drive some kind
of car across the moon's surface. Unfortunately there are dangerous craters
there. Fortunately your car can jump over them!
The game has some resemblance of the classic arcade game moon-patrol which
was released in 1982. A clone of this game was relased for the Commodore
C64 in 1983. The present, ASCII art version of moon-buggy was written many
years later by Jochen Voss.
%prep
%setup -q -a 1
%patch0 -p1 -b .pause
%if !%{oldstyle}
%patch1 -p1 -b .sound
mv -f %{name}-%{version}/* .
autoreconf -f
%endif
%build
%configure --sharedstatedir=%{_localstatedir}/games
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" install
# Create zero-sized highscore file
touch $RPM_BUILD_ROOT%{_localstatedir}/games/%{name}/mbscore
# Install working *.desktop files and an icon
%if !%{oldstyle}
desktop-file-install --vendor "" --dir=$RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE2}
desktop-file-install --vendor "" --dir=$RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE3}
install -D -p -m 644 %{name}.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png
%endif
# Some file cleanups
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
# Convert everything to UTF-8
iconv -f iso-8859-1 -t utf-8 -o ChangeLog.utf8 ChangeLog
sed -i 's|\r$||g' ChangeLog.utf8
touch -c -r ChangeLog ChangeLog.utf8
mv -f ChangeLog.utf8 ChangeLog
iconv -f iso-8859-1 -t utf-8 -o TODO.utf8 TODO
sed -i 's|\r$||g' TODO.utf8
touch -c -r TODO TODO.utf8
mv -f TODO.utf8 TODO
%post
/sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir
%preun
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir || :
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc ANNOUNCE AUTHORS ChangeLog COPYING README THANKS
%if !%{oldstyle}
%doc README.sound
%{_datadir}/%{name}/
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{name}-sound.desktop
%endif
%attr(2755,root,games) %{_bindir}/%{name}
%{_mandir}/man6/%{name}.6*
%{_infodir}/%{name}.info.gz
%attr(0775,root,games) %{_localstatedir}/games/%{name}
%verify(not md5 size mtime) %config(noreplace) %attr(664,root,games) %{_localstatedir}/games/%{name}/mbscore
%changelog
* Mon Feb 23 2009 Robert Scheck <robert@fedoraproject.org> 1.0.51-3
- Rebuilt against gcc 4.4 and rpm 4.6
* Sun Jan 04 2009 Robert Scheck <robert@fedoraproject.org> 1.0.51-2
- Avoid arbitrary modification of highscore file (#469585 #c25)
* Sat Jan 03 2009 Robert Scheck <robert@fedoraproject.org> 1.0.51-1
- Upgrade to 1.0.51
- Initial spec file for Fedora and Red Hat Enterprise Linux (based
on a spec file of Simon Wesp <cassmodiah@fedoraproject.org>)