Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jan 2006 16:57:00 -0300
From:      "Alejandro Pulver" <alejandro@varnet.biz>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   ports/92019: [UPDATE] games/wolf3d: allow playing Wolf3D/SOD in shareware/full mode
Message-ID:  <1137700620.0@phobos.mars.bsd>
Resent-Message-ID: <200601192000.k0JK0KUD024204@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         92019
>Category:       ports
>Synopsis:       [UPDATE] games/wolf3d: allow playing Wolf3D/SOD in shareware/full mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 19 20:00:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Alejandro Pulver
>Release:        FreeBSD 5.4-RELEASE i386
>Organization:
>Environment:


System: FreeBSD 5.4-RELEASE #0: Sat May 21 12:14:47 ART 2005
    root@ale.varnet.bsd:/usr/src/sys/i386/compile/ATHLON-ALE



>Description:


* Allow playing Wolf3D/SOD in shareware/full mode.
* Edit wrapper script.
* Increment PORTREVISION.
* Add OPTIONS for downloading shareware data files (Wolf3D/SOD).
* Use DATADIR for data and libexec for binaries.


>How-To-Repeat:





>Fix:


--- wolf3d.diff begins here ---
diff -urN /usr/ports/games/wolf3d/Makefile wolf3d/Makefile
--- /usr/ports/games/wolf3d/Makefile	Wed Dec 21 07:15:57 2005
+++ wolf3d/Makefile	Thu Jan 19 16:53:08 2006
@@ -7,45 +7,81 @@
 
 PORTNAME=	wolf3d
 PORTVERSION=	20011028
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	games
 MASTER_SITES=	http://www.icculus.org/wolf3d/:wolf \
 		http://cvsup.theplanet.com/distfiles/:wolf \
-		http://www.liquidx.org/distfiles/:wolfdata
-DISTFILES=	wolf3d-20011028.tar.gz:wolf wolfdata.tar.gz:wolfdata
+		http://www.liquidx.org/distfiles/:sw \
+DISTNAME=	wolf3d-${PORTVERSION}
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}:wolf
 
 MAINTAINER=	tlp@liquidx.org
 COMMENT=	"Wolfenstein 3D Linux" by Steven Fuller (1992)
 
 USE_SDL=	sdl
-USE_GZIP=	yes
-USE_X_PREFIX=	yes
-USE_REINPLACE=	yes
-
-post-patch:
-	@${REINPLACE_CMD} -e 's|gcc|${CC}|' ${WRKSRC}/Makefile
-	@${REINPLACE_CMD} -e 's|sdl-config|sdl11-config|' ${WRKSRC}/Makefile
-	@${REINPLACE_CMD} -e 's|OBJS += sd_null.o|#OBJS += sd_null.o|' ${WRKSRC}/Makefile
-	@${REINPLACE_CMD} -e 's|#OBJS += sd_oss.o fmopl.o|OBJS += sd_oss.o fmopl.o|' ${WRKSRC}/Makefile
-	@${REINPLACE_CMD} -e 's|/usr/X11R6/lib|${X11BASE}/lib|' ${WRKSRC}/Makefile
-	@${CAT} ${FILESDIR}/wolf3d.in | ${SED} -e 's,%%PREFIX%%,${PREFIX},g' > ${WRKDIR}/wolf3d
+
+SUB_FILES=	wolf3d
+
+OPTIONS=	WOLF_SW "Install shareware data for Wolfenstein 3D" on \
+		SPEAR_SW "Install shareware data for Spear of Destiny" off
+
+WOLF_BIN=	sdlwolf3d
+WOLF_VERS=	wf ws sf ss
+
+WF_CF=		-DWMODE=1
+WS_CF=		-DWMODE=0
+SF_CF=		-DWMODE=3
+SS_CF=		-DWMODE=2
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_WOLF_SW)
+DISTFILES+=	wolfdata${EXTRACT_SUFX}:sw
+PLIST_SUB+=	WOLF_SW=""
+.else
+PLIST_SUB+=	WOLF_SW="@comment "
+.endif
+
+.if defined(WITH_SPEAR_SW)
+DISTFILES+=	speardata${EXTRACT_SUFX}:sw
+PLIST_SUB+=	SPEAR_SW=""
+.else
+PLIST_SUB+=	SPEAR_SW="@comment "
+.endif
+
+post-extract:
+	@${MV} ${WRKDIR}/audit.sdm ${WRKDIR}/audiot.sdm
+
+do-build:
+.for f in ${WOLF_VERS}
+	@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} WF=${${f:U}_CF} ${ALL_TARGET}
+	@cd ${WRKSRC} && ${MV} ${WOLF_BIN} ${WOLF_BIN}-${f}
+	@cd ${WRKSRC}; ${MAKE} clean
+.endfor
 
 do-install:
 	${MKDIR} ${PREFIX}/libexec/wolf3d
