aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@FreeBSD.org>2010-08-07 19:24:37 +0000
committerChristian Weisgerber <naddy@FreeBSD.org>2010-08-07 19:24:37 +0000
commit91aff1eab0ddf9108abe6edbc277562655180794 (patch)
tree7ef1f94c4185129c9bc44de37ab63e6bb4f29f32 /games
parentfbe25762662148681c3e78eee13cbcece18bf4c5 (diff)
downloadports-91aff1eab0ddf9108abe6edbc277562655180794.tar.gz
ports-91aff1eab0ddf9108abe6edbc277562655180794.zip
Notes
Diffstat (limited to 'games')
-rw-r--r--games/connect4/Makefile12
-rw-r--r--games/connect4/files/patch-aa47
-rw-r--r--games/connect4/files/patch-ab132
-rw-r--r--games/connect4/files/patch-ac33
-rw-r--r--games/connect4/pkg-descr12
-rw-r--r--games/connect4/pkg-plist5
6 files changed, 126 insertions, 115 deletions
diff --git a/games/connect4/Makefile b/games/connect4/Makefile
index c76eaa5c1ced..fc1bf5d3bc7c 100644
--- a/games/connect4/Makefile
+++ b/games/connect4/Makefile
@@ -7,7 +7,7 @@
PORTNAME= connect4
PORTVERSION= 3.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_COMP_SOURCES}
MASTER_SITE_SUBDIR= games/volume6
@@ -26,10 +26,14 @@ EXTRACT_AFTER_ARGS= | gunshar
NO_WRKSUBDIR= yes
MAN6= connect4.6
+SCOREFILE= /var/games/connect4.scores
+PLIST_SUB= SCOREFILE=${SCOREFILE}
+
do-install:
- ${INSTALL_PROGRAM} -m 2755 -o root -g games ${WRKSRC}/c4 ${PREFIX}/bin/connect4
- @${MKDIR} ${PREFIX}/share/connect4
- ${INSTALL_DATA} -m 664 -o root -g games /dev/null ${PREFIX}/share/connect4/scores
+ ${INSTALL_PROGRAM} -m 2755 -o root -g games ${WRKSRC}/c4 \
+ ${PREFIX}/bin/connect4
+ test -f ${SCOREFILE} || \
+ ${INSTALL_DATA} -m 664 -o root -g games /dev/null ${SCOREFILE}
${INSTALL_MAN} ${FILESDIR}/connect4.6 ${MANPREFIX}/man/man6
.include <bsd.port.mk>
diff --git a/games/connect4/files/patch-aa b/games/connect4/files/patch-aa
index aac62636f43f..ff7ae8dc93df 100644
--- a/games/connect4/files/patch-aa
+++ b/games/connect4/files/patch-aa
@@ -1,30 +1,17 @@
-*** Makefile.orig Fri Nov 3 02:23:51 2000
---- Makefile Fri Nov 3 02:24:41 2000
-***************
-*** 1,10 ****
- # Makefile for c4
-
-! CFLAGS = -g #-DSCOREFILE=\"/usr/games/lib/c4.scores\"
- CURSES = -lcurses -ltermcap
-
- c4 : c4.o screen.o c4.h tables.h types.h
-! cc $(CFLAGS) -o c4 c4.o screen.o $(CURSES)
-
- screen.o : c4.h
-
---- 1,15 ----
- # Makefile for c4
-+ # Patched for FreeBSD 2.1.5R by
-+ # Joel Sutton <suttonj@interconnect.com.au>
-+ # 15th April, 1997
-
-! CFLAGS += -DSCOREFILE=\"$(PREFIX)/share/connect4/scores\"
- CURSES = -lcurses -ltermcap
-
-+ all: c4
-+
- c4 : c4.o screen.o c4.h tables.h types.h
-! $(CC) $(CFLAGS) -o c4 c4.o screen.o $(CURSES)
-
- screen.o : c4.h
-
+--- Makefile.orig 2010-08-07 20:02:05.000000000 +0200
++++ Makefile 2010-08-07 20:23:05.000000000 +0200
+@@ -1,10 +1,12 @@
+ # Makefile for c4
+
+-CFLAGS = -g #-DSCOREFILE=\"/usr/games/lib/c4.scores\"
++CFLAGS += -DSCOREFILE=\"/var/games/connect4.scores\"
+ CURSES = -lcurses -ltermcap
+
++all: c4
++
+ c4 : c4.o screen.o c4.h tables.h types.h
+- cc $(CFLAGS) -o c4 c4.o screen.o $(CURSES)
++ $(CC) $(CFLAGS) -o c4 c4.o screen.o $(CURSES)
+
+ screen.o : c4.h
+
diff --git a/games/connect4/files/patch-ab b/games/connect4/files/patch-ab
index 40d88a84d8c0..07edd473b32d 100644
--- a/games/connect4/files/patch-ab
+++ b/games/connect4/files/patch-ab
@@ -1,49 +1,83 @@
-*** c4.c.orig Tue Apr 15 22:06:03 1997
---- c4.c Tue Apr 15 22:16:29 1997
-***************
-*** 11,16 ****
---- 11,18 ----
- * BITNET: tcjones@WATER.bitnet
- * Canadian domain: tcjones@dragon.uwaterloo.ca
- *
-+ * Patched by Joel Sutton, 15th April 1997
-+ * Changed gets calls to fgets. Changed inital prompt slightly.
- */
-
- #include <stdio.h>
-***************
-*** 219,225 ****
- register char *cp;
-
- printf("Would you like to go first? (yes/no) -> ");
-! if (!gets(line)){
- plot_finish();
- fprintf(stderr, "Could not read input line.\n");
- goodbye();
---- 221,227 ----
- register char *cp;
-
- printf("Would you like to go first? (yes/no) -> ");
-! if (!fgets(line,256,stdin)){
- plot_finish();
- fprintf(stderr, "Could not read input line.\n");
- goodbye();
-***************
-*** 620,627 ****
- }
- }
-
-! printf("Do you need help (n/y)? -> ");
-! if (!gets(line)){
- fprintf(stderr, "Could not read input line\n");
- goodbye();
- }
---- 622,629 ----
- }
- }
-
-! printf("Do you need help (y/n)? -> ");
-! if (!fgets(line,256,stdin)){
- fprintf(stderr, "Could not read input line\n");
- goodbye();
- }
+--- c4.c.orig 2010-08-07 20:02:05.000000000 +0200
++++ c4.c 2010-08-07 20:23:15.000000000 +0200
+@@ -14,7 +14,10 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <sys/types.h>
++#include <unistd.h>
+ #include <ctype.h>
+ #include <pwd.h>
+ #include <sys/time.h>
+@@ -55,7 +58,6 @@ char **envp;
+ register int winner = DRAW;
+ int temp;
+
+- envmesg(envp, "Connect Four");
+ do_args(argc, argv);
+ open_scorefile("a");
+ ask_help();
+@@ -219,7 +221,7 @@ ask_turn()
+ register char *cp;
+
+ printf("Would you like to go first? (yes/no) -> ");
+- if (!gets(line)){
++ if (!fgets(line,256,stdin)){
+ plot_finish();
+ fprintf(stderr, "Could not read input line.\n");
+ goodbye();
+@@ -586,7 +588,7 @@ think_of_fucking_clever_move()
+ }
+ }
+ DP(d, "The best column is %d\n", best_col);
+- DP(d, "Returning.\n\n\n", best_col);
++ DP(d, "Returning.\n\n\n");
+
+ if (best_col == -1){
+ print_game_record(CONFUSED);
+@@ -620,8 +622,8 @@ ask_help()
+ }
+ }
+
+- printf("Do you need help (n/y)? -> ");
+- if (!gets(line)){
++ printf("Do you need help (y/n)? -> ");
++ if (!fgets(line,256,stdin)){
+ fprintf(stderr, "Could not read input line\n");
+ goodbye();
+ }
+@@ -815,32 +817,3 @@ debug_off()
+ accept_move(turn);
+ }
+
+-/*
+- * Modify the environment to put message in the right place for
+- * the w and ps commands to find. Code stolen from MFCF lock
+- * program, originally by Ian!
+- *
+- */
+-
+-void
+-envmesg(environ, message)
+-char **environ;
+-char *message;
+-{
+- /*
+- * Note that this clobbers the environment, so we have to
+- * do it last, after all the getenv and termcap calls.
+- */
+-
+- char *last, *address;
+- while( environ[1] != 0 ) ++environ;
+- last = environ[0] + strlen(environ[0]);/* address of '\0' */
+- last = (char *)((int)last&(~03));/* word boundary */
+- *(int *)last = 0; /* clean out last word */
+- address = last +3 -strlen(message);
+- address = (char *)((int)address&(~03));/* word boundary */
+- *(int *)(address-4) = 0; /* clean out word below */
+- *(int *)(address-8) = 0; /* clean out word below */
+- strcpy( address, message );
+-}
+-
diff --git a/games/connect4/files/patch-ac b/games/connect4/files/patch-ac
index c9fa9c17aa62..99db2678dd3e 100644
--- a/games/connect4/files/patch-ac
+++ b/games/connect4/files/patch-ac
@@ -1,23 +1,10 @@
-*** screen.c.orig Tue Apr 15 22:06:03 1997
---- screen.c Tue Apr 15 22:16:30 1997
-***************
-*** 1,3 ****
---- 1,8 ----
-+ /*
-+ * Patched by Joel Sutton, 15th April 1997
-+ * Added endwin to tidy things up as per usenet posted patch.
-+ */
-+
- #include <stdio.h>
- #include <curses.h>
- #include "c4.h"
-***************
-*** 116,121 ****
---- 121,127 ----
- refresh();
- nocrmode();
- echo();
-+ endwin();
- }
-
-
+--- screen.c.orig 2010-08-07 20:02:05.000000000 +0200
++++ screen.c 2010-08-07 20:23:29.000000000 +0200
+@@ -116,6 +116,7 @@ plot_finish()
+ refresh();
+ nocrmode();
+ echo();
++ endwin();
+ }
+
+
diff --git a/games/connect4/pkg-descr b/games/connect4/pkg-descr
index d9cf742be359..b15789ebbf79 100644
--- a/games/connect4/pkg-descr
+++ b/games/connect4/pkg-descr
@@ -1,7 +1,5 @@
-Please refer to the man page for instructions and further information.
-
-This version contains my patches and man page.
-
-Share and enjoy,
-
-Joel...
+The real-life version of connect4 is basically an upright hollow board
+with several vertical columns and windows. Tokens are placed into the
+columns alternately by each player until one of the players has four
+tokens in a row. These four tokens must be adjacent to each other but
+the series of four can be in any direction.
diff --git a/games/connect4/pkg-plist b/games/connect4/pkg-plist
index ff211f1ca889..c5010a62d2e4 100644
--- a/games/connect4/pkg-plist
+++ b/games/connect4/pkg-plist
@@ -1,3 +1,4 @@
+@comment $FreeBSD$
bin/connect4
-share/connect4/scores
-@dirrm share/connect4
+@exec test -f %%SCOREFILE%% || install -o root -g games -m 664 /dev/null %%SCOREFILE%%
+@unexec test -s %%SCOREFILE%% || rm -f %%SCOREFILE%%