Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 43be97ffa58d59d2c80c39f6a6f1c65e > files > 18

koules-1.4-9.fc14.src.rpm

# Only x86 Fedora ships svgalib
%ifarch %{ix86} x86_64
%if 0%{?rhel} < 6
%bcond_without svgalib
%else
%bcond_with svgalib
%endif
%else
%bcond_with svgalib
%endif

Name:           koules
Version:        1.4
Release:        9%{?dist}
Summary:        Action game with multiplayer, network and sound support

Group:          Amusements/Games
License:        GPLv2
URL:            http://www.ucw.cz/~hubicka/koules/
Source0:        http://www.ucw.cz/~hubicka/koules/packages/%{name}%{version}-src.tar.gz
Source1:        koules.desktop
Source2:        koules.sndsrv.linux
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  libX11-devel
BuildRequires:  libXext-devel
BuildRequires:  xmkmf
BuildRequires:  desktop-file-utils
%if %with svgalib
BuildRequires:  svgalib-devel
%endif

Requires:       %{name}-sound = %{version}
Requires:       %{name}-x11 = %{version}
%if %with svgalib
Requires:       %{name}-svgalib = %{version}
%endif

# Shared patches
Patch0:         koules-1.4-clean.patch
Patch1:         koules-1.4-overflows.patch
Patch2:         koules-1.4-spelling.patch
Patch3:         koules-1.4-defines.patch

# SVGAlib specific patches
Patch10:        koules-1.4-retrace.patch
Patch11:        koules-1.4-make.patch

# X11 specific patches
Patch20:        koules-1.4-noman.patch
Patch21:        koules-1.4-asmfix.patch
Patch22:        koules-1.4-imake.patch
Patch23:        koules-1.4-shm.patch
Patch24:        koules-1.4-mode.patch
Patch25:        koules-1.4-shm_check.patch
Patch26:        koules-1.4-fix_xsynchronize.patch
Patch27:        koules-1.4-use_right_visual.patch
Patch28:        koules-1.4-fpe_fix.patch

%description
Koules is a fast action arcade-style game.  It works in fine resolution
with cool 256 color graphics, multiplayer mode up to 5 players, full sound
and, of course, network support.  Koules is an original idea. First version
of Koules was developed from scratch by Jan Hubicka in July 1995.


%if %with svgalib
%package svgalib
Summary:        SVGAlib based variant of a multiplayer action game
Group:          Amusements/Games

%description svgalib
This package contains variant of a classic Linux arcade game with SVGAlib
support and can act as a network server for multiplayer game.  Use of this
package is discouraged as it needs to be run by privileged user unless used
as a network server.  Use koules-x11 package instead whenever possible.
%endif


%package x11
Summary:        X Window system variant of a multiplayer action game
Group:          Amusements/Games
Requires:       xorg-x11-fonts-misc
%if %without svgalib
Obsoletes:      %{name}-svgalib < %{version}-%{release}
%endif

%description x11
This package contains variant of a classic Linux arcade game with X Window
System support and can act as a network server for multiplayer game.


%package sound
Summary:        Sound files for a classic Linux multiplayer action game
Group:          Amusements/Games

%description sound
This package contains sound files for a classic Linux arcade game. To make
sound functioning in Koules you either need to ensure exclusive access to
sound hardware for the game, or use a /dev/dsp wrapper such as padsp from
pulseaudio-utils package.


%define bindir          BINDIR=%{_bindir}
%define sounddir        SOUNDDIR=%{_datadir}/%{name}/sound
%define mandir          MANDIR=%{_mandir}/man6
%define libexecdir      LIBEXECDIR=%{_libexecdir}/%{name}
%define makedirs        %{bindir} %{sounddir} %{mandir} %{libexecdir}


%prep
%if %with svgalib
# SVGAlib variant build tree
%setup -q -n %{name}-%{version}-svga -c
cd %{name}%{version}
%patch0 -p1 -b .clean
%patch1 -p1 -b .overflows
%patch2 -p1 -b .spelling
%patch3 -p1 -b .defines
%patch10 -p1 -b .retrace
%patch11 -p1 -b .make
%endif