+.for f in ${WOLF_VERS}
+	${INSTALL_PROGRAM} ${WRKSRC}/${WOLF_BIN}-${f} ${PREFIX}/libexec/wolf3d
+.endfor
 	${INSTALL_SCRIPT} ${WRKDIR}/wolf3d ${PREFIX}/bin/wolf3d
-	${INSTALL_PROGRAM} ${WRKSRC}/sdlwolf3d ${PREFIX}/libexec/wolf3d/sdlwolf3d
-	${INSTALL_DATA} ${WRKDIR}/wolfdata/* ${PREFIX}/libexec/wolf3d
+
+	${MKDIR} ${DATADIR}
+	${INSTALL_DATA} ${WRKDIR}/wolfdata/* ${DATADIR}
+	${INSTALL_DATA} ${WRKDIR}/*.sdm ${DATADIR}
+
 .if !defined(NOPORTDOCS)
 	${MKDIR} ${DOCSDIR}
 	${MKDIR} ${DOCSDIR}/docs
 	${INSTALL_DATA} ${WRKSRC}/docs/* ${DOCSDIR}/docs
-	${INSTALL_DATA}	${WRKSRC}/IDEAS ${DOCSDIR}/IDEAS
-	${INSTALL_DATA} ${WRKSRC}/NOTES ${DOCSDIR}/NOTES
-	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/README
-	${INSTALL_DATA} ${WRKSRC}/TODO ${DOCSDIR}/TODO
+.   for f in IDEAS NOTES README TODO
+	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/IDEAS
+.   endfor
 .endif
 
 post-install:
+	@${ECHO_CMD}
 	@${CAT} ${PKGMESSAGE}
+	@${ECHO_CMD}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -urN /usr/ports/games/wolf3d/distinfo wolf3d/distinfo
--- /usr/ports/games/wolf3d/distinfo	Wed Mar 31 00:08:06 2004
+++ wolf3d/distinfo	Thu Jan 19 15:55:13 2006
@@ -1,4 +1,9 @@
 MD5 (wolf3d-20011028.tar.gz) = d085fc3b00eb2773e15491098461eb4b
+SHA256 (wolf3d-20011028.tar.gz) = 9a1bde32bee0e78a82ad98ee6176e3bf93ec4fa70d1353ad63e1f9f6a30c72fb
 SIZE (wolf3d-20011028.tar.gz) = 134539
 MD5 (wolfdata.tar.gz) = b73bba3a02c0f12cc56f01c8c9a2c3db
+SHA256 (wolfdata.tar.gz) = 46766d1c7aa98809042c24873571db6366b082babd6cfaf81a319e0bae4950e9
 SIZE (wolfdata.tar.gz) = 565585
+MD5 (speardata.tar.gz) = 5794d94ff0351116601728e16278425e
+SHA256 (speardata.tar.gz) = cdbd9c72701677f195546e9bbe12a8e39e3b6e995bf545f9c35fbd2cfd491fcb
+SIZE (speardata.tar.gz) = 557831
diff -urN /usr/ports/games/wolf3d/files/patch-Makefile wolf3d/files/patch-Makefile
--- /usr/ports/games/wolf3d/files/patch-Makefile	Wed Dec 31 21:00:00 1969
+++ wolf3d/files/patch-Makefile	Thu Jan 19 16:37:12 2006
@@ -0,0 +1,31 @@
+--- Makefile.orig	Thu Sep 27 20:58:29 2001
++++ Makefile	Thu Jan 19 16:36:59 2006
+@@ -1,7 +1,5 @@
+-CC = gcc
+ #CC = gcc-3.0
+ 
+-CFLAGS = -g -Wall -pedantic
+ #CFLAGS = -g -O2 -Wall -pedantic 
+ #CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
+ #CFLAGS = -g -Wall -pedantic -std=gnu99
+@@ -19,16 +17,15 @@
+ 
+ LFLAGS = -lm
+ 
+-OBJS += sd_null.o
+-#OBJS += sd_oss.o fmopl.o
++OBJS += sd_oss.o fmopl.o
+ #CFLAGS += -D_REENTRANT
+ #LFLAGS += -lpthread
+ 
+-CFLAGS += `sdl-config --cflags`
++CFLAGS += `$(SDL_CONFIG) --cflags` $(WF)
+ 
+ SLFLAGS = $(LFLAGS) -lvga
+-XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext
+-DLFLAGS = $(LFLAGS) `sdl-config --libs` -L/usr/X11R6/lib -lX11 -lXext
++XLFLAGS = $(LFLAGS) -L$(X11BASE)/lib -lX11 -lXext
++DLFLAGS = $(LFLAGS) `$(SDL_CONFIG) --libs` -L$(X11BASE)/lib -lX11 -lXext
+ 
+ NASM = nasm
+ 
diff -urN /usr/ports/games/wolf3d/files/wolf3d.in wolf3d/files/wolf3d.in
--- /usr/ports/games/wolf3d/files/wolf3d.in	Mon Jul  5 13:36:14 2004
+++ wolf3d/files/wolf3d.in	Thu Jan 19 16:51:34 2006
@@ -1,13 +1,26 @@
 #!/bin/sh
+#
 # wolf3d - wolf3d-20011028 wrapper script
 #
 # 2004 Travis Poppe
+#
 
-USERDIR=$HOME/.wolf3d
+USERDIR="$HOME/.wolf3d"
+WOLF_BIN="sdlwolf3d"
 
-if [ -d $USERDIR ]; then
-	echo "wolf3d appears to be installed to $USERDIR/"
+msg_game()
+{
+	echo "Please provide a \"-game\" parameter with one of the following values:"
 	echo ""
+	echo "wf - Wolfenstein 3D (full version)"
+	echo "ws - Wolfenstein 3D (shareware version)"
+	echo "sf - Spear of Destiny (full version)"
+	echo "ss - Spear of Destiny (shareware version)"
+	echo ""
+}
+
+msg_options()
+{
 	echo "Basic options:"
 	echo ""
 	echo "-nowait           Skips introduction"
@@ -19,28 +32,30 @@
 	echo "-demotest         Starts wolf3d in demonstration mode"
 	echo "-version          Reports game version"
 	echo ""
+}
 
-	cd $USERDIR
-	./sdlwolf3d $*
-	exit
-fi
-
-mkdir $USERDIR
-ln -s %%PREFIX%%/libexec/wolf3d/* $USERDIR
+if [ "$1" = "-game" -a -n "`echo $2 | grep -E '^(wf|ws|sf|ss)$'`" ]
+then
+	GAME="$2"
+	shift; shift
+
+	if [ ! -d $USERDIR ]
+	then
+		mkdir $USERDIR
+		ln -s %%PREFIX%%/libexec/wolf3d/* $USERDIR
+		ln -s %%DATADIR%%/* $USERDIR
+
+		echo "wolf3d was installed to $USERDIR/"
+	else
+		echo "wolf3d appears to be installed to $USERDIR/"
+	fi
+
+	msg_options
+
+	cd $USERDIR || exit 1
+	exec ./${WOLF_BIN}-${GAME} "$@"
+else
+	msg_game
 
-echo "Installed wolf3d to $USERDIR/"
-echo ""
-echo "Basic options:"
-echo ""
-echo "-nowait           Skips introduction"
-echo "-nojoy            Disables joystick"
-echo "-nomouse          Disables mouse"
-echo "-x2               Increases screen size by x2"
-echo "-x3               Increases screen size by x3"
-echo "-fullscreen       Enables fullscreen mode"
-echo "-demotest         Starts wolf3d in demonstration mode"
-echo "-version          Reports game version"
-echo ""
-
-cd $USERDIR
-./sdlwolf3d $*
+	exit 1
+fi
diff -urN /usr/ports/games/wolf3d/pkg-descr wolf3d/pkg-descr
--- /usr/ports/games/wolf3d/pkg-descr	Thu Jan 15 19:50:37 2004
+++ wolf3d/pkg-descr	Thu Jan 19 15:14:34 2006
@@ -1,8 +1,6 @@
 This is a October 28, 2001 Snapshot of "Wolfenstein 3D Linux" by Steven
-Fuller.  It is an unofficial Linux port of the id Software game,
-Wolfenstein 3D (1992).
-
-This port uses the shareware data files.
+Fuller. It is an unofficial Linux port of the id Software game,
+Wolfenstein 3D (1992). It also supports Spear of Destiny.
 
 WWW: http://www.icculus.org/wolf3d/
 
diff -urN /usr/ports/games/wolf3d/pkg-message wolf3d/pkg-message
--- /usr/ports/games/wolf3d/pkg-message	Wed Jan 28 23:53:41 2004
+++ wolf3d/pkg-message	Thu Jan 19 16:37:55 2006
@@ -1,8 +1,10 @@
--------------------------------------------------------------------------------
+==============================================================================
+
 This port's wrapper script will install the wolf3d data to your home directory
 the first time you run it. If for some odd reason you already have a directory
-called .wolf3d in your home directory, you must (re)move it before this port 
+called .wolf3d in your home directory, you must (re)move it before this port
 will function correctly.
 
 -tlp
--------------------------------------------------------------------------------
+
+==============================================================================
diff -urN /usr/ports/games/wolf3d/pkg-plist wolf3d/pkg-plist
--- /usr/ports/games/wolf3d/pkg-plist	Thu Jan 15 19:50:37 2004
+++ wolf3d/pkg-plist	Thu Jan 19 16:40:04 2006
@@ -1,19 +1,29 @@
 bin/wolf3d
-libexec/wolf3d/audiohed.wl1
-libexec/wolf3d/audiot.wl1
-libexec/wolf3d/gamemaps.wl1
-libexec/wolf3d/maphead.wl1
-libexec/wolf3d/sdlwolf3d
-libexec/wolf3d/vgadict.wl1
-libexec/wolf3d/vgagraph.wl1
-libexec/wolf3d/vgahead.wl1
-libexec/wolf3d/vswap.wl1
+libexec/wolf3d/sdlwolf3d-sf
+libexec/wolf3d/sdlwolf3d-ss
+libexec/wolf3d/sdlwolf3d-wf
+libexec/wolf3d/sdlwolf3d-ws
+%%PORTDOCS%%%%DOCSDIR%%/IDEAS
 %%PORTDOCS%%%%DOCSDIR%%/docs/goodstuf.txt
 %%PORTDOCS%%%%DOCSDIR%%/docs/release.txt
-%%PORTDOCS%%%%DOCSDIR%%/IDEAS
-%%PORTDOCS%%%%DOCSDIR%%/NOTES
-%%PORTDOCS%%%%DOCSDIR%%/README
-%%PORTDOCS%%%%DOCSDIR%%/TODO
+%%WOLF_SW%%%%DATADIR%%/audiohed.wl1
+%%WOLF_SW%%%%DATADIR%%/audiot.wl1
+%%WOLF_SW%%%%DATADIR%%/gamemaps.wl1
+%%WOLF_SW%%%%DATADIR%%/maphead.wl1
+%%WOLF_SW%%%%DATADIR%%/vgadict.wl1
+%%WOLF_SW%%%%DATADIR%%/vgagraph.wl1
+%%WOLF_SW%%%%DATADIR%%/vgahead.wl1
+%%WOLF_SW%%%%DATADIR%%/vswap.wl1
+%%SPEAR_SW%%%%DATADIR%%/audiohed.sdm
+%%SPEAR_SW%%%%DATADIR%%/audiot.sdm
+%%SPEAR_SW%%%%DATADIR%%/config.sdm
+%%SPEAR_SW%%%%DATADIR%%/gamemaps.sdm
+%%SPEAR_SW%%%%DATADIR%%/maphead.sdm
+%%SPEAR_SW%%%%DATADIR%%/vgadict.sdm
+%%SPEAR_SW%%%%DATADIR%%/vgagraph.sdm
+%%SPEAR_SW%%%%DATADIR%%/vgahead.sdm
+%%SPEAR_SW%%%%DATADIR%%/vswap.sdm
+@dirrm %%DATADIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%/docs
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
 @dirrm libexec/wolf3d
--- wolf3d.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1137700620.0>