summaryrefslogtreecommitdiffstats
path: root/bsd-games.spec
blob: f8e3de94618ce3e969ea37d9cab0453141d25d37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
Summary: Collection of text-based games
Name: bsd-games
Version: 2.17
Release: 21%{?dist}
License: BSD and BSD with advertising
Group: Amusements/Games
URL: ftp://metalab.unc.edu/pub/Linux/games/
Source0: ftp://metalab.unc.edu/pub/Linux/games/bsd-games-%{version}.tar.gz
Source1: config.params
# A collection of patches from Debian.
Patch0: bsd-games-2.17-debian.patch
# Patches from Fedora Core 1
Patch1: bsd-games-2.17-ospeed.patch
Patch2: bsd-games-2.17-getline.patch
Patch3: bsd-games-2.17-utmpstruct.patch
# Additional new patches
Patch4: bsd-games-2.17-setresgid.patch
Patch5: bsd-games-2.17-tetrisgid.patch
Patch6: bsd-games-2.17-hackgid.patch
Patch7: bsd-games-2.17-phantasiagid.patch
# Add patches for man page renames
Patch8: bsd-games-2.17-monop-rename.patch
Patch9: bsd-games-2.17-banner-rename.patch
Patch10: bsd-games-2.17-stdio-c++.patch
Patch11: bsd-games-2.17-nolibtermcap.patch
Patch12: bsd-games-2.17-tetris-rename.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ncurses-devel words flex bison
Requires(Pre): /usr/sbin/groupadd

%description
Bsd-games includes adventure, arithmetic, atc, backgammon, battlestar,
bcd, caesar, canfield, cfscores, cribbage, go-fish, gomoku,
hunt, mille, mpoly, morse, number, phantasia, pig, pom, ppt, primes,
quiz, rain, random, robots, rot13, sail, snake, snscore, teachgammon,
bsd-fbg, trek, worm, worms and wump.

%prep
%setup -q
install -p -m 755 %{SOURCE1} .
%patch0 -p1 -b .debian
%patch1 -p1 -b .ospeed
%patch2 -p1 -b .getline
%patch3 -p1 -b .utmpstruct
%patch4 -p1 -b .setresgid
%patch5 -p1 -b .tetrisgid
%patch6 -p1 -b .hackgid
%patch7 -p1 -b .phantasiagid
%patch8 -p1 -b .monop.rename
%patch9 -p0 -b .banner.rename
%patch10 -p0 -b .cplusplus
%patch11 -p0 -b .nolibtermcap
%patch12 -p0 -b .tetris.rename

%build
# We include a templatized configuration settings file to set
# reasonable defaults, and to tell the configure script not to
# run in interactive mode.
sed -i.bak -e "s#@DESTDIR@#$RPM_BUILD_ROOT#" \
    -e "s#@bindir@#%{_bindir}#" \
    -e "s#@docdir@#%{_docdir}#" \
    -e "s#@sbindir@#%{_sbindir}#" \
    -e "s#@datadir@#%{_datadir}#" \
    -e "s#@libdir@#%{_libdir}#" \
    -e "s#@mandir@#%{_mandir}#" \
    -e "s#@var@#%{_var}#" \
    -e "s#@RPM_OPT_FLAGS@#$RPM_OPT_FLAGS#" \
    config.params 

# Don't use %%configure.  This configure script wasn't generated by
# autoconf and doesn't obey things like --prefix.
./configure
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" %{?_smp_mflags}

# Rename one doc file to avoid naming collisions
cp hunt/README README.hunt

%install
rm -rf $RPM_BUILD_ROOT
make RPM_BUILD_ROOT="$RPM_BUILD_ROOT" install

# Change the binary name for monop to prevent a conflict with the mono-devel
# package
mv $RPM_BUILD_ROOT/%{_bindir}/monop $RPM_BUILD_ROOT/%{_bindir}/mpoly
mv $RPM_BUILD_ROOT/%{_mandir}/man6/monop.6.gz $RPM_BUILD_ROOT/%{_mandir}/man6/mpoly.6.gz

# Change the binary name for banner to prevent a conflict with a Fedora
# package with the same name
mv $RPM_BUILD_ROOT/%{_bindir}/banner $RPM_BUILD_ROOT/%{_bindir}/vert-banner
mv $RPM_BUILD_ROOT/%{_mandir}/man6/banner.6.gz $RPM_BUILD_ROOT/%{_mandir}/man6/vert-banner.6.gz

# Change the binary name for tetris to prevent a conflict with the mono-devel
# package
mv $RPM_BUILD_ROOT/%{_bindir}/tetris-bsd $RPM_BUILD_ROOT/%{_bindir}/bsd-fbg
mv $RPM_BUILD_ROOT/%{_mandir}/man6/tetris-bsd.6.gz $RPM_BUILD_ROOT/%{_mandir}/man6/bsd-fbg.6.gz

