aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--games/crafty/Makefile23
-rw-r--r--games/crafty/files/patch-option.c15
-rw-r--r--games/crafty/pkg-plist2
-rw-r--r--games/crafty/scripts/configure5
4 files changed, 34 insertions, 11 deletions
diff --git a/games/crafty/Makefile b/games/crafty/Makefile
index 4359eef52d37..71acfcba3786 100644
--- a/games/crafty/Makefile
+++ b/games/crafty/Makefile
@@ -41,12 +41,15 @@ WITH_RCDIR= ~/
.if !defined(WITH_TBDIR)
WITH_TBDIR= ${PREFIX}/lib/crafty/TB
.endif
-
+.if !defined(WITH_PERSDIR)
+WITH_PERSDIR= ${PREFIX}/lib/crafty/cpf
+.endif
OPT= -DHASHSTATS -DTRACE -DBOOKDIR=\\\"${WITH_BOOKDIR}\\\" \
-DLOGDIR=\\\"${WITH_LOGDIR}\\\" \
-DRCDIR=\\\"${WITH_RCDIR}\\\" \
- -DTBDIR=\\\"${WITH_TBDIR}\\\"
-
+ -DTBDIR=\\\"${WITH_TBDIR}\\\" \
+ -DPERSDIR=\\\"${WITH_PERSDIR}\\\"
+
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386"
@@ -71,17 +74,19 @@ post-build:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/crafty ${PREFIX}/bin/crafty
- ${CHOWN} nobody:nogroup ${PREFIX}/bin/crafty
- ${CHMOD} 6555 ${PREFIX}/bin/crafty
- ${MKDIR} ${PREFIX}/lib/crafty
- ${CHOWN} nobody:nogroup ${PREFIX}/lib/crafty
+ ${CHOWN} root:nogroup ${PREFIX}/bin/crafty
+ ${CHMOD} 2555 ${PREFIX}/bin/crafty
+ ${MKDIR} ${PREFIX}/lib/crafty/cpf
+ ${CHOWN} -R root:nogroup ${PREFIX}/lib/crafty
+ ${CHMOD} 775 ${PREFIX}/lib/crafty ${PREFIX}/lib/crafty/cpf
${INSTALL_DATA} ${WRKSRC}/books.bin ${PREFIX}/lib/crafty/books.bin
${INSTALL_DATA} ${WRKSRC}/book.lrn ${PREFIX}/lib/crafty/book.lrn
${INSTALL_DATA} ${WRKSRC}/position.bin ${PREFIX}/lib/crafty/position.bin
${INSTALL_DATA} ${WRKSRC}/position.lrn ${PREFIX}/lib/crafty/position.lrn
+ ${INSTALL_DATA} ${WRKSRC}/crafty.hlp ${PREFIX}/lib/crafty/crafty.hlp
${TOUCH} ${PREFIX}/lib/crafty/book.bin
- ${CHOWN} nobody:nogroup ${PREFIX}/lib/crafty/book*
- ${CHOWN} nobody:nogroup ${PREFIX}/lib/crafty/position*
+ ${CHOWN} root:nogroup ${PREFIX}/lib/crafty/book*
+ ${CHOWN} root:nogroup ${PREFIX}/lib/crafty/position*
${CHMOD} 664 ${PREFIX}/lib/crafty/book*
${CHMOD} 664 ${PREFIX}/lib/crafty/position*
.if !defined(NOPORTDOCS)
diff --git a/games/crafty/files/patch-option.c b/games/crafty/files/patch-option.c
new file mode 100644
index 000000000000..3fa9104b480c
--- /dev/null
+++ b/games/crafty/files/patch-option.c
@@ -0,0 +1,15 @@
+--- option.c.orig Tue Jun 20 07:57:17 2006
++++ option.c Mon Sep 10 14:53:11 2007
+@@ -1331,9 +1331,11 @@
+ else if (OptionMatch("help", *args)) {
+ FILE *helpfile;
+ char *readstat = (char *) -1;
++ char fname[128];
+ int lines = 0;
+
+- helpfile = fopen("crafty.hlp", "r");
++ sprintf(fname, "%s/crafty.hlp", book_path);
++ helpfile = fopen(fname, "r");
+ if (!helpfile) {
+ printf("ERROR. Unable to open \"crafty.hlp\" -- help unavailable\n");
+ return (1);
diff --git a/games/crafty/pkg-plist b/games/crafty/pkg-plist
index e031e701e164..8fc99e3b34e4 100644
--- a/games/crafty/pkg-plist
+++ b/games/crafty/pkg-plist
@@ -2,9 +2,11 @@ bin/crafty
lib/crafty/book.bin
lib/crafty/book.lrn
lib/crafty/books.bin
+lib/crafty/crafty.hlp
lib/crafty/position.bin
lib/crafty/position.lrn
share/doc/crafty/crafty.doc.ascii
share/doc/crafty/crafty.doc.ps
@dirrm share/doc/crafty
+@dirrm lib/crafty/cpf
@dirrm lib/crafty
diff --git a/games/crafty/scripts/configure b/games/crafty/scripts/configure
index 56677e49d8d7..8866f23df05c 100644
--- a/games/crafty/scripts/configure
+++ b/games/crafty/scripts/configure
@@ -5,12 +5,13 @@
echo "WITH_LOGDIR (default: /tmp)"
echo "WITH_RCDIR (default: ~/)"
echo "WITH_TBDIR (default: ${PREFIX}/lib/crafty/TB)"
+ echo "WITH_PERSDIR (default: ${PREFIX}/lib/crafty/cpf)"
echo ""
echo "To alter any of these, press CTRL-C now, and "
echo "simply set your desired variable with one or more of:"
echo ""
- echo "<setenv WITH_BOOKDIR|LOGDIR|RCDIR|TBDIR path> (csh) or"
- echo "<export WITH_BOOKDIR|LOGDIR|RCDIR|TBDIR=path> (sh)"
+ echo "<setenv WITH_BOOKDIR|LOGDIR|RCDIR|TBDIR|PERSDIR path> (csh) or"
+ echo "<export WITH_BOOKDIR|LOGDIR|RCDIR|TBDIR|PERSDIR=path> (sh)"
echo ""
echo "Changing BOOKDIR or TBDIR is not recommended, as other"
echo "ports depend on these being in a standard location"