Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Apr 2003 11:10:28 GMT
From:      Yonatan@xpert.com
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/50535: New port: games/tetris, taken from OpenBSD's base
Message-ID:  <200304021110.h32BAS500660@node-110.xpert.com>
Resent-Message-ID: <200304020820.h328K45J086725@freefall.freebsd.org>

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

>Number:         50535
>Category:       ports
>Synopsis:       New port: games/tetris, taken from OpenBSD's base
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 02 00:20:04 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Yonatan@xpert.com
>Release:        FreeBSD 4.8-RC i386
>Organization:
>Environment:
System: FreeBSD Temujin 4.8-RC FreeBSD 4.8-RC #4: Tue Mar 11 17:44:31 GMT 2003 root@Temujin:/usr/obj/usr/src/sys/TEMUJIN i386

>Description:
	This is a textual version of Tetris. OpenBSD took it from NetBSD.
	Please read the readme/note.
>How-To-Repeat:
	N/A
>Fix:

--- tetris.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	.
#	./pkg-descr
#	./readme
#	./readme/mktetristarball
#	./readme/note
#	./distinfo
#	./Makefile
#	./pkg-plist
#	./files
#	./files/patch-Makefile
#	./files/patch-pathnames.h
#
echo c - .
mkdir -p . > /dev/null 2>&1
echo x - ./pkg-descr
sed 's/^X//' >./pkg-descr << 'END-of-./pkg-descr'
XThe tetris command runs a display-based game.  The object is to fit
Xshapes together to form complete rows, which then vanish.  When the
Xshapes fill up to the top, the game ends.  You can optionally select a
Xlevel of play or custom-select control keys.
X
XThis port is made of OpenBSD's tetris games. It got there from NetBSD...
END-of-./pkg-descr
echo c - ./readme
mkdir -p ./readme > /dev/null 2>&1
echo x - ./readme/mktetristarball
sed 's/^X//' >./readme/mktetristarball << 'END-of-./readme/mktetristarball'
X#!/bin/sh
Xtouch test || exit 1			# i need write perms
Xrm test || exit 1			# if this fails - you'r in limbo
Xexport CVSROOT=:pserver:anoncvs@anoncvs1.usa.openbsd.org:/cvs
Xecho enter "anoncvs"
Xcvs login || exit 1			# please login again
Xcvs get src/games/tetris || exit 1	# it's important this succeeds
Xcvs logout				# don't care if this fails
Xrm -rf ./src/games/tetris/CVS/ || exit 1
Xrm -rf ./src/games/tetris/Makefile || exit 1
Xtar -czpf tetris-`date "+%d%m%Y"`.tar.gz  -C ./src/games/tetris/ . || exit 1 
Xrm -rf ./src
END-of-./readme/mktetristarball
echo x - ./readme/note
sed 's/^X//' >./readme/note << 'END-of-./readme/note'
X1. Remove this directory before commit, as it won't self destruct in 5 sec. :-)
X2. Use "mktetristarball" script to roll a new tarball when the source changes.
X3. Is it legit for this port to install itself as sgid "games"?
X4. If not, then how do we handle the score file?
X5. Is PREFIX/var/games/ the best place for the scores file?
X6. It's currently not removed via pkg-plist, because I made it in the spirit of
X   /var/games - a place for games to hold a file or two. Is it correct?
X7. Please copy the tarball to your mirror and adjust the SITES in the Makfile.
X
XThanks,
XYonatan (@xpert.com)
END-of-./readme/note
echo x - ./distinfo
sed 's/^X//' >./distinfo << 'END-of-./distinfo'
XMD5 (tetris-01042003.tar.gz) = 48447120fc2b371b91184fe1cc61dd47
END-of-./distinfo
echo x - ./Makefile
sed 's/^X//' >./Makefile << 'END-of-./Makefile'
X# Ports collection makefile for:  hspell
X# Date created:	                  01 Apr 2003
X# Whom:                           Yonatan <Yonatan@xpert.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	tetris
XPORTVERSION=	1
XCATEGORIES=	games
XMASTER_SITES=	http://j.xpert.com/FreeBSD/	# XXX
X#MASTER_SITES=	${MASTER_SITE_LOCAL}
X#MASTER_SITE_SUBDIR=	ceri
XDISTNAME=	${PORTNAME}-01042003
X
XMAINTAINER=	yonatan@xpert.com
XCOMMENT=	Text-based tetris game
X
XNO_WRKSUBDIR=	yes
XUSE_REINPLACE=	yes
X
XMAN6=		tetris.6
X
Xpost-patch:
X	${REINPLACE_CMD} -E "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/pathnames.h
X
Xpost-install:
X	${INSTALL_MAN} ${WRKSRC}/tetris.6 ${PREFIX}/man/man6/tetris.6
X
X.include <bsd.port.mk>
END-of-./Makefile
echo x - ./pkg-plist
sed 's/^X//' >./pkg-plist << 'END-of-./pkg-plist'
X@comment $FreeBSD$
Xbin/tetris
END-of-./pkg-plist
echo c - ./files
mkdir -p ./files > /dev/null 2>&1
echo x - ./files/patch-Makefile
sed 's/^X//' >./files/patch-Makefile << 'END-of-./files/patch-Makefile'
X--- Makefile.orig	Tue Apr  1 23:23:08 2003
X+++ Makefile	Tue Apr  1 23:23:43 2003
X@@ -0,0 +1,26 @@
X+# Makefile for Tetris
X+# $FreeBSD$
X+
X+TMPLDFLAGS+= -lcurses -ltermcap
X+SRCS= screen.c shapes.c input.c tetris.c scores.c
X+
X+PREFIX?=/usr/local
X+MKDIR?=mkdir -p
X+
X+all: 
X+.	for files in ${SRCS}
X+		${CC} ${CFLAGS} ${LDFLAGS} -c ${files}
X+.	endfor
X+	${CC} ${CFLAGS} ${LDFLAGS} ${TMPLDFLAGS} -o tetris input.o scores.o \
X+            screen.o shapes.o tetris.o
X+
X+install:
X+	${INSTALL} -g games -m 2555 tetris ${PREFIX}/bin
X+.	if !exists(${PREFIX}/var/games/tetris.scores)
X+		${MKDIR} ${PREFIX}/var/games
X+		${INSTALL} -g games -m 664 /dev/null \
X+			${PREFIX}/var/games/tetris.scores
X+.endif
X+
X+clean:
X+	rm -f *.o *.core
END-of-./files/patch-Makefile
echo x - ./files/patch-pathnames.h
sed 's/^X//' >./files/patch-pathnames.h << 'END-of-./files/patch-pathnames.h'
X--- pathnames.h.orig	Tue Apr  1 23:06:45 2003
X+++ pathnames.h	Tue Apr  1 23:07:14 2003
X@@ -39,4 +39,4 @@
X  *	@(#)pathnames.h	8.1 (Berkeley) 5/31/93
X  */
X 
X-#define _PATH_SCOREFILE	"/var/games/tetris.scores"
X+#define _PATH_SCOREFILE	"%%PREFIX%%/var/games/tetris.scores"
END-of-./files/patch-pathnames.h
exit

--- tetris.shar ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



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