File bsd-games.spec of Package bsd-games

#
# spec file for package bsd-games (Version 2.17)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#

# norootforbuild


Name:           bsd-games
Url:            http://www.advogato.org/proj/bsd-games/
BuildRequires:  bison flex gcc-c++ libopenssl-devel ncurses-devel words
License:        BSD 3-Clause
Group:          Amusements/Games/Other
Provides:       bsdgames 
Obsoletes:      bsdgames
PreReq:         permissions
AutoReqProv:    on
Version:        2.17
Release:        81
Summary:        Several Text-Mode Games
Source:         %{name}-%{version}.tar.bz2
Patch0:         %{name}-%{version}.diff
Patch1:         %{name}-%{version}-inc.diff
Patch2:         %{name}-%{version}-ppc64.diff
Patch3:         %{name}-%{version}-strictaliasing.diff
Patch4:         %{name}-%{version}-execl.diff
Patch5:         %{name}-%{version}-codecleanup.diff
Patch7:         hunt-64bit.patch
Patch8:         %{name}-%{version}-compile.patch
Patch9:         %{name}-%{version}-gcc4.3.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package copies these games into /usr/games: arithmetic, atc,
backgammon, battlestar, bcd, bog, caesar, canfield, cfscores, cribbage,
factor, fish, fortune, hangman, hunt, mille, monop, morse, number,
paranoia, pom, ppt, primes, rain, robots, sail, snake, snscore,
teachgammon, trek, wargames, worm, worms, and wump.



Authors:
--------
    Curt Olson <curt@sledge.mn.org>
    Andy Tefft <teffta@erie.ge.com>

%prep
%setup -q -n bsd-games-%{version}
%patch0
%patch1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5
%patch7
%patch8
%patch9

%build
(echo $RPM_BUILD_ROOT
echo "fortune"
for i in {1,2}{1,2,3,4,5}; do echo; done;		# 10 times default
echo
echo "n" 						# Set owners/groups on installed files
yes "") | ./configure
make OPTIMIZE="$RPM_OPT_FLAGS -I/usr/include/ncurses" dab_CXXFLAGS="-DHAVE_fgetln"

