2 # - unpackaged: /usr/lib/quake2/ref_gl.so
3 # - quake2: symbol lookup error: /usr/lib/quake2/ref_softx.so: undefined symbol: sqrt
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)
9 Summary: Quake2 for Linux
10 Summary(pl.UTF-8): Quake2 dla Linuksa
11 Summary(pt_BR.UTF-8): Quake2 para Linux
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
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
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
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)
59 %define _gamelibdir %{_libdir}/%{name}
60 %define _gamedatadir %{_datadir}/%{name}
61 %define _gamehomedir /var/games/%{name}
75 %description -l pl.UTF-8
78 %description -l pt_BR.UTF-8
82 Summary: Quake2 common files
83 Group: Applications/Games
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}
103 Provides: group(quake2)
104 Provides: user(quake2)
109 %description server -l pl.UTF-8
110 Serwer Quake2 dla Linuksa.
112 %description server -l pt_BR.UTF-8
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
124 Play Quake2 using hardware OpenGL acceleration.
126 %description glx -l pl.UTF-8
127 Zagraj w Quake2 ze sprzętową akceleracją OpenGL.
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
138 Quake2 libraries for SVGAlib play.
140 %description svga -l pl.UTF-8
141 Biblioteki Quake2 do grania na SVGAlib.
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
153 Play Quake2 using software X11 renderer.
155 %description x11 -l pl.UTF-8
156 Zagraj w Quake2 przy użyciu programowego renderowania w X11.
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}
166 Quake II: Ground Zero (mission pack).
168 %description rogue -l pl.UTF-8
169 Quake II: Ground Zero (zestaw misji).
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}
179 Quake II: The Reckoning (mission pack).
181 %description xatrix -l pl.UTF-8
182 Quake II: The Reckoning (zestaw misji).
186 mv -f %{name}-%{version}/* .
193 gzip -dc %{SOURCE10} | %{__sed} s/"^more "/"cat >LICENSE.rogue "/ >rogue.shar
194 echo yes| sh rogue.shar
202 gunzip -c %{SOURCE11} | %{__sed} s/"^more "/"cat >LICENSE.xatrix "/ >xatrix.shar
203 echo yes| sh xatrix.shar
209 cat linux/Makefile | tr -d '\015' > Makefile.tmp
210 mv -f Makefile.tmp linux/Makefile
212 %{__make} build_release -C linux \
214 RELEASE_CFLAGS="-Dstricmp=strcasecmp %{rpmcflags} -ffast-math %{!?debug:-fomit-frame-pointer} -DPKGLIBDIR=\\\\\\\"%{_gamelibdir}\\\\\\\" -DPKGDATADIR=\\\\\\\"%{_gamedatadir}\\\\\\\"" \
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}}
224 cd linux/release%{qarch}-glibc
226 install game%{qarch}.so $RPM_BUILD_ROOT%{_gamelibdir}/baseq2
227 install ctf/game%{qarch}.so $RPM_BUILD_ROOT%{_gamelibdir}/ctf
229 install -D rogue/game%{qarch}.so $RPM_BUILD_ROOT%{_gamelibdir}/rogue/game%{qarch}.so
232 install -D xatrix/game%{qarch}.so $RPM_BUILD_ROOT%{_gamelibdir}/xatrix/game%{qarch}.so
236 install q2ded $RPM_BUILD_ROOT%{_bindir}/quake2id
238 install quake2 $RPM_BUILD_ROOT%{_bindir}/quake2id
239 install ref_*.so $RPM_BUILD_ROOT%{_gamelibdir}
241 cat > $RPM_BUILD_ROOT%{_bindir}/quake2-glx <<EOF
243 exec %{_bindir}/quake2id +set vid_ref glx +set gl_driver libGL.so.1 > /dev/null
246 cat > $RPM_BUILD_ROOT%{_bindir}/quake2-x11 <<EOF
248 exec %{_bindir}/quake2id +set vid_ref softx > /dev/null
251 cat > $RPM_BUILD_ROOT%{_bindir}/quake2-svga <<EOF
253 exec %{_bindir}/quake2id +set vid_ref soft > /dev/null
256 cat > $RPM_BUILD_ROOT%{_desktopdir}/quake2-glx.desktop <<EOF
259 Comment=Quake2 for Linux
260 Comment[pl]=Quake2 dla Linuksa
265 Categories=Game;X-FPPGame;
269 cat > $RPM_BUILD_ROOT%{_desktopdir}/quake2-x11.desktop <<EOF
272 Comment=Quake2 for Linux
273 Comment[pl]=Quake2 dla Linuksa
278 Categories=Game;X-FPPGame;
283 echo "%{_gamelibdir}" > $RPM_BUILD_ROOT%{_sysconfdir}/quake2.conf
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
292 rm -rf $RPM_BUILD_ROOT
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
299 /sbin/chkconfig --add q2ded
300 %service q2ded restart "Quake2 server"
303 if [ "$1" = "0" ]; then
305 /sbin/chkconfig --del q2ded
309 if [ "$1" = "0" ]; then
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
320 if [ -f /var/lock/subsys/quake2-server ]; then
321 mv -f /var/lock/subsys/{quake2-server,q2ded}
322 %service -q q2ded restart
326 %defattr(644,root,root,755)
327 %doc *_Changes.txt changes.txt joystick.txt readme.txt linux/README*
328 %{_pixmapsdir}/quake2.png
331 %defattr(644,root,root,755)
332 %attr(755,root,root) %{_bindir}/quake2id
333 %{_sysconfdir}/quake2.conf
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
340 %dir %{_gamedatadir}/baseq2
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
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
360 %defattr(644,root,root,755)
361 %attr(755,root,root) %{_bindir}/quake2-svga
362 %attr(755,root,root) %{_gamelibdir}/ref_soft.so
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
373 %defattr(644,root,root,755)
374 %dir %{_gamelibdir}/rogue
375 %attr(755,root,root) %{_gamelibdir}/rogue/game%{qarch}.so
380 %defattr(644,root,root,755)
381 %dir %{_gamelibdir}/xatrix
382 %attr(755,root,root) %{_gamelibdir}/xatrix/game%{qarch}.so