[RFC] quake2.spec

lobo w chello.pl lobo w chello.pl
Pią, 27 Paź 2006, 00:49:25 CEST


Witam!

W naszym repo w quake2.spec mamy modyfikację silnika która nazywa się
quake2forge. Moim zdaniem w specu quake2 powinno znajdować się orginalne
wydanie binarne, a wszystkie modyfikacje silnika powinny znajdować się w
osobnych specach nazywanych tak jak nazwa danego projektu. Umożliwiłoby
to w przyszłości instalację kilku wersji silnika gry równocześnie.
Proponowałbym zrobić kopię aktualnej rewizji speca do quake2forge.spec. Po
takiej operacji można będzie zmienić ścieżki _gamelibdir i _gamedatadir
(to drugie niekoniecznie), oraz binarkę na unikalne dla projektu
quake2forge. W proponuję quake2.spec wycofać wszystkie zmiany do wersji
1.12, która jest ostatnią wersją binarną (wg changeloga). Wersja binarna,
jest przydatna do odpalania serwerów z binarnymi modami (np. LithiumII,
Tourney, itp.).

Kolejna sprawa, którą chciałbym poruszyć, to dodanie do quake2forge
modułów dla dodatków xatrix i rogue. Zrobiłem zmiany do quake2.spec,
które dodają ww dodatki, jednak nie jestem pewien w jaki sposób je
dodać ze względu na kwestie licencyjne. Niestety kod źródłowy tych
dodatków nie ma zmienionej licencji na GPL. W tej chwili oba dodatki
są domyślnie wyłączone, można je zbudować po włączeniu odpowiednich
bcondów. W załączniku wstępny spec, który buduje się i działa.
Changelog:
- added xatrix and rogue compilation (default off),
- fix searchpaths when gamedir != baseq2 (Patch2),
- makefile.am fixes for xatrix & rogue (Patch3),
- gcc warning fixes (Patch4 & Patch5 - quake2forge builds with -Wall
  -Werror).

Patch #2 jest niezbędny do odpalenia jakiegokolwiek moda, nie zadziała
nawet ctf z pakietu(gra odpali się ale z %{_gamelibdir}/baseq2/game.so),
więc prosiłym o dodanie go bez względu na opinie o reszcie modyfikacji.
Patchy #4 i #5 nie wyślę na listę bo po kompresji zajmują ~70k (>700k
bez kompresji).

Uprzejmie proszę o komentarze do moich propozycji.

-- 
Pozdrawiam
Przemysław Białek

-------------- następna część ---------
Index: quake2.spec
===================================================================
RCS file: /cvsroot/SPECS/quake2.spec,v
retrieving revision 1.59
diff -u -r1.59 quake2.spec
--- quake2.spec	23 May 2006 19:20:57 -0000	1.59
+++ quake2.spec	26 Oct 2006 22:19:44 -0000
@@ -2,25 +2,42 @@
 # TODO:
 # - ipv6 support
 # - -static without -devel makes no sense (remove -static)
+%bcond_with	xatrix
+%bcond_with	rogue
+
 Summary:	Quake2 for linux
 Summary(pl):	Quake2 dla Linuksa
 Summary(pt_BR):	Quake2 para Linux
 Name:		quake2
 Version:	0.3
-Release:	3
+Release:	3.6
 Epoch:		1
 License:	GPL (for code only)
 Group:		X11/Applications/Games
 Source0:	ftp://ftp.quakeforge.net/quake2forge/%{name}-%{version}.tar.gz
 # Source0-md5:	2c167ff7edce20f0240316b98a1e4515
 #Source1:	multiplay pack (need to check licence)