# X11 variant build tree
%setup -q -n %{name}-%{version}-x11 -c
cd %{name}%{version}
%patch0 -p1 -b .clean
%patch1 -p1 -b .overflows
%patch2 -p1 -b .spelling
%patch3 -p1 -b .defines
%patch20 -p1 -b .noman
%patch21 -p1 -b .asmfix
%patch22 -p1 -b .imake
#patch23 -p1 -b .shm
%patch24 -p1 -b .mode
%patch25 -p1 -b .shm_check
%patch26 -p1 -b .fix_xsynchronize
%patch27 -p1 -b .use_right_visual
%patch28 -p1 -b .fpe_fix


%build
%if %with svgalib
# Build SVGAlib variant
cd $RPM_BUILD_DIR/%{name}-%{version}-svga/%{name}%{version}
# Builds with multiple concurrent jobs are problematic
make -f Makefile.svgalib %{makedirs} CFLAGS="%{optflags}"
%endif

# Build X11 variant
cd $RPM_BUILD_DIR/%{name}-%{version}-x11/%{name}%{version}
echo '#define HAVEUSLEEP' >>Iconfig
xmkmf -a
make %{makedirs} CCOPTIONS="%{optflags}"


%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_mandir}/man6
install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/sound
install -d $RPM_BUILD_ROOT%{_libexecdir}/%{name}

%if %with svgalib
# Install SVGAlib variant
cd $RPM_BUILD_DIR/%{name}-%{version}-svga/%{name}%{version}
make -f Makefile.svgalib install %{makedirs} DESTDIR=$RPM_BUILD_ROOT \
        INSTALLSOUND=False
%endif

# Install X11 variant, and sound
cd $RPM_BUILD_DIR/%{name}-%{version}-x11/%{name}%{version}
make install %{makedirs} DESTDIR=$RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps
install Icon.xpm $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.xpm
desktop-file-install --vendor fedora                    \
        --dir ${RPM_BUILD_ROOT}%{_datadir}/applications \
        %{SOURCE1}

# PulseAudio wrapper for the sound server
mv $RPM_BUILD_ROOT%{_libexecdir}/%{name}/koules.sndsrv.linux{,.bin}
cp %{SOURCE2} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/koules.sndsrv.linux


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc %{name}%{version}/ANNOUNCE
%doc %{name}%{version}/BUGS
%doc %{name}%{version}/COPYING
%doc %{name}%{version}/Card
%doc %{name}%{version}/ChangeLog
%doc %{name}%{version}/Koules.FAQ
%doc %{name}%{version}/README
%doc %{name}%{version}/TODO

%files sound
%defattr(-,root,root,-)
%{_datadir}/%{name}
%{_libexecdir}/%{name}

%if %with svgalib
%files svgalib
%attr(755,root,root) %{_bindir}/koules.svga
%attr(644,root,root) %{_mandir}/man6/koules.svga.6*
%endif

%files x11
%{_bindir}/xkoules
%attr(644,root,root) %{_mandir}/man6/xkoules.6*
%attr(644,root,root) %{_datadir}/pixmaps/%{name}.xpm
%{_datadir}/applications/fedora-koules.desktop


%changelog
* Fri Jul 9 2010 Lubomir Rintel <lkundrak@v3.sk> 1.4-9
- Do not build svgalib flavour on RHEL-6

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

* Mon Apr 13 2009 Lubomir Rintel <lkundrak@v3.sk> 1.4-7
- Debian apparently fixed shm more sanely than me
- Import bunch of Debian fixes

* Sun Apr 12 2009 Lubomir Rintel <lkundrak@v3.sk> 1.4-6
- Wrap the OSS-based sound server in padsp

* Mon Mar 16 2009 Lubomir Rintel <lkundrak@v3.sk> 1.4-5
- Require fonts
- Fix Xshm support

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Dec 1 2008 Lubomir Rintel <lkundrak@v3.sk> 1.4-3
- Own /usr/libexec/koules (#473931)

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.4-2
- Autorebuild for GCC 4.3

* Sun Oct 28 2007 Lubomir Kundrak <lkundrak@redhat.com> 1.4-1
- From Red Hat Linux 4.2 back into life