File quadra.spec of Package quadra

#
# spec file for package quadra
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright Vincent Petry <PVince81@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           quadra
Version:        1.3.0.20090425svn
Release:        0
Summary:        Multiplayer block-falling action puzzle game
License:        LGPL-2.1
Group:          Amusements/Games/Board/Puzzle
Url:            http://code.google.com/p/quadra/
# The source for this package was pulled from upstream's vcs.  Use the
# following commands to generate the tarball:
# svn export -r 740 http://quadra.googlecode.com/svn/trunk/quadra quadra-1.3.0.20090425svn
# tar -cjf quadra-1.3.0-20090425svn.tar.bz2 quadra-1.3.0.20090425svn
Source:         %{name}-%{version}.tar.bz2
Source1:        %{name}.desktop
# PATCH-FIX-UPSTREAM quadra-makefile.patch http://code.google.com/p/quadra/issues/detail?id=104 PVince81@opensuse.org
Patch0:         %{name}-makefile.patch
# Fix for new gcc version (openSUSE 12.1)
Patch1:         %{name}-gcc-fix.patch
# Remove _DATE and _TIME to prevent useless rebuilds
Patch2:         %{name}-builddate.patch
BuildRequires:  SDL-devel
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  bc
BuildRequires:  gcc-c++
BuildRequires:  libpng-devel
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
%endif

%description
Quadra is a full-featured multiplayer block-falling action puzzle game for SDL.

Features:
* Recursive block chaining
* Blocks shadows
* Teams playing
* TCP/IP networking (free Internet playing!)
* Smooth block falling
* Sound effects
* Watches on other players
* Chat window
* CD-based music
* And much more!

%prep
%setup -q
%patch -P 0
%patch -P 1 -p1
%patch -P 2 -p1
sed -i -e "s|datagamesdir:=.*|datagamesdir=%{_datadir}/%{name}|g" config/config.mk.in

%build
autoreconf
%configure --disable-version-check
make DATAGAMESDIR=%{_datadir} %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} bindir=%{_bindir} install
mkdir -p %{buildroot}/%{_datadir}/pixmaps
cp images/quadra.xpm %{buildroot}/%{_datadir}/pixmaps
install -p -D -m 640 %{SOURCE1} %{buildroot}/%{_datadir}/applications/%{name}.desktop
%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%endif

%files
%defattr(-,root,root,-)
%doc LICENSE README NEWS
%attr(0755,root,root) %{_bindir}/%{name}
%dir %attr(0755,root,root) %{_datadir}/%{name}/
%attr(0644,root,root) %{_datadir}/%{name}/%{name}.res
%attr(0644,root,root) %{_datadir}/pixmaps/%{name}.xpm
%attr(0644,root,root) %{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by