-# ftp://ftp.idsoftware.com/idstuff/quake2/q2-3.20-x86-full.exe
-Source2:	%{name}-server.conf
-Source3:	%{name}-server
-Source4:	%{name}.png
-Source5:	%{name}.desktop
+# ftp://ftp.idsoftware.com/idstuff/quake2/unix/quake2-3.20-glibc-i386-unknown-linux2.0.tar.gz
+%if %{with xatrix}
+Source2:	ftp://ftp.idsoftware.com/idstuff/quake2/source/xatrixsrc320.shar.Z
+# Source2-md5:	41fc4ecc4f25c068e7d1f488bd4a1e1a
+%endif
+%if %{with rogue}
+Source3:	ftp://ftp.idsoftware.com/idstuff/quake2/source/roguesrc320.shar.Z
+# Source3-md5:	7d5e052839c9e629bad0a6570aa70554
+%endif
+Source4:	%{name}-server.conf
+Source5:	%{name}-server
+Source6:	%{name}.png
+Source7:	%{name}.desktop
+Source8:	%{name}-xatrix.desktop
+Source9:	%{name}-rogue.desktop
 Patch0:		%{name}-stupid_nvidia_bug.patch
 Patch1:		%{name}-gl.patch
+Patch2:		%{name}-game_paths.diff
+Patch3:		%{name}-missionpacks.patch
+Patch4:		%{name}-xatrix_gcc_fixes.diff
+Patch5:		%{name}-rogue_gcc_fixes.diff
 URL:		http://www.quakeforge.net/
 BuildRequires:	OpenGL-devel
 BuildRequires:	SDL-devel
@@ -37,8 +54,8 @@
 Requires:	%{name}-renderer
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_gamelibdir	%{_libdir}/games/%{name}
-%define		_gamedatadir	%{_datadir}/games/%{name}
+%define		_gamelibdir	%{_libdir}/%{name}
+%define		_gamedatadir	%{_datadir}/%{name}
 
 %description
 Quake2 for linux!
@@ -61,6 +78,22 @@
 %description static -l pl
 Quake2 - biblioteki statyczne
 
+%package xatrix
+Summary:	Quake2: The Reckoning
+Group:		Applications/Games
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+
+%description xatrix
+Quake2: The Reckoning.
+
+%package rogue
+Summary:	Quake2: Ground Zero
+Group:		Applications/Games
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+
+%description rogue
+Quake2: Ground Zero
+
 %package server
 Summary:	Quake2 server
 Summary(pl):	Serwer Quake2
@@ -217,8 +250,24 @@
 
 %prep
 %setup -q
+%if %{with xatrix}
+cd src/xatrix/
+gunzip -c %{SOURCE2} | %{__sed} s/"^more "/"cat >LICENSE.xatrix "/ >xatrix.shar
+echo yes| sh xatrix.shar
+cd ../../
+%patch4 -p1
+%endif
+%if %{with rogue}
+cd src/rogue/
+gunzip -c %{SOURCE3} | %{__sed} s/"^more "/"cat >LICENSE.rogue "/ >rogue.shar
+echo yes| sh rogue.shar
+cd ../../
+%patch5 -p1
+%endif
 %patch0
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %{__sed} -i -e 's/libltdl//' Makefile.am
 %{__sed} -i -e 's/AC_LIBLTDL_CONVENIENCE/AC_LIBLTDL_INSTALLABLE/' configure.in
@@ -232,10 +281,10 @@
 
 %configure \
 	--enable-ltdl-install=no \
-	--libdir=%{_libdir}/games \
-	--datadir=%{_datadir}/games \
-	--enable-sdlsound \
-	--with-opengl=/usr/X11R6
+	--libdir=%{_libdir} \
+	--datadir=%{_datadir} \
+	--enable-sdlsound
+#	--with-opengl=/usr/X11R6
 
 %{__make}
 
@@ -255,10 +304,16 @@
 #done
 #install baseq2/pak2.pak        $RPM_BUILD_ROOT%{_gamedir}/quake2/baseq2
 
