Blob Blame History Raw
%global fontconf 64-%{name}-mutante.conf

Name:           cave9
Version:        0.3
Release:        9%{?dist}
Summary:        3d game of cave exploration

Group:          Amusements/Games
License:        LGPLv3 and CC-BY-SA and Public Domain
URL:            http://code.google.com/p/cave9
Source0:        http://cave9.googlecode.com/files/cave9_src-%{version}.tgz
Source1:        http://cave9.googlecode.com/files/cave9_data-4.tgz
Source2:        cave9.desktop
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  SDL_image-devel, SDL_net-devel, SDL_ttf-devel, mesa-libGL-devel, desktop-file-utils, fontpackages-devel
Requires:       cave9-mutante-fonts


%description
Cave9 is a gravity cave-exploration game.

%package        mutante-fonts

Summary:        Mutante font used by the hud in cave9 game
BuildArch:      noarch
Group:          User Interface/X
License:        CC-BY
Requires:       fontpackages-filesystem
Source3:        %{name}-mutante-fontconfig.conf

%description mutante-fonts
Fantasy/display font used by the cave9 game, this font has only the basic
characters used in the portuguese language was made as an experiment by the
designer Jonas K├╝hner (http://www.criatipos.com/) the font was altered by
the game developer to also include numbers.

%_font_pkg -n mutante -f %{fontconf} mutante.ttf
%doc data_README.txt

%prep
%setup -q -a1
sed -i src/GNUmakefile -e "s/-Wall -Werror -ggdb//"

%build
CFLAGS="%{optflags}" make %{?_smp_mflags}

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/bin %{buildroot}/usr/share/cave9
install -m 755 -p cave9 $RPM_BUILD_ROOT/usr/bin 
cp -p data/wall.jpg data/icon.png data/thrust.wav data/crash.wav data/hit.wav $RPM_BUILD_ROOT/usr/share/cave9

install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0644 -p data/*.ttf %{buildroot}%{_fontdir}/mutante.ttf

install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
                   %{buildroot}%{_fontconfig_confdir}

install -m 0644 -p %{SOURCE3} \
        %{buildroot}%{_fontconfig_templatedir}/%{fontconf}
ln -s %{_fontconfig_templatedir}/%{fontconf} \
      %{buildroot}%{_fontconfig_confdir}/%{fontconf}

ln -s ../../..%{_fontdir}/mutante.ttf $RPM_BUILD_ROOT/usr/share/cave9/hud.ttf

mv data/README.txt data_README.txt
desktop-file-install --vendor="fedora"                    \
  --dir=${RPM_BUILD_ROOT}%{_datadir}/applications         \
  %{SOURCE2}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc AUTHORS.txt README.txt COPYING.txt data_README.txt
%{_bindir}/cave9
%{_datadir}/cave9
%{_datadir}/applications/fedora-cave9.desktop

%changelog
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Jun 24 2009 Victor Bogado <victor@bogado.net> 0.3-8
- removed the redundant ownership of the fontdir.
- lowered the priority
- Updated the font configuration to better match the suggested template.

* Tue Jun 23 2009 Victor Bogado <victor@bogado.net> 0.3-7
- following the tips from Nicolas Mailhot on bug#477371

* Mon Jun 22 2009 Victor Bogado <victor@bogado.net> 0.3-6
- adapted the font subpackge to the new template on Fedora 11

* Wed Jan 14 2009 Victor Bogado <victor@bogado.net> 0.3-5
- Added a fontconfig file.
- Renamed the font file subpackage to follow the font package naming convention.

* Tue Dec 30 2008 Victor Bogado <victor@bogado.net> 0.3-4
- Separate the font into a new package.

* Sun Nov 09 2008 Victor Bogado <victor@bogado.net> 0.3-3
- Use install -m 755 to ensure correct mode for binaries.
- Final dot missing on description.
- Missing "Public Domain" for nasa data files.

* Fri Nov 07 2008 Victor Bogado <victor@bogado.net> 0.3-2
- better description
- use of macros
- BuildRequires was missing 'desktop-file-utils'
- Flag to preserve timestamps on 'cp'

* Mon Sep 15 2008 Victor Bogado <victor@bogado.net> 0.3-1
- update version and data file.
- new data file is now compleatly free.

* Sat Apr 19 2008 Victor Bogado <victor@bogado.net> 0.2-2
- Use the compiler flags from fedora

* Wed Apr 16 2008 Victor Bogado <victor@bogado.net> 0.2-1
- initial spec