8ba2cc8
# Copyright (c) 2007 oc2pus <toni@links2linux.de>
8ba2cc8
# Copyright (c) 2007 Hans de Goede <j.w.r.degoede@hhs.nl>
8ba2cc8
# This file and all modifications and additions to the pristine
8ba2cc8
# package are under the same license as the package itself.
8ba2cc8
8ba2cc8
Name:           BlockOutII
8ba2cc8
Version:        2.3
8ba2cc8
Release:        3%{?dist}
8ba2cc8
Summary:        A free adaptation of the original BlockOut DOS game
8ba2cc8
Group:          Amusements/Games
8ba2cc8
License:        GPLv2+
8ba2cc8
URL:            http://www.blockout.net/blockout2/
8ba2cc8
# To regenerate:
8ba2cc8
# cvs -z3 -d:pserver:anonymous@blockout.cvs.sourceforge.net:/cvsroot/blockout co -D 2007-11-25 -P blockout
8ba2cc8
# mv blockout BlockOutII-2.3
8ba2cc8
# cd BlockOutII-2.3
8ba2cc8
# rm -r `find -name CVS` contrib/dxsdk8.rar contrib/D3DTools BlockOut/setup
8ba2cc8
# rm -r CVSROOT contrib/ImageLib/src/png/png contrib/ImageLib/src/png/zlib
8ba2cc8
# mp32ogg BlockOut/sounds/music.mp3
8ba2cc8
# cd ..
8ba2cc8
# tar cvfj BlockOutII-2.3.tar.bz2 BlockOutII-2.3
8ba2cc8
Source0:        %{name}-%{version}.tar.bz2
8ba2cc8
Source1:        %{name}.desktop
8ba2cc8
Source2:        %{name}.png
8ba2cc8
Patch0:         BlockOutII-2.3-syslibs.patch
8ba2cc8
Patch1:         BlockOutII-2.3-64bit.patch
8ba2cc8
Patch2:         BlockOutII-2.3-bl2Home.patch
8ba2cc8
Patch3:         BlockOutII-2.3-music.patch
8ba2cc8
Patch4:         BlockOutII-2.3-restore-resolution.patch
8ba2cc8
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
8ba2cc8
BuildRequires:  SDL_mixer-devel libpng-devel desktop-file-utils
8ba2cc8
Requires:       hicolor-icon-theme
8ba2cc8
8ba2cc8
%description
8ba2cc8
BlockOut II is a free adaptation of the original BlockOut
8ba2cc8
DOS game edited by California Dreams in 1989. BlockOut II
8ba2cc8
has the same features than the original game with few graphic
8ba2cc8
improvements. The score calculation is also nearly similar to
8ba2cc8
the original game. BlockOut II has been designed by an addicted
8ba2cc8
player for addicted players. BlockOut II is an open source
8ba2cc8
project available for both Windows and Linux.
8ba2cc8
8ba2cc8
Blockout is a registered trademark of Kadon Enterprises, Inc.,
8ba2cc8
used by permission for the BlockOut II application by Jean-Luc
8ba2cc8
Pons.
8ba2cc8
8ba2cc8
8ba2cc8
%prep
8ba2cc8
%setup -q
8ba2cc8
%patch0 -p1
8ba2cc8
%patch1 -p1
8ba2cc8
%patch2 -p1
8ba2cc8
%patch3 -p1
8ba2cc8
%patch4 -p1 -z .fs
8ba2cc8
chmod -x `find -type f`
8ba2cc8
iconv -f ISO8859-1 -t UTF8 BlockOut/README.txt > t; mv t BlockOut/README.txt
8ba2cc8
8ba2cc8
8ba2cc8
%build
8ba2cc8
pushd contrib/ImageLib/src
8ba2cc8
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -Dlinux -c" \
8ba2cc8
    CXXFLAGS="$RPM_OPT_FLAGS -Dlinux -c"
8ba2cc8
popd
8ba2cc8
8ba2cc8
pushd BlockOut_GL
8ba2cc8
make %{?_smp_mflags} \
8ba2cc8
    CXXFLAGS="$RPM_OPT_FLAGS -Dlinux `sdl-config --cflags` -I../contrib/ImageLib/src -c" \
8ba2cc8
    SDL_ROOT=%{_prefix} LIBS="-L../contrib/ImageLib/src -lpng -lz" \
8ba2cc8
    IMGLIB_ROOT=../contrib/ImageLib/src
8ba2cc8
popd
8ba2cc8
8ba2cc8
8ba2cc8
%install
8ba2cc8
rm -rf $RPM_BUILD_ROOT
8ba2cc8
mkdir -p $RPM_BUILD_ROOT%{_bindir}
8ba2cc8
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/images
8ba2cc8
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/sounds
8ba2cc8
8ba2cc8
install -m 755 BlockOut_GL/blockout $RPM_BUILD_ROOT%{_bindir}/%{name}
8ba2cc8
install -p -m 644 BlockOut/images/* $RPM_BUILD_ROOT%{_datadir}/%{name}/images
8ba2cc8
install -p -m 644 BlockOut/sounds/* $RPM_BUILD_ROOT%{_datadir}/%{name}/sounds
8ba2cc8
8ba2cc8
# below is the desktop file and icon stuff.
8ba2cc8
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
8ba2cc8
desktop-file-install --vendor fedora            \
8ba2cc8
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
8ba2cc8
  %{SOURCE1}
8ba2cc8
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
8ba2cc8
install -p -m 644 %{SOURCE2} \
8ba2cc8
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
8ba2cc8
8ba2cc8
8ba2cc8
%clean
8ba2cc8
rm -rf $RPM_BUILD_ROOT
8ba2cc8
8ba2cc8
8ba2cc8
%post
8ba2cc8
touch --no-create %{_datadir}/icons/hicolor || :
8ba2cc8
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
8ba2cc8
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
8ba2cc8
fi
8ba2cc8
8ba2cc8
%postun
8ba2cc8
touch --no-create %{_datadir}/icons/hicolor || :
8ba2cc8
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
8ba2cc8
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
8ba2cc8
fi
8ba2cc8
8ba2cc8
8ba2cc8
%files
8ba2cc8
%defattr(-,root,root,-)
8ba2cc8
%doc BlockOut/README.txt
8ba2cc8
%{_bindir}/%{name}
8ba2cc8
%{_datadir}/%{name}
8ba2cc8
%{_datadir}/applications/fedora-%{name}.desktop
8ba2cc8
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
8ba2cc8
8ba2cc8
8ba2cc8
%changelog
8ba2cc8
* Thu Nov 29 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 2.3-3
8ba2cc8
- Fix restoration of resolution when leaving fullscreen
8ba2cc8
- Don't use macros in cvs co instructions
8ba2cc8
8ba2cc8
* Mon Nov 26 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 2.3-2
8ba2cc8
- Add missing libpng-devel BR (bz 398791)
8ba2cc8
- Add include date in CVS tarbal reproduction instructions (bz 398791)
8ba2cc8
8ba2cc8
* Sat Nov 24 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 2.3-1
8ba2cc8
- Initial Fedora Package based on the packman package