[rott] 01/01: Make the "commercial" variant recognize all supported multiplayer map files

Fabian Greffrath fabian-guest at moszumanska.debian.org
Thu Jan 15 13:34:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

fabian-guest pushed a commit to branch master
in repository rott.

commit c850d38baa893bd916419d0f288fdc084577155a
Author: Fabian Greffrath <fabian+debian at greffrath.com>
Date:   Thu Jan 15 14:33:42 2015 +0100

    Make the "commercial" variant recognize all supported multiplayer map files
    
    and set 'gamestate.Product' accordingly.
    This saves us from building the SUPERROTT and SITELICENSE variants
    which had their multiplayer map file names hard-coded.
    
    Adjust documentation and packaging accordingly.
---
 debian/README.Debian                       |   4 +-
 debian/changelog                           |  10 ++
 debian/patches/10-all-variants.patch       |  28 ++--
 debian/patches/rott-merge-commercial.patch | 215 +++++++++++++++++++++++++++++
 debian/patches/series                      |   1 +
 debian/rott.links                          |   2 -
 debian/rott.postinst                       |  21 +--
 debian/rott.preinst                        |  13 ++
 debian/rott.prerm                          |  42 +-----
 debian/rules                               |  10 +-
 10 files changed, 263 insertions(+), 83 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index af1a0da..312394a 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -3,8 +3,8 @@ Rise of the Triad for Debian
 
  * The rott package in Debian supports all four variants of the game:
    Shareware Version, Commercial Version, CD Version and Site License CD
-   Version. The corresponding binaries are named 'rott-shareware',
-   'rott-commercial', 'rott-superrott' and 'rott-sitelicense', respectively.
+   Version. The corresponding binaries are named 'rott-shareware' and
+   'rott-commercial' for the latter three variants, respectively.
    In order to select which variant is started by the 'rott' command and the
    desktop and menu files, Debian's 'update-alternatives' mechanism is used:
    .
diff --git a/debian/changelog b/debian/changelog
index 656e7ed..bf69a7b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+rott (1.1.2-3) UNRELEASED; urgency=medium
+
+  * Make the "commercial" variant recognize all supported
+    multiplayer map files and set 'gamestate.Product' accordingly.
+    This saves us from building the SUPERROTT and SITELICENSE variants
+    which had their multiplayer map file names hard-coded.
+    Adjust documentation and packaging accordingly.
+
+ -- Fabian Greffrath <fabian+debian at greffrath.com>  Thu, 15 Jan 2015 14:17:28 +0100
+
 rott (1.1.2-2) unstable; urgency=low
 
   * Team upload.
diff --git a/debian/patches/10-all-variants.patch b/debian/patches/10-all-variants.patch
index 8a7dd9f..cb076be 100644
--- a/debian/patches/10-all-variants.patch
+++ b/debian/patches/10-all-variants.patch
@@ -2,9 +2,9 @@ Description: Document we support all variants of the game
 Author: Fabian Greffrath <fabian+debian at greffrath.com>
 Forwarded: not-needed
 
---- rott-1.1.1.obsolete.0.838742770793946.orig/doc/rott.6
-+++ rott-1.1.1.obsolete.0.838742770793946/doc/rott.6
-@@ -7,11 +7,41 @@ rott \- Rise of the Triad
+--- a/doc/rott.6
++++ b/doc/rott.6
+@@ -7,11 +7,35 @@ rott \- Rise of the Triad
  .B rott
  .RI [ options ]
  
@@ -14,30 +14,24 @@ Forwarded: not-needed
 +.B rott-commercial
 +.RI [ options ]
 +
-+.B rott-superrott
-+.RI [ options ]
-+
-+.B rott-sitelicense
-+.RI [ options ]
-+
  .SH DESCRIPTION
  .B ROTT
  is a port of Apogee's 3D action title Rise of the Triad, originally released in 1994.
  This port duplicates the functionality of the original game on modern operating systems, including Linux, Win32, and Mac OS X.
  
 +The
-+.B rott-shareware,
-+.B rott-commercial,
-+.B rott-superrott
++.B rott-shareware
 +and
-+.B rott-sitelicense
++.B rott-commercial
 +binaries start the
-+.B Shareware Version,
-+.B Commercial Version,
-+.B CD Version
++.B Shareware Version
 +and
++.B Commercial Version
++(including the
++.B CD Version
++and the
 +.B Site License CD Version
-+of the game, respectively. The
++) of the game, respectively. The
 +.B rott
 +binary is a symbolic link to one of these and is handled via Debian's
 +.B update-alternatives