-install %{SOURCE2} $RPM_BUILD_ROOT%{_gamedatadir}/baseq2/server.cfg
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d
-install %{SOURCE4} $RPM_BUILD_ROOT%{_pixmapsdir}
-install %{SOURCE5} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
+install %{SOURCE4} $RPM_BUILD_ROOT%{_gamedatadir}/baseq2/server.cfg
+install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d
+install %{SOURCE6} $RPM_BUILD_ROOT%{_pixmapsdir}
+install %{SOURCE7} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
+%if %{with xatrix}
+install %{SOURCE8} $RPM_BUILD_ROOT%{_desktopdir}/%{name}-xatrix.desktop
+%endif
+%if %{with rogue}
+install %{SOURCE9} $RPM_BUILD_ROOT%{_desktopdir}/%{name}-rogue.desktop
+%endif
 
 rm -rf _doc
 cp -a docs _doc
@@ -307,6 +362,24 @@
 %{_gamelibdir}/ref_softsdl.a
 %{_gamelibdir}/ref_softx.a
 %{_gamelibdir}/ref_tdfx.a
+
+%if %{with xatrix}
+%files xatrix
+%defattr(644,root,root,755)
+%dir %{_gamelibdir}/xatrix
+%attr(755,root,root) %{_gamelibdir}/xatrix/game.so
+%{_gamelibdir}/xatrix/game.la
+%{_desktopdir}/quake2-xatrix.desktop
+%endif
+
+%if %{with rogue}
+%files rogue
+%defattr(644,root,root,755)
+%dir %{_gamelibdir}/rogue
+%attr(755,root,root) %{_gamelibdir}/rogue/game.so
+%{_gamelibdir}/rogue/game.la
+%{_desktopdir}/quake2-rogue.desktop
+%endif
 
 %files server
 %defattr(644,root,root,755)
-------------- następna część ---------
diff -ru quake2-0.3.orig/src/files.c quake2-0.3/src/files.c
--- quake2-0.3.orig/src/files.c	2006-10-26 18:42:32.000000000 +0200
+++ quake2-0.3/src/files.c	2006-10-26 23:40:06.000000000 +0200
@@ -724,7 +724,8 @@
 		Cvar_FullSet ("gamedir", dir, CVAR_SERVERINFO|CVAR_NOSET);
 		if (fs_cddir->string[0])
 			FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) );
-		FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
+		FS_AddGameDirectory (va("%s/%s", PKGLIBDIR, dir) );
+		FS_AddGameDirectory (va("%s/%s", PKGDATADIR, dir) );
 		FS_AddHomeAsGameDirectory (dir);
 	}
 }
-------------- następna część ---------
diff -ru quake2-0.3.orig/src/rogue/Makefile.am quake2-0.3/src/rogue/Makefile.am
--- quake2-0.3.orig/src/rogue/Makefile.am	2004-02-26 21:53:00.000000000 +0100
+++ quake2-0.3/src/rogue/Makefile.am	2006-10-26 18:24:11.000000000 +0200
@@ -1,32 +1,33 @@
 pkglibdir=$(libdir)/@PACKAGE@/rogue
 
 if DO_ROGUE
