3 Commits

3 changed files with 77 additions and 7 deletions

64
bsd-games-gcc14.diff Normal file
View File

@@ -0,0 +1,64 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2024-11-02 12:47:35.175170023 +0100
Upstream: dead
---
dab/player.h | 1 +
hunt/hunt/otto.c | 10 ++++++----
monop/cards.c | 2 +-
3 files changed, 8 insertions(+), 5 deletions(-)
Index: bsd-games-2.17/dab/player.h
===================================================================
--- bsd-games-2.17.orig/dab/player.h
+++ bsd-games-2.17/dab/player.h
@@ -49,6 +49,7 @@ class BOARD;
class PLAYER {
public:
PLAYER(char who);
+ virtual ~PLAYER() = default;
virtual void play(const BOARD& b, size_t& y, size_t& x, int& dir) = 0;
// Helper functions
Index: bsd-games-2.17/hunt/hunt/otto.c
===================================================================
--- bsd-games-2.17.orig/hunt/hunt/otto.c
+++ bsd-games-2.17/hunt/hunt/otto.c
@@ -166,7 +166,7 @@ otto(y, x, face)
char face;
{
int i;
- int old_mask;
+ sigset_t old_mask, new_mask;
# ifdef DEBUG
if (debug == NULL) {
@@ -176,10 +176,12 @@ otto(y, x, face)
fprintf(debug, "\n%c(%d,%d)", face, y, x);
# endif
(void) signal(SIGALRM, nothing);
- old_mask = sigblock(sigmask(SIGALRM));
+ sigemptyset(&new_mask);
+ sigaddset(&new_mask, SIGALRM);
+ sigprocmask(SIG_BLOCK, &new_mask, &old_mask);
setitimer(ITIMER_REAL, &pause_time, NULL);
- sigpause(old_mask);
- sigsetmask(old_mask);
+ sigsuspend(&new_mask);
+ sigprocmask(SIG_SETMASK, &old_mask, NULL);
/* save away parameters so other functions may use/update info */
switch (face) {
Index: bsd-games-2.17/monop/cards.c
===================================================================
--- bsd-games-2.17.orig/monop/cards.c
+++ bsd-games-2.17/monop/cards.c
@@ -135,7 +135,7 @@ get_card(dp)
do {
fseek(deckf, dp->offsets[dp->last_card], SEEK_SET);
- dp->last_card = ++(dp->last_card) % dp->num_cards;
+ dp->last_card = (dp->last_card + 1) % dp->num_cards;
type_maj = getc(deckf);
} while (dp->gojf_used && type_maj == GOJF);
type_min = getc(deckf);

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sat Nov 2 11:17:53 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
- Add bsd-games-gcc14.diff to resolve FTBFS
-------------------------------------------------------------------
Thu Feb 22 10:11:09 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package bsd-games
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -22,7 +22,7 @@ Release: 0
Summary: Several Text-Mode Games
License: BSD-3-Clause
Group: Amusements/Games/Other
Url: http://www.advogato.org/proj/bsd-games/
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
@@ -43,6 +43,8 @@ Patch7: hunt-64bit.patch
Patch8: %{name}-%{version}-compile.patch
# PATCH-FIX-UPSTREAM bsd-games-2.17-gcc4.3.diff
Patch9: %{name}-%{version}-gcc4.3.diff
# PATCH-FIX-UPSTREAM fix building with gcc 14
Patch10: bsd-games-gcc14.diff
BuildRequires: bison
BuildRequires: flex
BuildRequires: gcc-c++
@@ -50,7 +52,6 @@ BuildRequires: libopenssl-devel
BuildRequires: words
BuildRequires: pkgconfig(ncursesw)
Requires(pre): user(games) group(games)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package provides these games: arithmetic, atc,
@@ -70,6 +71,7 @@ teachgammon, trek, wargames, worm, worms, and wump.
%patch -P 7
%patch -P 8
%patch -P 9
%patch -P 10 -p1
%build
# easier than patching :-)
@@ -91,8 +93,7 @@ make INSTALL_PREFIX=%{buildroot} install SBINDIR="%{_bindir}"
rm %{buildroot}%{_bindir}/dm
rm -rf %{buildroot}%{_mandir}/man5
rm -rf %{buildroot}%{_mandir}/man8
rm -Rf %{buildroot}%{_mandir}/man5 %{buildroot}%{_mandir}/man8
find %{buildroot}%{_localstatedir}/games/ -exec chmod g-w,o-rw {} \;
rm %{buildroot}%{_datadir}/doc/bsd-games/trek.me
@@ -105,8 +106,8 @@ mv %{buildroot}%{_mandir}/man6/monop.6.gz %{buildroot}%{_mandir}/man6/monopoly.6
mv %{buildroot}%{_bindir}/fish %{buildroot}%{_bindir}/fish-game
%files
%defattr(-,root,root,-)
%doc AUTHORS BUGS COPYING NEWS README SECURITY THANKS TODO YEAR2000
%license COPYING
%doc AUTHORS BUGS NEWS README SECURITY THANKS TODO YEAR2000
%{_bindir}/*
%{_mandir}/man6/*
%{_datadir}/misc/*