diff --git a/debian/patches/rott-merge-commercial.patch b/debian/patches/rott-merge-commercial.patch
new file mode 100644
index 0000000..d096f29
--- /dev/null
+++ b/debian/patches/rott-merge-commercial.patch
@@ -0,0 +1,215 @@
+Author: Fabian Greffrath <fabian+debian at greffrath.com>
+Description: Make the "registered" variant recognize all supported
+ multiplayer map files and set 'gamestate.Product' accordingly.
+ This saves us from rebuilding the SUPERROTT and SITELICENSE variants
+ which had their multiplayer map file names hard-coded.
+
+--- a/rott/Makefile
++++ b/rott/Makefile
+@@ -2,13 +2,8 @@
+ # Make sure only one of the following is set to 1 at once
+ # Triple 0 will build the commercial/registered version
+ 
+-SHAREWARE   ?= 1
+-SUPERROTT   ?= 0
+-SITELICENSE ?= 0
+-
++SHAREWARE ?= 0
+ CPPFLAGS += -DSHAREWARE=$(SHAREWARE)
+-CPPFLAGS += -DSUPERROTT=$(SUPERROTT)
+-CPPFLAGS += -DSITELICENSE=$(SITELICENSE)
+ 
+ ROTT ?= rott
+ 
+--- a/rott/_rt_ted.h
++++ b/rott/_rt_ted.h
+@@ -84,19 +84,6 @@ typedef struct
+ 
+ #define  MAXSILLYSTRINGS 32
+ 
+-#if (SHAREWARE==0)
+-   #define  STANDARDGAMELEVELS   (DATADIR "DARKWAR.RTL")
+-   #if (SUPERROTT==1)
+-       #define  STANDARDBATTLELEVELS (DATADIR "ROTTCD.RTC")
+-   #elif (SITELICENSE==1)
+-       #define  STANDARDBATTLELEVELS (DATADIR "ROTTSITE.RTC")
+-   #else
+-       #define  STANDARDBATTLELEVELS (DATADIR "DARKWAR.RTC")
+-   #endif
+-#else
+-   #define  STANDARDGAMELEVELS   (DATADIR "HUNTBGIN.RTL")
+-   #define  STANDARDBATTLELEVELS (DATADIR "HUNTBGIN.RTC")
+-#endif
+ 
+ 
+ 
+--- a/rott/develop.h
++++ b/rott/develop.h
+@@ -40,10 +40,6 @@ Foundation, Inc., 59 Temple Place - Suit
+ #define LOWCOST  0
+ 
+ #define BNACRASHPREVENT  1 //bna added 
+-// Make sure only one of the following are on at one time
+-//#define SHAREWARE   1
+-//#define SUPERROTT   0
+-//#define SITELICENSE 0
+ 
+ // cute little dopefish thing, only works with special patch?
+ #define DOPEFISH 0
+--- a/rott/rt_main.c
++++ b/rott/rt_main.c
+@@ -179,6 +179,7 @@ extern void RecordDemoQuery ( void );
+ int main (int argc, char *argv[])
+ {
+     char *macwd;
++    extern char *BATTMAPS;
+ #ifndef DOS
+ 	_argc = argc;
+ 	_argv = argv;
+@@ -214,13 +215,33 @@ int main (int argc, char *argv[])
+    gamestate.Version = ROTTVERSION;
+ 
+ #if ( SHAREWARE == 1 )
++   BATTMAPS = strdup(STANDARDBATTLELEVELS);
++   FixFilePath(BATTMAPS);
+    gamestate.Product = ROTT_SHAREWARE;
+-#elif ( SUPERROTT == 1 )
+-   gamestate.Product = ROTT_SUPERCD;
+-#elif ( SITELICENSE == 1 )
+-   gamestate.Product = ROTT_SITELICENSE;
+ #else
+-   gamestate.Product = ROTT_REGISTERED;
++   BATTMAPS = strdup(SITELICENSEBATTLELEVELS);
++   FixFilePath(BATTMAPS);
++   if (!access(BATTMAPS, R_OK))
++   {
++       gamestate.Product = ROTT_SITELICENSE;
++   }
++   else
++   {
++       free(BATTMAPS);
++       BATTMAPS = strdup(SUPERROTTBATTLELEVELS);
++       FixFilePath(BATTMAPS);
++       if (!access(BATTMAPS, R_OK))
++       {
++           gamestate.Product = ROTT_SUPERCD;
++       }
++       else
++       {
++           free(BATTMAPS);
++           BATTMAPS = strdup(STANDARDBATTLELEVELS);
++           FixFilePath(BATTMAPS);
++           gamestate.Product = ROTT_REGISTERED;
++       }
++   }
+ #endif
+ 
+    DrawRottTitle ();
+--- a/rott/rt_main.h
++++ b/rott/rt_main.h
+@@ -31,6 +31,16 @@ Foundation, Inc., 59 Temple Place - Suit
+ #include "rottnet.h"
+ #include "rt_battl.h"
+ 
++#if (SHAREWARE==0)
++   #define  STANDARDGAMELEVELS   (DATADIR "DARKWAR.RTL")
++   #define  STANDARDBATTLELEVELS (DATADIR "DARKWAR.RTC")
++   #define  SUPERROTTBATTLELEVELS (DATADIR "ROTTCD.RTC")
++   #define  SITELICENSEBATTLELEVELS (DATADIR "ROTTSITE.RTC")
++#else
++   #define  STANDARDGAMELEVELS   (DATADIR "HUNTBGIN.RTL")
++   #define  STANDARDBATTLELEVELS (DATADIR "HUNTBGIN.RTC")
++#endif
++
+ enum
+ {vl_low,
+  vl_medium,
+--- a/rott/rt_ted.c
++++ b/rott/rt_ted.c
+@@ -115,7 +115,7 @@ static cachetype * cachelist;
+ static word cacheindex;
+ static boolean CachingStarted=false;
+ static char * ROTTMAPS = STANDARDGAMELEVELS;
+-static char * BATTMAPS = STANDARDBATTLELEVELS;
++char * BATTMAPS;
+ 
+ static char NormalWeaponTiles[ 10 ] =
+    {
+--- a/rott/rt_actor.c
++++ b/rott/rt_actor.c
+@@ -1621,11 +1621,8 @@ void SpawnStand (classtype which, int ti
+ 
+ 
+  #if 0
+- #if (SUPERROTT == 1)
+-
++ if (gamestate.Product == ROTT_SUPERCD)
+    ConsiderAlternateActor(new,which);
+-
+- #endif
+  #endif
+ 
+    StandardEnemyInit(new,dir);
+@@ -1671,10 +1668,9 @@ void SpawnPatrol (classtype which, int t
+ {statetype *temp;
+  int path=PATH;
+ #if 0
+-#if (SUPERROTT == 1)
++if (gamestate.Product == ROTT_SUPERCD)
+  char *altstartlabel;
+ #endif
+-#endif
+ 
+ 
+ 
+@@ -1711,10 +1707,9 @@ void SpawnPatrol (classtype which, int t
+ 
+ 
+    #if 0
+-   #if (SUPERROTT == 1)
++   if (gamestate.Product == ROTT_SUPERCD)
+    ConsiderAlternateActor(new,which);
+    #endif
+-   #endif
+ 
+    StandardEnemyInit(new,dir);
+ 
+--- a/rott/rt_menu.c
++++ b/rott/rt_menu.c
+@@ -7155,8 +7155,6 @@ void CP_TeamPlayErrorMessage
+ //
+ //****************************************************************************
+ 
+-#if (SITELICENSE == 0)
+-
+ #define SITELINES 8
+ 
+ char *sitemessage[] =
+@@ -7171,8 +7169,6 @@ char *sitemessage[] =
+    "For more on site licenses, see ORDERING INFO."
+    };
+ 
+-#endif
+-
+ void CP_ModemGameMessage (int player  )
+ 
+    {
+@@ -7215,7 +7211,8 @@ void CP_ModemGameMessage (int player  )
+          MenuBufCPrint ("Please wait while\nMaster selects\nCOMM-BAT options.");
+          }
+ 
+-#if (SITELICENSE == 0)
++if (gamestate.Product != ROTT_SITELICENSE)
++{
+       if (networkgame==true)
+          {
+          for( i = 0; i < SITELINES; i++ )
+@@ -7224,7 +7221,7 @@ void CP_ModemGameMessage (int player  )
+                sitemessage[ i ] );
+             }
+          }
+-#endif
++}
+       }
+ 
+    FlipMenuBuf();
diff --git a/debian/patches/series b/debian/patches/series
index 759879a..f9bbfff 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 rott-r275.diff
 rott-r276.diff
 conflicting_types.patch
+rott-merge-commercial.patch
diff --git a/debian/rott.links b/debian/rott.links
index a482125..ec37eb2 100644
--- a/debian/rott.links
+++ b/debian/rott.links
@@ -1,4 +1,2 @@
 usr/share/man/man6/rott.6.gz usr/share/man/man6/rott-shareware.6.gz
 usr/share/man/man6/rott.6.gz usr/share/man/man6/rott-commercial.6.gz
-usr/share/man/man6/rott.6.gz usr/share/man/man6/rott-superrott.6.gz
-usr/share/man/man6/rott.6.gz usr/share/man/man6/rott-sitelicense.6.gz
diff --git a/debian/rott.postinst b/debian/rott.postinst
index 625378f..6777927 100644
--- a/debian/rott.postinst
+++ b/debian/rott.postinst
@@ -1,22 +1,11 @@
 #!/bin/sh
 set -e
 
-case "$1" in
-	abort-upgrade|configure)
-		update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-shareware   30
-		update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-commercial  20
-		update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-superrott   20
-		update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-sitelicense 20
-	;;
-
-	abort-remove|abort-deconfigure)
-	;;
-
-	*)
-		echo "postinst called with unknown argument \`$1'" >&2
-		exit 1
-	;;
-esac
+if [ "$1" = "abort-upgrade" ] || [ "$1" = "configure" ]
+then
+  update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-shareware  30
+  update-alternatives --quiet --install /usr/games/rott rott /usr/games/rott-commercial 20
+fi
 
 #DEBHELPER#
 