-#pkglib_LTLIBRARIES = game.la
-#game_la_SOURCES = dm_ball.c dm_tag.c \
-#		g_ai.c g_chase.c g_cmds.c g_combat.c g_func.c \
-#		g_items.c g_main.c g_misc.c g_monster.c g_newai.c \
-#		g_newdm.c g_newfnc.c g_newtarg.c g_newtrig.c \
-#		g_newweap.c g_phys.c g_save.c g_spawn.c g_sphere.c \
-#		g_svcmds.c g_target.c g_trigger.c g_turret.c \
-#		g_utils.c g_weapon.c \
-#		m_actor.c m_berserk.c m_boss2.c m_boss3.c \
-#		m_boss31.c m_boss32.c m_brain.c m_carrier.c \
-#		m_chick.c m_flash.c m_flipper.c m_float.c m_flyer.c \
-#		m_gladiator.c m_gunner.c m_hover.c m_infantry.c \
-#		m_insane.c m_medic.c m_move.c m_mutant.c \
-#		m_parasite.c m_soldier.c m_stalker.c m_supertank.c \
-#		m_tank.c m_turret.c m_widow.c m_widow2.c \
-#		p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
-#		q_shared.c
-#
-#noinst_HEADERS = g_local.h m_actor.h m_berserk.h m_boss2.h m_boss31.h \
-#	m_boss32.h m_brain.h m_carrier.h m_chick.h m_flipper.h \
-#	m_float.h m_flyer.h m_gladiator.h m_gunner.h m_hover.h \
-#	m_infantry.h m_insane.h m_medic.h m_mutant.h m_parasite.h \
-#	m_player.h m_rider.h m_soldier.h m_stalker.h m_supertank.h \
-#	m_tank.h m_turret.h m_widow.h m_widow2.h q_shared.h
-#
-##game_la_CFLAGS = -fPIC -Wall -Werror -pipe @OPT_CFLAGS@
-#game_la_CFLAGS = -I$(top_srcdir)/src -fPIC -pipe @OPT_CFLAGS@
-#game_la_LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
+pkglib_LTLIBRARIES = game.la
+game_la_SOURCES = dm_ball.c dm_tag.c \
+		g_ai.c g_chase.c g_cmds.c g_combat.c g_func.c \
+		g_items.c g_main.c g_misc.c g_monster.c g_newai.c \
+		g_newdm.c g_newfnc.c g_newtarg.c g_newtrig.c \
+		g_newweap.c g_phys.c g_save.c g_spawn.c g_sphere.c \
+		g_svcmds.c g_target.c g_trigger.c g_turret.c \
+		g_utils.c g_weapon.c \
+		m_actor.c m_berserk.c m_boss2.c m_boss3.c \
+		m_boss31.c m_boss32.c m_brain.c m_carrier.c \
+		m_chick.c m_flash.c m_flipper.c m_float.c m_flyer.c \
+		m_gladiator.c m_gunner.c m_hover.c m_infantry.c \
+		m_insane.c m_medic.c m_move.c m_mutant.c \
+		m_parasite.c m_soldier.c m_stalker.c m_supertank.c \
+		m_tank.c m_turret.c m_widow.c m_widow2.c \
+		p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
+		q_shared.c
+
+noinst_HEADERS = g_local.h m_actor.h m_berserk.h m_boss2.h m_boss31.h \
+	m_boss32.h m_brain.h m_carrier.h m_chick.h m_flipper.h \
+	m_float.h m_flyer.h m_gladiator.h m_gunner.h m_hover.h \
+	m_infantry.h m_insane.h m_medic.h m_mutant.h m_parasite.h \
+	m_player.h m_rider.h m_soldier.h m_stalker.h m_supertank.h \
+	m_tank.h m_turret.h m_widow.h m_widow2.h q_shared.h
+
 endif # DO_ROGUE
+
+AM_CFLAGS = -fPIC -pipe @WARN_CFLAGS@ @OPT_CFLAGS@
+AM_CPPFLAGS = -I$(top_srcdir)/src
+LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
diff -ru quake2-0.3.orig/src/xatrix/Makefile.am quake2-0.3/src/xatrix/Makefile.am
--- quake2-0.3.orig/src/xatrix/Makefile.am	2004-02-26 21:53:01.000000000 +0100
+++ quake2-0.3/src/xatrix/Makefile.am	2006-10-26 18:24:31.000000000 +0200
@@ -1,29 +1,30 @@
 pkglibdir=$(libdir)/@PACKAGE@/xatrix
 
 if DO_XATRIX
