Blob Blame History Raw
%global date    20141005
%global rev     412
%global source  %{name}-%{version}svn%{rev}

Name:           gnurobbo
Version:        0.66
Release:        1.%{date}svn%{rev}%{?dist}
Summary:        Port of the game Robbo for the Atari XE/XL from 1989

License:        GPLv2+
URL:            http://%{name}.sf.net/

##Make source tarball from svn with $ ./%{name}-svn-tarball.sh %{rev}
Source0:        %{source}.tar.xz
Source1:        %{name}-svn-tarball.sh

Patch0:         https://sf.net/p/%{name}/patches/12/attachment/%{name}-cmake.patch
Patch1:         https://sf.net/p/%{name}/patches/13/attachment/%{name}-hardening.patch

##optional additional icons
Source10:       https://svn.code.sf.net/p/%{name}/code/%{name}.16.png.bz2
Source11:       https://svn.code.sf.net/p/%{name}/code/%{name}.32.png.bz2
Source12:       https://svn.code.sf.net/p/%{name}/code/%{name}.48.png.bz2

BuildRequires:  SDL-devel SDL_mixer-devel SDL_image-devel SDL_ttf-devel
BuildRequires:  cmake
BuildRequires:  desktop-file-utils

Requires:       %{name}-data = %{version}-%{release} 
Requires:       %{name}-fonts = %{version}-%{release}      

%description
GNU Robbo is a free open source port of Janusz Pelc's Robbo for the
Atari XE/XL which was distributed by LK Avalon (->) in 1989.

Features
   + Graphical skin support: Oily, Original and Tronic
   + Sound skin support: Default, Free and Oily
   + Support for user supplied music
   + 1113 levels across 28 packs converted from Robbo and Robbo Konstruktor
   + A mouse/stylus driven level designer
   + Support for Alex (a Robbo clone) objects
   + Support for Robbo Millenium objects
   + In-game help
   + Reconfigurable options and controls
   + Support for the mouse/stylus throughout the game
   + Support for keyboards, analogue and digital joysticks
   + Centering of game within any resolution >= 240x240
   + Simple build system to maximize porting potential
   + Support for locales

The game-play of the original is faithfully reproduced with a few modifications
   + Lives has been removed and suicide replaced with level restart
   + Scoring has been removed: goal is level advancement
   + Bears don't endlessly spin around themselves
   + Capsules don't spawn from question marks
   + Solid laser fire is not left live after the gun has been destroyed


%package data
Summary:        Data files for the game %{name}
BuildArch:      noarch
Requires:       %{name} = %{version}-%{release}

%description data
Data files for the game %{name}:
Levels, locales, skins, sounds.


%package fonts
Summary:        Robbo fonts
BuildArch:      noarch

%description fonts
The Robbo fonts from the game %{name}.


%prep
%setup -qn %{source}
chmod 0644 %{SOURCE1}
%patch0
rm Makefile*
%patch1


%build
%cmake
make %{?_smp_mflags}


%install
%make_install
cd %{buildroot}%{_datadir}
##desktop
mkdir applications
cat > applications/%{name}.desktop << EOF
[Desktop Entry]
Name=GNU Robbo
Comment=Port of the once famous ATARI game Robbo
Exec=%{_bindir}/%{name}
Icon=%{name}
Terminal=false
Type=Application
StartupNotify=true
Categories=Game;ArcadeGame;
EOF
desktop-file-validate applications/%{name}.desktop
##icons
mkdir pixmaps ; install %{_builddir}/%{source}/icon32.png pixmaps/%{name}.png
mkdir -p icons/hicolor ; cd icons/hicolor
mkdir 16x16 ; bzcat %{SOURCE10} > 16x16/%{name}.png
mkdir 32x32 ; bzcat %{SOURCE11} > 32x32/%{name}.png
mkdir 48x48 ; bzcat %{SOURCE12} > 48x48/%{name}.png


##icons fiddling
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%dir /usr/share/icons/hicolor
%dir /usr/share/icons/hicolor/16x16
%dir /usr/share/icons/hicolor/32x32
%dir /usr/share/icons/hicolor/48x48
%{_datadir}/icons/hicolor/*/%{name}.png
%doc AUTHORS Bugs COPYING ChangeLog LICENSE-sound NEWS README TODO

%files data
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/levels/
%{_datadir}/%{name}/locales/
%dir %{_datadir}/%{name}/skins
%dir %{_datadir}/%{name}/skins/original
%dir %{_datadir}/%{name}/skins/oily
%dir %{_datadir}/%{name}/skins/tronic
%{_datadir}/%{name}/skins/*/*.bmp
%{_datadir}/%{name}/skins/*/*.png
%{_datadir}/%{name}/skins/*/skinrc
%{_datadir}/%{name}/rob/
%{_datadir}/%{name}/sounds/

%files fonts
%{_datadir}/%{name}/skins/*/robbo.ttf
%doc LICENSE-ttf


%changelog
* Wed Oct 08 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.66-1.20141005svn412
- rebuilt for SCM import

* Tue Oct 07 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.66-0.4.20141005svn412
- use GPLv2+ (v2 or any later version, comply to licence text in sources)
- fix duplicated ownership
- fix mode of tarball script
- removed redundant sources

* Tue Oct 07 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.66-0.3.20141005svn412
- fix review issues

* Sun Oct 05 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.66-0.2.20141005svn412
- fix desktop file and icon cache
- fix version tag

* Sat Oct 04 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.66svn412-1
- initital