LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File blobwars.spec of Package blobwars (Project home:ykoba)

# Now for the meat of the spec file
#
%define _icondir %{_datadir}/icons/hicolor
%define _gamesbindir %{_prefix}/games/
%define _gamesdatadir %{_datadir}/games/

Name:			blobwars
Version:		1.17
Summary:		Blob Wars : Episode I
License:		GPLv2
URL:			http://www.parallelrealities.co.uk/projects/blobWars.php
Group:			Games/Arcade
Release:		1
Source0:		%{name}-%{version}.tar.gz
Source1:		%{name}-icons.tar
Patch0:			blobwars-1.17_makefile.patch
BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires:		desktop-file-utils
BuildRequires:		hicolor-icon-theme
BuildRequires:		gcc-c++
BuildRequires:		pkg-config
BuildRequires:		update-desktop-files
BuildRequires:		SDL-devel
BuildRequires:		SDL_image-devel
BuildRequires:		SDL_mixer-devel
BuildRequires:		SDL_ttf-devel
BuildRequires:		SDL_net-devel
BuildRequires:		zlib-devel
Requires:		hicolor-icon-theme

%description
Blob Wars : Metal Blob Solid. This is Episode I of the Blob Wars Saga.
You must undertake the role of fearless Blob solider, Bob, as he infiltrates
various enemy installations and hideouts in an attempt to rescue as many
MIAs as possible.

%prep
%setup -q
%setup -q -a 1
%patch0 -p1

%build
export CFLAGS="${CFLAGS} %{optflags}"
%{__make} %{?jobs:-j%jobs} VERSION=%{version} RELEASE=%{release} DOCDIR=%{_docdir}/%{name}/ ICONDIR=%{_icondir}/

%install
./pak data gfx music sound %{name}.pak

mkdir -p %{buildroot}/%{_gamesbindir}
mkdir -p %{buildroot}/%{_gamesdatadir}/%{name}
mkdir -p %{buildroot}/%{_icondir}/16x16/apps
mkdir -p %{buildroot}/%{_icondir}/32x32/apps
mkdir -p %{buildroot}/%{_icondir}/64x64/apps
mkdir -p %{buildroot}%{_datadir}/applications
install -m 755 %{name} %{buildroot}/%{_gamesbindir}/%{name}
install -m 644 %{name}.pak %{buildroot}/%{_gamesdatadir}/%{name}/%{name}.pak
install -m 644 icons/%{name}-large.png %{buildroot}/%{_icondir}/64x64/apps/%{name}.png
install -m 644 icons/%{name}.png %{buildroot}/%{_icondir}/32x32/apps/%{name}.png
install -m 644 icons/%{name}-mini.png %{buildroot}/%{_icondir}/16x16/apps/%{name}.png

pushd locale
for f in *.po
do
	if [ "${f}" == "*.po" ]
	then
		break
	fi
	lang=$(echo ${f} | sed -e 's/\.po$//')
	mkdir -p %{buildroot}%{_datadir}/locale/${lang}/LC_MESSAGES/
	install -m 644 ${f} %{buildroot}%{_datadir}/locale/${lang}/LC_MESSAGES/%{name}.mo
done
popd

# fix translation locales
#
mv %{buildroot}/%{_datadir}/locale/iw %{buildroot}/%{_datadir}/locale/he || :
mv %{buildroot}/%{_datadir}/locale/no %{buildroot}/%{_datadir}/locale/nb || :

cat <<_EOF_ >icons/%{name}.desktop
[Desktop Entry]
Name=Blob Wars : Episode I
Comment=Blob Wars : Episode I
Type=Application
Exec=%{name}
Icon=%{name}
Categories=Game;ArcadeGame;
Terminal=false
_EOF_

install -D -m644 icons/%{name}.desktop %{buildroot}/%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file -i %{name}

%find_lang %{name}

%clean
%{__rm} -rf %{buildroot}
%{__rm} -rf %{_builddir}/%{name}-%{version}-%{release}-buildroot

%files -f %{name}.lang
%defattr(-,root,root)
%doc doc/*
%{_datadir}/applications/*%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%dir %{_gamesdatadir}/%{name}
%attr(-,root,games) %{_gamesbindir}/%{name}
%attr(-,root,games) %{_gamesdatadir}/%{name}/%{name}.pak

%changelog
* Wed Jun 30 2010 David Bolt <davjam@davjam.org> 1.17
- First version for openSUSE