Date: Tue, 11 Mar 2014 22:36:03 -0400 (EDT) From: Nikolai Lifanov <lifanov@mail.lifanov.com> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/187471: [patch] games/sokoban: undeprecate, modernize, stage, and adopt Message-ID: <20140312023603.8D2F21A90BA@mail.lifanov.com> Resent-Message-ID: <201403120240.s2C2e0gb024087@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 187471 >Category: ports >Synopsis: [patch] games/sokoban: undeprecate, modernize, stage, and adopt >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 Mar 12 02:40:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Nikolai Lifanov >Release: FreeBSD 10.0-RELEASE amd64 >Organization: >Environment: System: FreeBSD mail.lifanov.com 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: games/sokoban is a classic console game that works well on all suported FreeBSD releases, but it's not maintained and is now deprecated. Please see the attached patch: it modernizes several aspects of the port, including staging. There is a pkg version bump too, since it moves the score file to PREFIX. I will maintain it. >How-To-Repeat: Please apply this patch. >Fix: --- sokoban.patch begins here --- Index: games/sokoban/Makefile =================================================================== --- games/sokoban/Makefile (revision 347954) +++ games/sokoban/Makefile (working copy) @@ -3,29 +3,31 @@ PORTNAME= sokoban PORTVERSION= 1.0 +PORTREVISION= 1 CATEGORIES= games MASTER_SITES= ${MASTER_SITE_SUNSITE} MASTER_SITE_SUBDIR= games/strategy DISTFILES= ${PORTNAME}-src${EXTRACT_SUFX} -MAINTAINER= ports@FreeBSD.org -COMMENT= Logical game: problems with packets in cave +MAINTAINER= lifanov@mail.lifanov.com +COMMENT= Logical game: problems with packets in cave -DEPRECATED= Unmaintained since 2000 -EXPIRATION_DATE= 2014-04-11 WRKSRC= ${WRKDIR}/sokoban ALL_TARGET= -NO_STAGE= yes +NEEDS_ROOT= yes + do-install: - @ ${INSTALL_PROGRAM} ${WRKSRC}/sokoban ${PREFIX}/bin/sokoban - @ ${CHOWN} root:games ${PREFIX}/bin/sokoban - @ ${CHMOD} 2555 ${PREFIX}/bin/sokoban - @ ${MKDIR} ${PREFIX}/share/sokoban - @ ${CHOWN} root:games ${PREFIX}/share/sokoban - @ ${MKDIR} ${PREFIX}/share/sokoban/screens - @ ${CHOWN} root:games ${PREFIX}/share/sokoban/screens - @ ${INSTALL_DATA} ${WRKSRC}/screens/* ${PREFIX}/share/sokoban/screens - @ ${SH} pkg-install ${PKGNAME} POST-INSTALL + @${INSTALL_PROGRAM} ${WRKSRC}/sokoban ${STAGEDIR}${PREFIX}/bin/sokoban + @${CHOWN} root:games ${STAGEDIR}${PREFIX}/bin/sokoban + @${CHMOD} 2555 ${STAGEDIR}${PREFIX}/bin/sokoban + @${MKDIR} ${STAGEDIR}${PREFIX}/share/sokoban + @${CHOWN} root:games ${STAGEDIR}${PREFIX}/share/sokoban + @dd if=/dev/zero of=${STAGEDIR}${PREFIX}/share/sokoban/scores bs=1 count=2 + @${CHMOD} 664 ${STAGEDIR}${PREFIX}/share/sokoban/scores + @${CHOWN} root:games ${STAGEDIR}${PREFIX}/share/sokoban/scores + @${MKDIR} ${STAGEDIR}${PREFIX}/share/sokoban/screens + @${CHOWN} root:games ${STAGEDIR}${PREFIX}/share/sokoban/screens + @${INSTALL_DATA} ${WRKSRC}/screens/* ${STAGEDIR}${PREFIX}/share/sokoban/screens .include <bsd.port.mk> Index: games/sokoban/files/patch-Makefile =================================================================== --- games/sokoban/files/patch-Makefile (revision 0) +++ games/sokoban/files/patch-Makefile (working copy) @@ -0,0 +1,17 @@ +--- ./Makefile.orig 1992-05-09 19:23:46.000000000 -0400 ++++ ./Makefile 2014-03-11 22:14:36.359748029 -0400 +@@ -1,8 +1,12 @@ +-CCOPT= -O3 ++CCOPT= ${CFLAGS} ++.ifdef PREFIX ++CCOPT+= -DPREFIX=\"${PREFIX}\" ++.endif ++ + OBJECTS= sok.o readscreen.o showscreen.o play.o save.o score.o + + sokoban: $(OBJECTS) +- cc $(CCOPT) -static -o sokoban $(OBJECTS) -lcurses -ltermcap ++ cc $(CCOPT) -o sokoban $(OBJECTS) -lcurses -ltermcap + sok.o: sok.c sokoban.h + cc $(CCOPT) -c sok.c + Property changes on: games/sokoban/files/patch-Makefile ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: games/sokoban/files/patch-aa =================================================================== --- games/sokoban/files/patch-aa (revision 347953) +++ games/sokoban/files/patch-aa (working copy) @@ -1,25 +0,0 @@ -*** Makefile Sat May 9 23:23:46 1992 ---- /home/andy/tmp/wrk/Makefile Wed Jul 2 06:04:37 1997 -*************** -*** 1,8 **** -! CCOPT= -O3 - OBJECTS= sok.o readscreen.o showscreen.o play.o save.o score.o - - sokoban: $(OBJECTS) -! cc $(CCOPT) -static -o sokoban $(OBJECTS) -lcurses -ltermcap - sok.o: sok.c sokoban.h - cc $(CCOPT) -c sok.c - ---- 1,12 ---- -! CCOPT= ${CFLAGS} -! .ifdef PREFIX -! CCOPT+= -DPREFIX=\"${PREFIX}\" -! .endif -! - OBJECTS= sok.o readscreen.o showscreen.o play.o save.o score.o - - sokoban: $(OBJECTS) -! cc $(CCOPT) -o sokoban $(OBJECTS) -lcurses -ltermcap - sok.o: sok.c sokoban.h - cc $(CCOPT) -c sok.c - Index: games/sokoban/files/patch-ab =================================================================== --- games/sokoban/files/patch-ab (revision 347953) +++ games/sokoban/files/patch-ab (working copy) @@ -1,30 +0,0 @@ -*** sokoban.h Fri May 15 05:15:26 1992 ---- /home/andy/tmp/wrk/sokoban.h Tue Apr 29 19:02:00 1997 -*************** -*** 1,6 **** ---- 1,14 ---- - /*********************************************************************** - You may wish to alter the following directory paths - ***********************************************************************/ -+ -+ #ifdef PREFIX -+ #define SCREENPATH PREFIX "/share/sokoban/screens" -+ #define SAVEPATH PREFIX "/share/sokoban" -+ #define LOCKFILE "/tmp/sok.tmp" -+ #define SCOREFILE "/var/games/sokoban" -+ #else -+ - /**/ - /* SCREENPATH: the name of the directioy where the screen file are held */ - /**/ -*************** -*** 23,28 **** ---- 31,38 ---- - /* SCOREFILE: the full pathname of the score file */ - /**/ - #define SCOREFILE "/usr/games/sokob/highscore" -+ -+ #endif - - /**/ - /* MAXUSERNAME: defines the maximum length of a system's user name */ Index: games/sokoban/files/patch-ac =================================================================== --- games/sokoban/files/patch-ac (revision 347953) +++ games/sokoban/files/patch-ac (working copy) @@ -1,19 +0,0 @@ -*** play.c Sat May 16 06:53:27 1992 ---- /home/andy/tmp/wrk/play.c Tue Apr 29 18:45:43 1997 -*************** -*** 37,43 **** - - short play() { - -! short c; - short ret; - short undolock = 1; /* locked for undo */ - ---- 37,43 ---- - - short play() { - -! char c; - short ret; - short undolock = 1; /* locked for undo */ - Index: games/sokoban/files/patch-play.c =================================================================== --- games/sokoban/files/patch-play.c (revision 0) +++ games/sokoban/files/patch-play.c (working copy) @@ -0,0 +1,11 @@ +--- ./play.c.orig 1992-05-16 02:53:27.000000000 -0400 ++++ ./play.c 2014-03-11 22:14:36.546748659 -0400 +@@ -37,7 +37,7 @@ + + short play() { + +- short c; ++ char c; + short ret; + short undolock = 1; /* locked for undo */ + Property changes on: games/sokoban/files/patch-play.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Index: games/sokoban/files/patch-sokoban.h =================================================================== --- games/sokoban/files/patch-sokoban.h (revision 0) +++ games/sokoban/files/patch-sokoban.h (working copy) @@ -0,0 +1,26 @@ +--- ./sokoban.h.orig 1992-05-15 01:15:26.000000000 -0400 ++++ ./sokoban.h 2014-03-11 22:16:45.005739636 -0400 +@@ -1,6 +1,14 @@ + /*********************************************************************** + You may wish to alter the following directory paths + ***********************************************************************/ ++ ++#ifdef PREFIX ++#define SCREENPATH PREFIX "/share/sokoban/screens" ++#define SAVEPATH PREFIX "/share/sokoban" ++#define LOCKFILE "/tmp/sok.tmp" ++#define SCOREFILE PREFIX "/share/sokoban/scores" ++#else ++ + /**/ + /* SCREENPATH: the name of the directioy where the screen file are held */ + /**/ +@@ -24,6 +32,8 @@ + /**/ + #define SCOREFILE "/usr/games/sokob/highscore" + ++#endif ++ + /**/ + /* MAXUSERNAME: defines the maximum length of a system's user name */ + /**/ Property changes on: games/sokoban/files/patch-sokoban.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: games/sokoban/pkg-deinstall =================================================================== --- games/sokoban/pkg-deinstall (revision 347953) +++ games/sokoban/pkg-deinstall (working copy) @@ -1,8 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -FILE="/var/games/sokoban" - -if [ "$2" = "POST-DEINSTALL" -a -f "$FILE" ]; then - echo "===> If you are completely uninstalling sokoban you may also want to remove the scores files: $FILE" -fi Index: games/sokoban/pkg-install =================================================================== --- games/sokoban/pkg-install (revision 347953) +++ games/sokoban/pkg-install (working copy) @@ -1,9 +0,0 @@ -#!/bin/sh - -FILE="/var/games/sokoban" -[ "$2" != "POST-INSTALL" -o -f "$FILE" ] && exit 0 - -echo "===> Creating initial high score file $FILE" -dd if=/dev/zero of=$FILE bs=1 count=2 -chmod 664 $FILE -chown root:games $FILE Index: games/sokoban/pkg-plist =================================================================== --- games/sokoban/pkg-plist (revision 347954) +++ games/sokoban/pkg-plist (working copy) @@ -1,4 +1,5 @@ bin/sokoban +share/sokoban/scores share/sokoban/screens/sokoban.help share/sokoban/screens/screen.1 share/sokoban/screens/screen.2 @@ -52,4 +53,3 @@ share/sokoban/screens/screen.50 @dirrm share/sokoban/screens @dirrm share/sokoban -@unexec if [ `stat -f %z /var/games/sokoban 2>/dev/null` = "2" ]; then rm -f /var/games/sokoban; fi --- sokoban.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140312023603.8D2F21A90BA>