File bsd-games.spec of Package bsd-games

#
# spec file for package bsd-games
#
# Copyright (c) 2013 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
Version:        2.17
Release:        0
Summary:        Several Text-Mode Games
License:        BSD-3-Clause
Group:          Amusements/Games/Other
Url:            http://www.advogato.org/proj/bsd-games/
Source:         ftp://metalab.unc.edu/pub/Linux/games/%{name}-%{version}.tar.gz
Source1:        %{name}-rpmlintrc
# PATCH-FIX-UPSTREAM bsd-games-2.17.diff
Patch0:         %{name}-%{version}.diff
# PATCH-FIX-UPSTREAM bsd-games-2.17-inc.diff
Patch1:         %{name}-%{version}-inc.diff
# PATCH-FIX-UPSTREAM bsd-games-2.17-ppc64.diff
Patch2:         %{name}-%{version}-ppc64.diff
# PATCH-FIX-UPSTREAM bsd-games-2.17-strictaliasing.diff
Patch3:         %{name}-%{version}-strictaliasing.diff
# PATCH-FIX-UPSTREAM bsd-games-2.17-execl.diff
Patch4:         %{name}-%{version}-execl.diff
# PATCH-FIX-UPSTREAM bsd-games-2.17-codecleanup.diff
Patch5:         %{name}-%{version}-codecleanup.diff
# PATCH-FIX-UPSTREAM hunt-64bit.patch
Patch7:         hunt-64bit.patch
# PATCH-FIX-UPSTREAM bsd-games-2.17-compile.patch
Patch8:         %{name}-%{version}-compile.patch
# PATCH-FIX-UPSTREAM bsd-games-2.17-gcc4.3.diff
Patch9:         %{name}-%{version}-gcc4.3.diff
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  libopenssl-devel
BuildRequires:  ncurses-devel
BuildRequires:  words
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package copies these games into /usr/games: arithmetic, atc,
backgammon, battlestar, bcd, bog, caesar, canfield, cfscores, cribbage,
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 %{buildroot}
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="gcc" CXX="g++" OPTIMIZE="%{optflags} -I/usr/include/ncurses" \
	dab_CXXFLAGS="-DHAVE_fgetln" %{?_smp_mflags}

%install
make INSTALL_PREFIX=%{buildroot} install
# get rid of dm functionality as it needs a setgid, dm is only used to restrict which games may be played
rm %{buildroot}%{_prefix}/games/dm

# factor is contained also in coreutils, prefer the version there
rm %{buildroot}%{_prefix}/games/factor

rm -rf %{buildroot}%{_mandir}/man5
rm -rf %{buildroot}%{_mandir}/man8
# move the programs into /usr/bin as this is the proper location
mkdir %{buildroot}%{_bindir}
mv %{buildroot}%{_prefix}/games/* %{buildroot}%{_bindir}/
rmdir %{buildroot}%{_prefix}/games
find %{buildroot}%{_localstatedir}/games/ -exec chmod g-w,o-rw {} \;
rm %{buildroot}%{_datadir}/doc/bsd-games/trek.me

%files
%defattr(-,root,root,-)
%doc AUTHORS BUGS COPYING NEWS README SECURITY THANKS TODO YEAR2000
%{_bindir}/*
%{_mandir}/man6/*
%{_datadir}/misc/*
%{_datadir}/games/*
%attr(770,games,games) %{_localstatedir}/games/hack
%attr(770,games,games) %{_localstatedir}/games/phantasia
%attr(770,games,games) %{_localstatedir}/games/sail
%attr(660,games,games) %{_localstatedir}/games/hack/data
%attr(660,games,games) %{_localstatedir}/games/hack/help
%attr(660,games,games) %{_localstatedir}/games/hack/hh
%attr(660,games,games) %{_localstatedir}/games/hack/perm
%attr(660,games,games) %{_localstatedir}/games/hack/record
%attr(660,games,games) %{_localstatedir}/games/hack/rumors
%attr(660,games,games) %{_localstatedir}/games/phantasia/characs
%attr(660,games,games) %{_localstatedir}/games/phantasia/gold
%attr(660,games,games) %{_localstatedir}/games/phantasia/lastdead
%attr(660,games,games) %{_localstatedir}/games/phantasia/mess
%attr(660,games,games) %{_localstatedir}/games/phantasia/monsters
%attr(660,games,games) %{_localstatedir}/games/phantasia/motd
%attr(660,games,games) %{_localstatedir}/games/phantasia/scoreboard
%attr(660,games,games) %{_localstatedir}/games/phantasia/void
%attr(660,games,games) %{_localstatedir}/games/atc_score
%attr(660,games,games) %{_localstatedir}/games/battlestar.log
%attr(660,games,games) %{_localstatedir}/games/cfscores
%attr(660,games,games) %{_localstatedir}/games/criblog
%attr(660,games,games) %{_localstatedir}/games/robots_roll
%attr(660,games,games) %{_localstatedir}/games/saillog
%attr(660,games,games) %{_localstatedir}/games/snake.log
%attr(660,games,games) %{_localstatedir}/games/snakerawscores
%attr(660,games,games) %{_localstatedir}/games/tetris-bsd.scores

%changelog
openSUSE Build Service is sponsored by