diff --git a/debian/rott.preinst b/debian/rott.preinst
new file mode 100644
index 0000000..777d3fd
--- /dev/null
+++ b/debian/rott.preinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]
+then
+  if dpkg --compare-versions "$2" lt-nl "1.1.2-3~"
+  then
+    update-alternatives --quiet --remove rott /usr/games/rott-superrott
+    update-alternatives --quiet --remove rott /usr/games/rott-sitelicense
+  fi
+fi
+
+#DEBHELPER#
diff --git a/debian/rott.prerm b/debian/rott.prerm
index a7b4cbf..9651d6b 100644
--- a/debian/rott.prerm
+++ b/debian/rott.prerm
@@ -1,44 +1,10 @@
 #!/bin/sh
 set -e
 
-case "$1" in
-	remove|deconfigure)
-		update-alternatives --quiet --remove-all rott
-
-		rm -f /usr/share/doc/rott/vendor.doc
-
-		if [ "`dpkg -l rott-data 2> /dev/null | grep ^ii`" ]
-		then
-			# rott-data is installed, delete all data files
-			# that are definitely not in rott-data
-			rm -f /usr/share/games/rott/1rott13.zip  \
-			      /usr/share/games/rott/FILE_ID.DIZ  \
-			      /usr/share/games/rott/INSTALL.EXE  \
-			      /usr/share/games/rott/ROTTSW13.SHR \
-			      /usr/share/games/rott/MODEM.PCK    \
-			      /usr/share/games/rott/ORDER.FRM    \
-			      /usr/share/games/rott/README.EXE   \
-			      /usr/share/games/rott/ROTT.EXE     \
-			      /usr/share/games/rott/ROTTHELP.EXE \
-			      /usr/share/games/rott/ROTTIPX.EXE  \
-			      /usr/share/games/rott/ROTTSER.EXE  \
-			      /usr/share/games/rott/SETUP.EXE    \
-			      /usr/share/games/rott/SNDSETUP.EXE
-		else
-			# rott-data is not (yet) installed, it is safe
-			# to delete the whole directory.
-			rm -rf /usr/share/games/rott
-		fi
-	;;
-
-	upgrade|failed-upgrade)
-	;;
-
-	*)
-		echo "prerm called with unknown argument \`$1'" >&2
-		exit 1
-	;;
-esac
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]
+then
+  update-alternatives --quiet --remove-all rott
+fi
 
 #DEBHELPER#
 
diff --git a/debian/rules b/debian/rules
index ff497b8..eeb4df1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,13 +16,7 @@ debian/rott.png: debian/rott.svg
 override_dh_auto_build:
 	# Shareware Version
 	$(MAKE) -C rott tidy
-	dh_auto_build -O--parallel -- ROTT=rott-shareware
+	dh_auto_build -O--parallel -- ROTT=rott-shareware  SHAREWARE=1
 	# Commercial Version
 	$(MAKE) -C rott tidy
-	dh_auto_build -O--parallel -- ROTT=rott-commercial  SHAREWARE=0
-	# CD Version
-	$(MAKE) -C rott tidy
-	dh_auto_build -O--parallel -- ROTT=rott-superrott   SHAREWARE=0 SUPERROTT=1
-	# Site License CD Version
-	$(MAKE) -C rott tidy
-	dh_auto_build -O--parallel -- ROTT=rott-sitelicense SHAREWARE=0 SITELICENSE=1
+	dh_auto_build -O--parallel -- ROTT=rott-commercial SHAREWARE=0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/rott.git



More information about the Pkg-games-commits mailing list