# Remove this doc file.  We're copying it to a different location for Fedora.
rm -f $RPM_BUILD_ROOT/%{_docdir}/trek.me

%clean
rm -rf $RPM_BUILD_ROOT

%pre
%{_sbindir}/groupadd gamehack &>/dev/null || :
%{_sbindir}/groupadd gamesail &>/dev/null || :
%{_sbindir}/groupadd gamephant &>/dev/null || :

%files
%defattr(-,root,root)
%{_bindir}/adventure
%{_bindir}/arithmetic
%attr(2755,root,games) %{_bindir}/atc
%{_bindir}/backgammon
%{_bindir}/teachgammon
%attr(2755,root,games) %{_bindir}/battlestar
%{_bindir}/boggle
%{_bindir}/bcd
%{_bindir}/caesar
%{_bindir}/dab
%{_bindir}/rot13
%attr(2755,root,games) %{_bindir}/canfield
%{_bindir}/cfscores
%attr(2755,root,games) %{_bindir}/cribbage
%{_bindir}/go-fish
%{_bindir}/gomoku
%attr(2755,root,gamehack) %{_bindir}/hack
%{_bindir}/hangman
%{_bindir}/hunt
%{_bindir}/mille
%{_bindir}/mpoly
%{_bindir}/morse
%{_bindir}/number
%attr(2755,root,gamephant) %{_bindir}/phantasia
%{_bindir}/pig
%{_bindir}/pom
%{_bindir}/ppt
%{_bindir}/primes
%{_bindir}/quiz
%{_bindir}/rain
%{_bindir}/random
%attr(2755,root,games) %{_bindir}/robots
%attr(2755,root,gamesail) %{_bindir}/sail
%attr(2755,root,games) %{_bindir}/snake
%{_bindir}/snscore
%attr(2755,root,games) %{_bindir}/bsd-fbg
%{_bindir}/trek
%{_bindir}/vert-banner
%{_bindir}/worm
%{_bindir}/worms
%{_bindir}/wtf
%{_bindir}/wump
%{_datadir}/%{name}
%{_datadir}/misc/acronyms
%{_datadir}/misc/acronyms.comp
%{_mandir}/man6/*
%{_sbindir}/huntd
%config(noreplace) %attr(664,root,games) %{_var}/games/atc_score
%config(noreplace) %attr(664,root,games) %{_var}/games/battlestar.log
%config(noreplace) %attr(664,root,games) %{_var}/games/cfscores
%config(noreplace) %attr(664,root,games) %{_var}/games/criblog
%dir %attr(0775,root,gamehack) %{_var}/games/hack
%config(noreplace) %attr(664,root,gamehack) %{_var}/games/hack/*
%dir %attr(775,root,gamephant) %{_var}/games/phantasia
%config(noreplace) %attr(664,root,gamephant) %{_var}/games/phantasia/*
%dir %attr(775,root,gamesail) %{_var}/games/sail
%config(noreplace) %attr(644,root,games) %{_var}/games/robots_roll
%config(noreplace) %attr(664,root,gamesail) %{_var}/games/saillog
%config(noreplace) %attr(664,root,games) %{_var}/games/snake.log
%config(noreplace) %attr(664,root,games) %{_var}/games/snakerawscores
%config(noreplace) %attr(664,root,games) %{_var}/games/bsd-fbg.scores
%doc AUTHORS COPYING ChangeLog ChangeLog.0 THANKS YEAR2000 README.hunt trek/USD.doc/trek.me

%changelog
* Fri Aug 17 2007 Wart <wart@kobold.org> 2.17-21
- License tag clarification
- Minor rpmlint cleanup

* Mon Apr 30 2007 Wart <wart@kobold.org> 2.17-20
- Fix one more place where tetris must be renamed to bsd-fbg

* Mon Apr 30 2007 Wart <wart@kobold.org> 2.17-19
- Rename tetris to avoid legal quandries

* Tue Mar 6 2007 Wart <wart@kobold.org> 2.17-18
- Remove BR: libtermcap-devel
- Change includes of <termcap.h> to <ncurses/termcap.h>

* Tue Jan 30 2007 Wart <wart@kobold.org> 2.17-17
- Patch to add extern "C" block to prevent c++ compiler error.

* Sat Nov 18 2006 Wart <wart@kobold.org> 2.17-16
- Drop the useless game 'wargames'

* Sat Oct 14 2006 Wart <wart@kobold.org> 2.17-15
- Reintroduce the 'banner' program as 'vert-banner' (BZ #209018)

* Mon Aug 28 2006 Wart <wart@kobold.org> 2.17-14
- Rebuild for Fedora Extras

* Wed May 31 2006 Wart <wart@kobold.org> 2.17-13
- Added missing BR: bison

* Wed May 31 2006 Wart <wart@kobold.org> 2.17-12
- Added missing BR: flex

* Tue May 2 2006 Wart <wart@kobold.org> 2.17-11
- Rename monop man page to match the renamed executable.

* Mon May 1 2006 Wart <wart@kobold.org> 2.17-10
- Remove banner (conflict with a similar package in FE)

* Sat Apr 29 2006 Wart <wart@kobold.org> 2.17-9
- Simplify files section
- Remove unnecessary comment
- Mark scoreboard files as %%config

* Fri Apr 28 2006 Wart <wart@kobold.org> 2.17-8
- Fix directory ownership of _datadir/bsd-games
- Change license to BSD

* Thu Apr 27 2006 Wart <wart@kobold.org> 2.17-7
- Remove dm for Fedora
- Turn off setgid bit for cfscores
- Limit setgid code segments in hack
- Limit setgid code segments in phantasia

* Wed Apr 26 2006 Wart <wart@kobold.org> 2.17-6
- Remove bones file modifications from hack and run with a custom group
  instead.

* Sun Apr 24 2006 Wart <wart@kobold.org> 2.17-5
- Modified bones file handling to allow us to drop setgid earlier.

* Sat Apr 22 2006 Wart <wart@kobold.org> 2.17-4
- Added dist tag to release number
- Added patch to limit potential security holes in tetris-bsd
- Added patch set from Debian's package, which includes a security patch
  for CVE-2006-1744
- Rename monop to mpoly to avoid conflict with the mono-devel package.

* Fri Apr 14 2006 Wart <wart@kobold.org> 2.17-3
- Updated setresgid patch to disable potential security holes from
  user-specified scoreboard files.
- Move hack save games to $HOME, but can be moved using HACKDIR or the
  '-d' command line option.

* Sat Apr 8 2006 Wart <wart@kobold.org> 2.17-2
- Added patch to change use of setregid to setresgid almost everywhere.
- Added missing BuildRequires

* Mon Apr 3 2006 Wart <wart@kobold.org> 2.17-1
- Updated to 2.17 with new configuration system
- Updated patches for 2.17
- Updated spec file for Fedora Extras

* Fri Feb 16 2001 Tim Powers <timp@redhat.com>
- fixed getline() redefinition, it is included in stdio.h now, so 
  getline had to be renamed. Also, -D_GNU_SOURCE
- fix bug 27850, where certain games need to be setgid games, and 
  their scorefiles etc. need to belong to group games

* Tue Aug 1 2000 Tim Powers <timp@redhat.com>
- fix bug #15013, bad dir permissions

* Mon Jul 24 2000 Prospector <prospector@redhat.com>
- rebuilt

* Thu Jul 13 2000 Trond Eivind Glomsrød <teg@redhat.com>
- use %%{_tmppath}
- don't use internal rpm programs 
- kill countmail, no longer require frm from elm

* Mon Jun 5 2000 Tim Powers <timp@redhat.com>
- fixed man page location to be in %%{_mandir}
- fixed so that regular users can build

* Fri May 5 2000 Tim Powers <timp@redhat.com>
- rebuilt for 7.0
- compress man pages

* Thu Feb 10 2000 Tim Powers <timp@redhat.com>
- strip binaries.

* Sun Nov 21 1999 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.9

* Mon Nov 1 1999 Tim Powers <timp@redhat.com>
- updated source to 2.8
- fixed problem with ospeed being defined in the source instead of including
  termcap.h (new ospeed patch)
- using files list in %%files section instead of entering
  _every_single_filename_.

* Sat Aug 21 1999 Bill Nottingham <notting@redhat.com>
- fix countmail (#3722). I must be bored.

* Mon Aug 16 1999 Bill Nottingham <notting@redhat.com>
- make dm setgid games, not setuid root...

* Fri Jul 9 1999 Tim Powers <timp@redhat.com>
- updated source to 2.7
- updated patches to fix bugs and the braindead configure script, 
  dropped a few of the older patches that made it into this release
- replaced -make install with make install-strip
- built for 6.1

* Wed May 12 1999 Bill Nottingham <notting@redhat.com>
- pick up some more files

* Thu Apr 01 1999 Michael Maher <mike@redhat.com>
- only a fool would add a dependency to this package on a 
  day like today.

* Fri Mar 18 1999 Michael Maher <mike@redhat.com>
- fixed bug 1550

* Mon Feb 08 1999 Michael Maher <mike@redhat.com>
- moved pacakge to PowerTools.

* Thu Jun 18 1998 Alan Cox <alan@redhat.com>
- Chris Evans pointed out a hole in sail I missed.

* Wed Jun 17 1998 Alan Cox <alan@redhat.com>
- Stopped people using cribbage to be able to cheat game score files.

* Tue May 05 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Thu Apr 30 1998 Cristian Gafton <gafton@redhat.com>
- fixed the config patch so that it will build on non /usr/src/redhat build
  trees

* Tue Apr 07 1998 Erik Troan <ewt@redhat.com>
- updated to bsd-games 2.1
- started over on package