Blob Blame History Raw
%global date    20141028
%global rev     412

%global readme  README.fedora

%global source  %{name}-%{version}svn%{rev}


Name:           gnurobbo
Version:        0.66
Release:        7.%{date}svn%{rev}%{?dist}
Summary:        Port of an once famous game named Robbo 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
Patch2:         gnurobbo-remove-original-levels.patch

##icons additionally
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

##information about legal issues
Source20:       %{name}-%{readme}

BuildRequires:  SDL-devel SDL_image-devel
##FIXME fonts and sounds are disabled and so deps should be removed
BuildRequires:  SDL_ttf-devel SDL_mixer-devel

BuildRequires:  cmake
BuildRequires:  gettext
BuildRequires:  desktop-file-utils

Requires:       hicolor-icon-theme

#Bug 1171461 - due to legal reasons only the tronic skin has left
#and therefore we need to depend on it unless someone finds a better solution
Requires:       %{name}-tronic = %{version}-%{release}

#Suggests:       %{name}-skin
Obsoletes:      %{name}-data
Obsoletes:      %{name}-fonts

%description
GNU Robbo is a free open source port of Janusz Pelc's Robbo
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

Take a look into %{readme} about legal issues cause of missing content.


%package tronic
Summary:        Tronic skin for the game %{name}
BuildArch:      noarch
Requires:       %{name} = %{version}-%{release}
Provides:       %{name}-skin

%description tronic
Optional skin named tronic for the game %{name}:
Newly created skin with some vintage science fiction influences.


%prep
%setup -qn %{source}
chmod 0644 %SOURCE1
%patch0
rm Makefile
%patch1
cp -p %SOURCE10 %SOURCE11 %SOURCE12 .
bunzip2 *.png.bz2
cp -p %SOURCE20 %{readme}

##do not distribute any illegal content
sed -i s,add_subdirectory.data.,, CMakeLists.txt

%patch2 -p1


%build
##fonts and sounds are not redistributable, ignore them
%cmake -DUSE_FONTS=OFF -DDISABLE_MUSIC=ON
make %{?_smp_mflags}


%install
%make_install

##legal content parts
install -d %{buildroot}%{_datadir}/%{name}
cp -ap data/locales data/levels data/skins data/rob %{buildroot}%{_datadir}/%{name}

##desktop
cd %{buildroot}
install -d .%{_datadir}/applications
cd .%{_datadir}/applications
cat > %{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 %{name}.desktop

##icons
cd %{buildroot}
install -d .%{_datadir}/icons/hicolor
cd .%{_datadir}/icons/hicolor
for size in 16 32 48; do
 install -d $size'x'$size/apps
 install %{_builddir}/%{buildsubdir}/%{name}.$size.png $size'x'$size/apps/%{name}.png
done
cd %{buildroot}
install -d .%{_datadir}/pixmaps
ln -s ../icons/hicolor/48x48/apps/%{name}.png .%{_datadir}/pixmaps/%{name}.png

%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
%doc AUTHORS Bugs COPYING ChangeLog NEWS README TODO
##distribution is only allowed for legal content
%doc %{readme} LICENSE-ttf LICENSE-sound
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/levels/
%{_datadir}/%{name}/locales/
%{_datadir}/%{name}/rob/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%dir %{_datadir}/%{name}/skins

%files tronic
%{_datadir}/%{name}/skins/tronic/


%changelog
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.66-7.20141028svn412
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Jan 02 2015 Jaromir Capik <jcapik@redhat.com> - 0.66-6.20141028svn412
- Removing original levels to avoid distributing possibly illegal content (#1157664)

* Fri Jan 02 2015 Jaromir Capik <jcapik@redhat.com> - 0.66-5.20141028svn412
- R: gnurobbo-tronic as it seems to be the only legal skin now (#1171461)

* Sat Nov 01 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.66-4.20141028svn412
- rebuilt for SCM
- preserve timestamps of icons
- cleanup package structure again

* Tue Oct 28 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.66-3.20141028svn412
- distribute legal content only (rhbz #1157664)
- use biggest desktop icon that we have (partly rhbz #1157534)
- Obsoletes old subpackage structure

* Mon Oct 27 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0.66-2.20141027svn412
- data and fonts have legal issues, so remove original contents till we have alternatives
- R: hicolor-icon-theme

* 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