%install
make INSTALL_PREFIX=$RPM_BUILD_ROOT install
chmod -R g+w $RPM_BUILD_ROOT/var/games/*
# create a list of binaries to be checked externally
: > $RPM_BUILD_ROOT/usr/share/games/sgidlist
: > filelist.add
for i in `ls $RPM_BUILD_ROOT/usr/games` ; do
    echo $i
    case $i in
        atc|battlestar|cfscores|cribbage|phantasia|robots|sail|snake|tetris-bsd|\
	adventure|arithmetic|backgammon|boggle|caesar|canfield|dm|fish|gomoku|hangman|\
	hunt|huntd|mille|monop|pig|pom|ppt|primes|quiz|rain|snscore|teachgammon|\
	trek|worm|worms|wump|dab)
	echo "/usr/games/$i" >> $RPM_BUILD_ROOT/usr/share/games/sgidlist
	echo "%%verify(not mode) %%attr(0755,games,games) /usr/games/$i" >> filelist.add
	;;
	*)
	echo "%%attr(0755,games,games) /usr/games/$i" >> filelist.add
	;;
    esac
done
rm $RPM_BUILD_ROOT/usr/share/doc/bsd-games/trek.me

%clean
rm -rf $RPM_BUILD_ROOT

%post
%run_permissions
%verifyscript
%verify_permissions -f /usr/share/games/sgidlist

%files -f filelist.add
%defattr(-,root,root)
%doc AUTHORS BUGS COPYING NEWS README SECURITY THANKS TODO YEAR2000
%doc %{_mandir}/*/*
%attr(-,games,games) /usr/share/games/*
%attr(-,games,games) /var/games/*
%attr(-,games,games) /usr/share/misc/*

%changelog
* Fri Aug 22 2008 lmichnovic@suse.cz
- compiling with -I/usr/include/ncurses
* Fri Feb 08 2008 meissner@suse.de
- replace name/host mismatch in utmpentry to fix gcc
  warning (copy and pasto)
* Fri Oct 26 2007 anicka@suse.cz
- fix for gcc 4.3
* Thu Aug 09 2007 anosek@suse.cz
- fixed build (compile.patch)
* Fri Aug 03 2007 anosek@suse.cz
- updated to version 2.17
  - added new game dab (Dots and Boxes)
  - bugfixes
* Fri Mar 30 2007 rguenther@suse.de
- add bison, flex and ncurses-devel BuildRequires
* Tue Aug 15 2006 anosek@suse.cz
- fixed Hunt not working on 64 bit [#199214] (hunt-64bit.patch)
* Sat May 27 2006 schwab@suse.de
- Don't strip binaries.
* Fri Apr 14 2006 mmarek@suse.cz
- fix typo in last fix (-p1 vs. -p0)
* Wed Apr 12 2006 mmarek@suse.cz
- fix two buffer overflows in scanf() calls, one in sail which is
  setgid games
  [#165465] (overflow.diff)
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Oct 11 2005 mmarek@suse.cz
- Fix strict aliasing once again for gcc-4.1
* Thu May 12 2005 meissner@suse.de
- fixed buffer overflow on 64bit platforms.
* Thu May 12 2005 meissner@suse.de
- use RPM_OPT_FLAGS
* Tue Apr 12 2005 pth@suse.de
- And another incomplete declaration fixed.
* Mon Apr 04 2005 pth@suse.de
- Fix incomplete struct declaration and thus make it compile with gcc >= 4
- Eliminate most compiler warnings.
* Sun Jan 23 2005 meissner@suse.de
- fixed execl* calls
* Fri Nov 12 2004 ro@suse.de
- fixed permission handling
* Tue Apr 27 2004 mmj@suse.de
- Fix strict aliasing
* Thu Oct 30 2003 ro@suse.de
- don't build as root
- package according to permissions.secure and call run_permissions
* Tue Sep 16 2003 ltinkl@suse.cz
- fix excessive setgid permissions (#30912)
* Tue May 27 2003 pmladek@suse.cz
- fixed installation of phantasia score files to do not produce
  unpackaged files
- uniffied the suffix of patches to .diff
* Tue Jul 30 2002 kukuk@suse.de
- use group games instead of game
* Thu Jul 11 2002 olh@suse.de
- add bsd-games-2.13-ppc64.diff, text is not a valid function name
* Wed Dec 12 2001 pmladek@suse.cz
- updated to version 2.13
- package renamed from bsdgames to bsd-games
* Fri May 25 2001 pmladek@suse.cz
- fixed includes on ia64
* Tue May 08 2001 mfabian@suse.de
- bzip2 sources
* Mon Feb 12 2001 ro@suse.de
- define timerclear if undef in huntd/ctl_transact
* Sun Oct 01 2000 kukuk@suse.de
- Remove termcap from need for build
- Fix sail for compiling with glibc 2.2
* Thu Jun 08 2000 vinil@suse.cz
- file list changed
* Fri Jun 02 2000 vinil@suse.cz
- fortune excluded
- group and set-gid for games
* Tue May 23 2000 vinil@suse.cz
- update to version 2.11 (major file relocations, because of FHS)
- buildroot added
* Fri Mar 03 2000 ro@suse.de
- use macro for mandir
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Fri Oct 02 1998 ro@suse.de
- adventure: no more -traditional-cpp
- configure: use bsd-lib only if it's there
- dm/dm.c:   dont try to include nlist for glibc
- phantasia/phantglobs.h: dont redeclare strcpy et. al. for glibc
- sail/extern.h:          dito
* Fri Sep 18 1998 max@suse.de
- added some files to the filelist
* Fri Oct 24 1997 max@suse.de
- moved from Version 1.3 to 1.5
- prepared for autobuild
- corrected some paths