]> git.pld-linux.org Git - SPECS.git/blob - quake2.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / quake2.spec
1 # TODO
2 # - unpackaged: /usr/lib/quake2/ref_gl.so
3 # - quake2: symbol lookup error: /usr/lib/quake2/ref_softx.so: undefined symbol: sqrt
4 #
5 # Conditional build:
6 %bcond_with     rogue   # with Rogue ("Ground Zero") Mission Pack  (non-distributable package)
7 %bcond_with     xatrix  # with Xatrix ("The Reckoning") Mission Pack  (non-distributable package)
8 #
9 Summary:        Quake2 for Linux
10 Summary(pl.UTF-8):      Quake2 dla Linuksa
11 Summary(pt_BR.UTF-8):   Quake2 para Linux
12 Name:           quake2
13 Version:        3.21
14 Release:        5
15 Epoch:          1
16 License:        GPL (for main code only)
17 Group:          Applications/Games
18 Source0:        ftp://ftp.idsoftware.com/idstuff/source/q2source-%{version}.zip
19 # Source0-md5:  3ac9ac6a833b9c049a9f763c3137b86f
20 #Source1:       multiplay pack (need to check licence)
21 # ftp://ftp.idsoftware.com/idstuff/quake2/q2-3.20-x86-full.exe
22 Source2:        %{name}-server.conf
23 Source3:        %{name}-server
24 Source4:        %{name}.png
25 Source5:        %{name}-server.sysconfig
26 Source6:        %{name}-server.screenrc
27 Source10:       ftp://ftp.idsoftware.com/idstuff/quake2/source/roguesrc320.shar.Z
28 # Source10-md5: 7d5e052839c9e629bad0a6570aa70554
29 Source11:       ftp://ftp.idsoftware.com/idstuff/quake2/source/xatrixsrc320.shar.Z
30 # Source11-md5: 41fc4ecc4f25c068e7d1f488bd4a1e1a
31 Patch0:         %{name}-fix.patch
32 Patch1:         %{name}-gamedir.patch
33 Patch2:         %{name}-rogue.patch
34 Patch3:         %{name}-xatrix.patch
35 URL:            http://www.idsoftware.com/games/quake/quake2/
36 BuildRequires:  OpenGL-GLX-devel
37 BuildRequires:  rpmbuild(macros) >= 1.268
38 BuildRequires:  svgalib-devel
39 BuildRequires:  unzip
40 BuildRequires:  xorg-lib-libXext-devel
41 BuildRequires:  xorg-lib-libXxf86dga-devel
42 BuildRequires:  xorg-lib-libXxf86vm-devel
43 Requires:       %{name}-common = %{epoch}:%{version}-%{release}
44 Requires:       %{name}-renderer = %{epoch}:%{version}-%{release}
45 Obsoletes:      quake2-3DFX
46 Obsoletes:      quake2-3dfx
47 Obsoletes:      quake2-Mesa3D
48 Obsoletes:      quake2-sdl
49 Obsoletes:      quake2-sgl
50 Obsoletes:      quake2-snd-alsa
51 Obsoletes:      quake2-snd-ao
52 Obsoletes:      quake2-snd-oss
53 Obsoletes:      quake2-snd-sdl
54 Obsoletes:      quake2-static
55 # other archs need at least more #ifdefs
56 ExclusiveArch:  %{ix86} alpha
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %define         _gamelibdir     %{_libdir}/%{name}
60 %define         _gamedatadir    %{_datadir}/%{name}
61 %define         _gamehomedir    /var/games/%{name}
62 %ifarch %{ix86}
63 %define         qarch   i386
64 %else
65 %ifarch alpha
66 %define         qarch   axp
67 %else
68 %define         qarch   %{nil}
69 %endif
70 %endif
71
72 %description
73 Quake2 for Linux!
74
75 %description -l pl.UTF-8
76 Quake2 dla Linuksa!
77
78 %description -l pt_BR.UTF-8
79 Quake2 para Linux!
80
81 %package common
82 Summary:        Quake2 common files
83 Group:          Applications/Games
84
85 %description common
86 Quake2 common files.
87
88 %package server
89 Summary:        Quake2 server
90 Summary(pl.UTF-8):      Serwer Quake2
91 Summary(pt_BR.UTF-8):   Servidor Quake2
92 Group:          Applications/Games
93 Requires(post,preun):   /sbin/chkconfig
94 Requires(postun):       /usr/sbin/groupdel
95 Requires(postun):       /usr/sbin/userdel
96 Requires(pre):  /bin/id
97 Requires(pre):  /usr/bin/getgid
98 Requires(pre):  /usr/sbin/groupadd
99 Requires(pre):  /usr/sbin/useradd
100 Requires:       %{name}-common = %{epoch}:%{version}-%{release}
101 Requires:       rc-scripts
102 Requires:       screen
103 Provides:       group(quake2)
104 Provides:       user(quake2)
105
106 %description server
107 Quake2 server.
108
109 %description server -l pl.UTF-8
110 Serwer Quake2 dla Linuksa.
111
112 %description server -l pt_BR.UTF-8
113 Servidor Quake2.
114
115 %package glx
116 Summary:        OpenGL Quake2
117 Summary(pl.UTF-8):      Quake2 OpenGL
118 Group:          X11/Applications/Games
119 Requires:       %{name} = %{epoch}:%{version}-%{release}
120 Provides:       %{name}-renderer = %{epoch}:%{version}-%{release}
121 Obsoletes:      quake2-GLX
122
123 %description glx
124 Play Quake2 using hardware OpenGL acceleration.
125
126 %description glx -l pl.UTF-8
127 Zagraj w Quake2 ze sprzętową akceleracją OpenGL.
128
129 %package svga
130 Summary:        Quake2 for SVGAlib
131 Summary(pl.UTF-8):      Biblioteki Quake2 dla SVGAlib
132 Group:          Applications/Games
133 Requires:       %{name} = %{epoch}:%{version}-%{release}
134 Provides:       %{name}-renderer = %{epoch}:%{version}-%{release}
135 Obsoletes:      quake2-svgalib
136
137 %description svga
138 Quake2 libraries for SVGAlib play.
139
140 %description svga -l pl.UTF-8
141 Biblioteki Quake2 do grania na SVGAlib.
142
143 %package x11
144 Summary:        Quake2 X11 software renderer libs
145 Summary(pl.UTF-8):      Biblioteka Quake2 - programowe renderowanie
146 Group:          X11/Applications/Games
147 Requires:       %{name} = %{epoch}:%{version}-%{release}
148 Provides:       %{name}-renderer = %{epoch}:%{version}-%{release}
149 Obsoletes:      quake2-X11
150 Obsoletes:      quake2-software-X11
151
152 %description x11
153 Play Quake2 using software X11 renderer.
154
155 %description x11 -l pl.UTF-8
156 Zagraj w Quake2 przy użyciu programowego renderowania w X11.
157
158 %package rogue
159 Summary:        Quake II: Ground Zero (mission pack)
160 Summary(pl.UTF-8):      Quake II: Ground Zero (zestaw misji)
161 License:        GPL+Limited Program Source Code License (non-distributable in binary form)
162 Group:          Applications/Games
163 Requires:       %{name} = %{epoch}:%{version}-%{release}
164
165 %description rogue
166 Quake II: Ground Zero (mission pack).
167
168 %description rogue -l pl.UTF-8
169 Quake II: Ground Zero (zestaw misji).
170
171 %package xatrix
172 Summary:        Quake II: The Reckoning (mission pack)
173 Summary(pl.UTF-8):      Quake II: The Reckoning (zestaw misji)
174 License:        GPL+Limited Program Source Code License (non-distributable in binary form)
175 Group:          Applications/Games
176 Requires:       %{name} = %{epoch}:%{version}-%{release}
177
178 %description xatrix
179 Quake II: The Reckoning (mission pack).
180
181 %description xatrix -l pl.UTF-8
182 Quake II: The Reckoning (zestaw misji).
183
184 %prep
185 %setup -q -c
186 mv -f %{name}-%{version}/* .
187 %patch0 -p1
188 %patch1 -p1
189
190 %if %{with rogue}
191 install -d rogue
192 cd rogue
193 gzip -dc %{SOURCE10} | %{__sed} s/"^more "/"cat >LICENSE.rogue "/ >rogue.shar
194 echo yes| sh rogue.shar
195 cd ..
196 %patch2 -p1
197 %endif
198
199 %if %{with xatrix}
200 install -d xatrix
201 cd xatrix
202 gunzip -c %{SOURCE11} | %{__sed} s/"^more "/"cat >LICENSE.xatrix "/ >xatrix.shar
203 echo yes| sh xatrix.shar
204 cd ..
205 %patch3 -p1
206 %endif
207
208 %build
209 cat linux/Makefile | tr -d '\015' > Makefile.tmp
210 mv -f Makefile.tmp linux/Makefile
211
212 %{__make} build_release -C linux \
213         CC="%{__cc}" \
214         RELEASE_CFLAGS="-Dstricmp=strcasecmp %{rpmcflags} -ffast-math %{!?debug:-fomit-frame-pointer} -DPKGLIBDIR=\\\\\\\"%{_gamelibdir}\\\\\\\" -DPKGDATADIR=\\\\\\\"%{_gamedatadir}\\\\\\\"" \
215         MESA_DIR=/usr
216
217 %install
218 rm -rf $RPM_BUILD_ROOT
219 install -d $RPM_BUILD_ROOT{%{_gamedatadir}/baseq2,%{_gamelibdir}/{baseq2,ctf}} \
220         $RPM_BUILD_ROOT%{_gamehomedir}/.quake2/baseq2 \
221         $RPM_BUILD_ROOT{/etc/sysconfig,/etc/rc.d/init.d} \
222         $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}}
223
224 cd linux/release%{qarch}-glibc
225
226 install game%{qarch}.so $RPM_BUILD_ROOT%{_gamelibdir}/baseq2
227 install ctf/game%{qarch}.so $RPM_BUILD_ROOT%{_gamelibdir}/ctf
228 %if %{with rogue}
229 install -D rogue/game%{qarch}.so $RPM_BUILD_ROOT%{_gamelibdir}/rogue/game%{qarch}.so
230 %endif
231 %if %{with xatrix}
232 install -D xatrix/game%{qarch}.so $RPM_BUILD_ROOT%{_gamelibdir}/xatrix/game%{qarch}.so
233 %endif
234
235 %ifarch alpha
236 install q2ded $RPM_BUILD_ROOT%{_bindir}/quake2id
237 %else
238 install quake2 $RPM_BUILD_ROOT%{_bindir}/quake2id
239 install ref_*.so $RPM_BUILD_ROOT%{_gamelibdir}
240
241 cat > $RPM_BUILD_ROOT%{_bindir}/quake2-glx <<EOF
242 #!/bin/sh
243 exec %{_bindir}/quake2id +set vid_ref glx +set gl_driver libGL.so.1 > /dev/null
244 EOF
245
246 cat > $RPM_BUILD_ROOT%{_bindir}/quake2-x11 <<EOF
247 #!/bin/sh
248 exec %{_bindir}/quake2id +set vid_ref softx > /dev/null
249 EOF
250
251 cat > $RPM_BUILD_ROOT%{_bindir}/quake2-svga <<EOF
252 #!/bin/sh
253 exec %{_bindir}/quake2id +set vid_ref soft > /dev/null
254 EOF
255
256 cat > $RPM_BUILD_ROOT%{_desktopdir}/quake2-glx.desktop <<EOF
257 [Desktop Entry]
258 Name=Quake II (GLX)
259 Comment=Quake2 for Linux
260 Comment[pl]=Quake2 dla Linuksa
261 Exec=quake2-glx
262 Icon=quake2.png
263 Terminal=false
264 Type=Application
265 Categories=Game;X-FPPGame;
266 Encoding=UTF-8
267 EOF
268
269 cat > $RPM_BUILD_ROOT%{_desktopdir}/quake2-x11.desktop <<EOF
270 [Desktop Entry]
271 Name=Quake II (X11)
272 Comment=Quake2 for Linux
273 Comment[pl]=Quake2 dla Linuksa
274 Exec=quake2-x11
275 Icon=quake2.png
276 Terminal=false
277 Type=Application
278 Categories=Game;X-FPPGame;
279 Encoding=UTF-8
280 EOF
281 %endif
282
283 echo "%{_gamelibdir}" > $RPM_BUILD_ROOT%{_sysconfdir}/quake2.conf
284
285 install %{SOURCE2} $RPM_BUILD_ROOT%{_gamehomedir}/.quake2/baseq2/server.cfg
286 install %{SOURCE6} $RPM_BUILD_ROOT%{_gamehomedir}/.screenrc
287 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/q2ded
288 install %{SOURCE4} $RPM_BUILD_ROOT%{_pixmapsdir}
289 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/q2ded
290
291 %clean
292 rm -rf $RPM_BUILD_ROOT
293
294 %pre server
295 %groupadd -P %{name}-server -g 170 quake2
296 %useradd -P %{name}-server -u 170 -d %{_gamehomedir} -s /bin/sh -c "Quake 2" -g quake2 quake2
297
298 %post server
299 /sbin/chkconfig --add q2ded
300 %service q2ded restart "Quake2 server"
301
302 %preun server
303 if [ "$1" = "0" ]; then
304         %service q2ded stop
305         /sbin/chkconfig --del q2ded
306 fi
307
308 %postun server
309 if [ "$1" = "0" ]; then
310         %userremove quake2
311         %groupremove quake2
312 fi
313
314 %triggerpostun server -- quake2-server < 1:0.3-3.11
315 if [ -f %{_gamedatadir}/baseq2/server.cfg.rpmsave ]; then
316         mv -f %{_gamehomedir}/.quake2/baseq2/server.cfg{,.rpmnew}
317         mv -f %{_gamedatadir}/baseq2/server.cfg.rpmsave %{_gamehomedir}/.quake2/baseq2/server.cfg
318 fi
319
320 if [ -f /var/lock/subsys/quake2-server ]; then
321         mv -f /var/lock/subsys/{quake2-server,q2ded}
322         %service -q q2ded restart
323 fi
324
325 %files
326 %defattr(644,root,root,755)
327 %doc *_Changes.txt changes.txt joystick.txt readme.txt linux/README*
328 %{_pixmapsdir}/quake2.png
329
330 %files common
331 %defattr(644,root,root,755)
332 %attr(755,root,root) %{_bindir}/quake2id
333 %{_sysconfdir}/quake2.conf
334 %dir %{_gamelibdir}
335 %dir %{_gamelibdir}/baseq2
336 %attr(755,root,root) %{_gamelibdir}/baseq2/game%{qarch}.so
337 %dir %{_gamelibdir}/ctf
338 %attr(755,root,root) %{_gamelibdir}/ctf/game%{qarch}.so
339 %dir %{_gamedatadir}
340 %dir %{_gamedatadir}/baseq2
341
342 %files server
343 %defattr(644,root,root,755)
344 %attr(754,root,root) /etc/rc.d/init.d/q2ded
345 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/q2ded
346 %dir %attr(770,root,quake2) %{_gamehomedir}
347 %config(noreplace) %attr(660,root,quake2) %verify(not md5 mtime size) %{_gamehomedir}/.screenrc
348 %dir %attr(770,root,quake2) %{_gamehomedir}/.quake2
349 %dir %attr(770,root,quake2) %{_gamehomedir}/.quake2/baseq2
350 %config(noreplace) %attr(660,root,quake2) %verify(not md5 mtime size) %{_gamehomedir}/.quake2/baseq2/server.cfg
351
352 %ifnarch alpha
353 %files glx
354 %defattr(644,root,root,755)
355 %attr(755,root,root) %{_bindir}/quake2-glx
356 %attr(755,root,root) %{_gamelibdir}/ref_glx.so
357 %{_desktopdir}/quake2-glx.desktop
358
359 %files svga
360 %defattr(644,root,root,755)
361 %attr(755,root,root) %{_bindir}/quake2-svga
362 %attr(755,root,root) %{_gamelibdir}/ref_soft.so
363
364 %files x11
365 %defattr(644,root,root,755)
366 %attr(755,root,root) %{_bindir}/quake2-x11
367 %attr(755,root,root) %{_gamelibdir}/ref_softx.so
368 %{_desktopdir}/quake2-x11.desktop
369 %endif
370
371 %if %{with rogue}
372 %files rogue
373 %defattr(644,root,root,755)
374 %dir %{_gamelibdir}/rogue
375 %attr(755,root,root) %{_gamelibdir}/rogue/game%{qarch}.so
376 %endif
377
378 %if %{with xatrix}
379 %files xatrix
380 %defattr(644,root,root,755)
381 %dir %{_gamelibdir}/xatrix
382 %attr(755,root,root) %{_gamelibdir}/xatrix/game%{qarch}.so
383 %endif
This page took 2.750169 seconds and 3 git commands to generate.