-#pkglib_LTLIBRARIES = game.la
-#game_la_SOURCES = g_ai.c g_chase.c g_cmds.c g_combat.c g_func.c \
-#		g_items.c g_main.c g_misc.c g_monster.c g_phys.c \
-#		g_save.c g_spawn.c g_svcmds.c g_target.c g_trigger.c \
-#		g_turret.c g_utils.c g_weapon.c \
-#		m_actor.c m_berserk.c m_boss2.c m_boss3.c \
-#		m_boss31.c m_boss32.c m_boss5.c m_brain.c \
-#		m_chick.c m_fixbot.c m_flash.c m_flipper.c \
-#		m_float.c m_flyer.c m_gekk.c m_gladb.c \
-#		m_gladiator.c m_gunner.c m_hover.c m_infantry.c \
-#		m_insane.c m_medic.c m_move.c m_mutant.c \
-#		m_parasite.c m_soldier.c m_supertank.c m_tank.c \
-#		p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
-#		q_shared.c
+pkglib_LTLIBRARIES = game.la
+game_la_SOURCES = g_ai.c g_chase.c g_cmds.c g_combat.c g_func.c \
+		g_items.c g_main.c g_misc.c g_monster.c g_phys.c \
+		g_save.c g_spawn.c g_svcmds.c g_target.c g_trigger.c \
+		g_turret.c g_utils.c g_weapon.c \
+		m_actor.c m_berserk.c m_boss2.c m_boss3.c \
+		m_boss31.c m_boss32.c m_boss5.c m_brain.c \
+		m_chick.c m_fixbot.c m_flash.c m_flipper.c \
+		m_float.c m_flyer.c m_gekk.c m_gladb.c \
+		m_gladiator.c m_gunner.c m_hover.c m_infantry.c \
+		m_insane.c m_medic.c m_move.c m_mutant.c \
+		m_parasite.c m_soldier.c m_supertank.c m_tank.c \
+		p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
+		q_shared.c
 
-#noinst_HEADERS = g_local.h m_actor.h m_berserk.h m_boss2.h m_boss31.h \
-#	m_boss32.h m_brain.h m_chick.h m_fixbot.h m_flipper.h \
-#	m_float.h m_flyer.h m_gekk.h m_gladiator.h m_gunner.h \
-#	m_hover.h m_infantry.h m_insane.h m_medic.h m_mutant.h \
-#	m_parasite.h m_player.h m_rider.h m_soldier.h m_soldierh.h \
-#	m_supertank.h m_tank.h q_shared.h
+noinst_HEADERS = g_local.h m_actor.h m_berserk.h m_boss2.h m_boss31.h \
+	m_boss32.h m_brain.h m_chick.h m_fixbot.h m_flipper.h \
+	m_float.h m_flyer.h m_gekk.h m_gladiator.h m_gunner.h \
+	m_hover.h m_infantry.h m_insane.h m_medic.h m_mutant.h \
+	m_parasite.h m_player.h m_rider.h m_soldier.h m_soldierh.h \
+	m_supertank.h m_tank.h q_shared.h
 
-##game_la_CFLAGS = -fPIC -Wall -Werror -pipe @OPT_CFLAGS@
-#game_la_CFLAGS = -I$(top_srcdir)/src -fPIC -pipe @OPT_CFLAGS@
-#game_la_LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
 endif # DO_XATRIX
+
+AM_CFLAGS = -fPIC -pipe -Dstricmp=strcasecmp @WARN_CFLAGS@ @OPT_CFLAGS@
+AM_CPPFLAGS = -I$(top_srcdir)/src
+LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
-------------- następna część ---------
[Desktop Entry]
Name=Quake II: The Reckoning
Comment=Quake2 Mission Pack "The Reckoning" (xatrix)
Exec=quake2 +set game xatrix
Icon=quake2.png 
Terminal=false
Type=Application
Categories=Game;X-FPPGame;
Encoding=UTF-8
# vi: encoding=utf-8
-------------- następna część ---------
[Desktop Entry]
Name=Quake II: Ground Zero
Comment=Quake2 Mission Pack "Ground Zero" (Rogue)
Exec=quake2 +set game rogue
Icon=quake2.png 
Terminal=false
Type=Application
Categories=Game;X-FPPGame;
Encoding=UTF-8
# vi: encoding=utf-8


Więcej informacji o liście dyskusyjnej pld-devel-pl