File bsd-games.spec of Package bsd-games

#
# spec file for package bsd-games
#
# Copyright (c) 2011 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/
#



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
Version:        2.17
Release:        89
Summary:        Several Text-Mode Games
Source:         %{name}-%{version}.tar.bz2
Source1:        %{name}-rpmlintrc
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.

%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 CC="%__cc" CXX="%__cxx" OPTIMIZE="$RPM_OPT_FLAGS -I/usr/include/ncurses" \
	dab_CXXFLAGS="-DHAVE_fgetln" %{?_smp_mflags}

%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

%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
openSUSE Build Service is sponsored by