aboutsummaryrefslogtreecommitdiffstats
path: root/games/nethack32
diff options
context:
space:
mode:
authorglewis <glewis@FreeBSD.org>2004-04-13 05:02:09 +0800
committerglewis <glewis@FreeBSD.org>2004-04-13 05:02:09 +0800
commitf3050e5a14469170d77bc37d157dfa92dbc229bd (patch)
treeaed9c87be721f7bd05a52e79573b7ec6ad0f3dbf /games/nethack32
parent0d3c39f89f487da70df1b260938142e2021a777f (diff)
downloadfreebsd-ports-gnome-f3050e5a14469170d77bc37d157dfa92dbc229bd.tar.gz
freebsd-ports-gnome-f3050e5a14469170d77bc37d157dfa92dbc229bd.tar.zst
freebsd-ports-gnome-f3050e5a14469170d77bc37d157dfa92dbc229bd.zip
. Make this port installable in parallel with the other nethack versions.
The approach is slightly different from that taken by nethack34 and prevents the manual page conflicts produced by that approach. . While here, clean up the Makefile a little w.r.t. order and clean up the packing list to not produce warnings when the log or record are removed. With this change, you can have all nethack versions from ports installed at once. However, this isn't as pleasant as it could be, and I'd like to address this in the future by merging some changes from here into nethack33 (in particular) and nethack34.
Diffstat (limited to 'games/nethack32')
-rw-r--r--games/nethack32/Makefile55
-rw-r--r--games/nethack32/files/patch-ac9
-rw-r--r--games/nethack32/files/patch-af19
-rw-r--r--games/nethack32/files/patch-ag17
-rw-r--r--games/nethack32/files/patch-dgn_comp.613
-rw-r--r--games/nethack32/files/patch-dlb.613
-rw-r--r--games/nethack32/files/patch-lev_comp.613
-rw-r--r--games/nethack32/files/patch-nethack.640
-rw-r--r--games/nethack32/files/patch-recover.622
-rw-r--r--games/nethack32/files/pkg-deinstall.in (renamed from games/nethack32/pkg-deinstall)4
-rw-r--r--games/nethack32/pkg-plist14
11 files changed, 194 insertions, 25 deletions
diff --git a/games/nethack32/Makefile b/games/nethack32/Makefile
index a148c2d4f2a5..c3e89e5b5596 100644
--- a/games/nethack32/Makefile
+++ b/games/nethack32/Makefile
@@ -7,10 +7,10 @@
PORTNAME= nethack
PORTVERSION= 3.2.3
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
-MASTER_SITE_SUBDIR= ${PORTNAME}
+MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME= nethack-322
EXTRACT_SUFX= .tgz
@@ -21,22 +21,63 @@ PATCHFILES= nh-3.2.2-3.2.3.diff
MAINTAINER= glewis@FreeBSD.org
COMMENT= A dungeon explorin', slashin', hackin' game
-NO_LATEST_LINK= yes
-
WRKSRC= ${WRKDIR}/${PORTNAME}-3.2.2
+LATEST_LINK= nethack32
-USE_XPM= yes
USE_GMAKE= yes
-MAN6= dgn_comp.6 dlb.6 lev_comp.6 nethack.6 recover.6
+USE_REINPLACE= yes
+USE_XPM= yes
+PLIST_SUB= HACKNAME="${HACKNAME}" \
+ HACKEXT="${HACKEXT}"
+
+MAN6= dgn_comp${HACKEXT}.6 dlb${HACKEXT}.6 lev_comp${HACKEXT}.6 \
+ ${HACKNAME}.6 recover${HACKEXT}.6
+
+HACKEXT?= 32
+HACKNAME?= ${PORTNAME}${HACKEXT}
+HACKDIR?= share/${HACKNAME}
+HACKLINK= nethack
+
+DATADIR= ${PREFIX}/${HACKDIR}
+DOCSDIR= ${PREFIX}/share/doc/${HACKNAME}
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+PLIST_SUB+= HACKNAME="${HACKNAME}"
+
+.include <bsd.port.pre.mk>
+
+.if !exists(${PREFIX}/bin/${HACKLINK}) && ${HACKNAME} != ${HACKLINK}
+PLIST_SUB+= HACKLINK=""
+.else
+PLIST_SUB+= HACKLINK="@comment "
+.endif
pre-configure:
+.for f in include/config.h sys/unix/Makefile.top sys/unix/Makefile.doc
+ @${REINPLACE_CMD} -e 's|%%HACKNAME%%|${HACKNAME}|g' \
+ -e 's|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' \
+ -e 's|%%HACKEXT%%|${HACKEXT}|g' \
+ ${WRKSRC}/${f}
+.endfor
+.for f in dgn_comp.6 dlb.6 lev_comp.6 nethack.6 recover.6
+ @${REINPLACE_CMD} -e 's|%%HACKNAME%%|${HACKNAME}|g' \
+ -e 's|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' \
+ -e 's|%%HACKEXT%%|${HACKEXT}|g' \
+ ${WRKSRC}/doc/${f}
+.endfor
@cd ${WRKSRC}/sys/unix && ${SH} setup.sh
+pre-install:
+ @${CAT} ${FILESDIR}/pkg-deinstall.in | ${SED} \
+ -e 's|%%HACKDIR%%|${HACKDIR}|g' > ${PKGDEINSTALL}
+
post-install:
+.if !exists(${PREFIX}/bin/${HACKLINK}) && ${HACKNAME} != ${HACKLINK}
+ @${LN} -s -f ${PREFIX}/bin/${HACKNAME} ${PREFIX}/bin/${HACKLINK}
+.endif
@cd ${WRKSRC}/doc && ${SETENV} ${MAKE_ENV} ${MAKE} manpages
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/doc/Guidebook.txt ${DOCSDIR}
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/games/nethack32/files/patch-ac b/games/nethack32/files/patch-ac
index ee05125afe6c..42a4f2fa23f2 100644
--- a/games/nethack32/files/patch-ac
+++ b/games/nethack32/files/patch-ac
@@ -1,6 +1,7 @@
-diff -ruN ./include/config.h ../nethack-3.2.2/include/config.h
---- ./include/config.h Wed Dec 11 05:20:07 1996
-+++ ../nethack-3.2.2/include/config.h Sun Mar 21 17:25:02 1999
+$FreeBSD$
+
+--- include/config.h.orig Tue Dec 10 13:20:07 1996
++++ include/config.h Sat Apr 10 01:01:28 2004
@@ -211,7 +211,7 @@
* Some combinations make no sense. See the installation document.
*/
@@ -41,7 +42,7 @@ diff -ruN ./include/config.h ../nethack-3.2.2/include/config.h
*/
# ifndef HACKDIR
-# define HACKDIR "/usr/games/lib/nethackdir" /* nethack directory */
-+# define HACKDIR "/usr/local/share/nethack" /* nethack directory */
++# define HACKDIR "%%HACKDIR%%" /* nethack directory */
# endif
/*
diff --git a/games/nethack32/files/patch-af b/games/nethack32/files/patch-af
index f7200e63880e..d6ba657426a0 100644
--- a/games/nethack32/files/patch-af
+++ b/games/nethack32/files/patch-af
@@ -1,7 +1,7 @@
$FreeBSD$
--- sys/unix/Makefile.doc.orig Tue Dec 10 13:20:08 1996
-+++ sys/unix/Makefile.doc Thu Apr 8 16:29:59 2004
++++ sys/unix/Makefile.doc Sun Apr 11 23:08:20 2004
@@ -31,15 +31,15 @@
@@ -24,3 +24,20 @@ $FreeBSD$
# manual installation for most SYSV-style systems
# GAMEMANCREATE = nroff -man nethack.6 >
# LEVMANCREATE = nroff -man lev_comp.6 >
+@@ -48,11 +48,11 @@
+ # DLBMANCREATE = nroff -man dlb.6 >
+
+ manpages:
+- -$(GAMEMANCREATE) $(MANDIR)/$(GAME).$(MANEXT)
+- -$(LEVMANCREATE) $(MANDIR)/lev_comp.$(MANEXT)
+- -$(DGNMANCREATE) $(MANDIR)/dgn_comp.$(MANEXT)
+- -$(RCVRMANCREATE) $(MANDIR)/recover.$(MANEXT)
+- -$(DLBMANCREATE) $(MANDIR)/dlb.$(MANEXT)
++ -$(GAMEMANCREATE) $(MANDIR)/%%HACKNAME%%.$(MANEXT)
++ -$(LEVMANCREATE) $(MANDIR)/lev_comp%%HACKEXT%%.$(MANEXT)
++ -$(DGNMANCREATE) $(MANDIR)/dgn_comp%%HACKEXT%%.$(MANEXT)
++ -$(RCVRMANCREATE) $(MANDIR)/recover%%HACKEXT%%.$(MANEXT)
++ -$(DLBMANCREATE) $(MANDIR)/dlb%%HACKEXT%%.$(MANEXT)
+
+ # manual creation for distribution
+ DISTRIB = Guidebook.txt nethack.txt lev_comp.txt dgn_comp.txt recover.txt dlb.txt
diff --git a/games/nethack32/files/patch-ag b/games/nethack32/files/patch-ag
index 307e8a64e630..66c0054d804e 100644
--- a/games/nethack32/files/patch-ag
+++ b/games/nethack32/files/patch-ag
@@ -1,10 +1,13 @@
$FreeBSD$
--- sys/unix/Makefile.top.orig Tue Dec 10 13:20:10 1996
-+++ sys/unix/Makefile.top Thu Apr 8 16:57:27 2004
-@@ -16,14 +16,14 @@
++++ sys/unix/Makefile.top Sun Apr 11 23:25:22 2004
+@@ -14,16 +14,16 @@
+ # MAKE = make
+
# make NetHack
- GAME = nethack
+-GAME = nethack
++GAME = %%HACKNAME%%
GAMEUID = games
-GAMEGRP = bin
+GAMEGRP = games
@@ -27,7 +30,7 @@ $FreeBSD$
# instructions)
-GAMEDIR = /usr/games/lib/$(GAME)dir
-SHELLDIR = /usr/games
-+GAMEDIR = ${PREFIX}/share/$(GAME)
++GAMEDIR = %%HACKDIR%%
+SHELLDIR = ${PREFIX}/bin
# per discussion in Install.X11
@@ -57,10 +60,12 @@ $FreeBSD$
dofiles:
target=`sed -n \
-@@ -136,15 +138,17 @@
+@@ -135,16 +137,18 @@
+ -e '}' \
-e '$$s/.*/nodlb/p' < dat/options` ; \
$(MAKE) dofiles-$${target-nodlb}
- cp src/$(GAME) $(GAMEDIR)
+- cp src/$(GAME) $(GAMEDIR)
++ cp src/nethack $(GAMEDIR)/$(GAME)
+ cp util/recover $(GAMEDIR)
-rm -f $(SHELLDIR)/$(GAME)
sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
diff --git a/games/nethack32/files/patch-dgn_comp.6 b/games/nethack32/files/patch-dgn_comp.6
new file mode 100644
index 000000000000..af171b21e70b
--- /dev/null
+++ b/games/nethack32/files/patch-dgn_comp.6
@@ -0,0 +1,13 @@
+$FreeBSD$
+
+--- doc/dgn_comp.6.orig Mon Apr 12 09:28:09 2004
++++ doc/dgn_comp.6 Mon Apr 12 09:28:33 2004
+@@ -396,7 +396,7 @@
+ M. Stephenson (from the level compiler by Jean-Christophe Collet).
+ .SH "SEE ALSO"
+ .PP
+-lev_comp(6), nethack(6)
++lev_comp%%HACKEXT%%(6), %%HACKNAME%%(6)
+ .SH BUGS
+ .PP
+ Probably infinite.
diff --git a/games/nethack32/files/patch-dlb.6 b/games/nethack32/files/patch-dlb.6
new file mode 100644
index 000000000000..d7d7ed16feca
--- /dev/null
+++ b/games/nethack32/files/patch-dlb.6
@@ -0,0 +1,13 @@
+$FreeBSD$
+
+--- doc/dlb.6.orig Mon Apr 12 09:28:09 2004
++++ doc/dlb.6 Mon Apr 12 09:28:54 2004
+@@ -74,7 +74,7 @@
+ Kenneth Lorber
+ .SH "SEE ALSO"
+ .PP
+-nethack(6), tar(1)
++%%HACKNAME%%(6), tar(1)
+ .SH BUGS
+ .PP
+ Not a good tar emulation; - does not mean stdin or stdout.
diff --git a/games/nethack32/files/patch-lev_comp.6 b/games/nethack32/files/patch-lev_comp.6
new file mode 100644
index 000000000000..32f1f9171e8d
--- /dev/null
+++ b/games/nethack32/files/patch-lev_comp.6
@@ -0,0 +1,13 @@
+$FreeBSD$
+
+--- doc/lev_comp.6.orig Mon Apr 12 09:28:09 2004
++++ doc/lev_comp.6 Mon Apr 12 09:29:20 2004
+@@ -563,7 +563,7 @@
+ Jean-Christophe Collet, David Cohrs.
+ .SH "SEE ALSO"
+ .PP
+-dgn_comp(6), nethack(6)
++dgn_comp%%HACKEXT%%(6), %%HACKNAME%%(6)
+ .SH BUGS
+ .PP
+ Probably infinite.
diff --git a/games/nethack32/files/patch-nethack.6 b/games/nethack32/files/patch-nethack.6
new file mode 100644
index 000000000000..e023491d7317
--- /dev/null
+++ b/games/nethack32/files/patch-nethack.6
@@ -0,0 +1,40 @@
+$FreeBSD$
+
+--- doc/nethack.6.orig Mon Apr 12 09:28:09 2004
++++ doc/nethack.6 Mon Apr 12 09:30:52 2004
+@@ -3,7 +3,7 @@
+ .SH NAME
+ nethack \- Exploring The Mazes of Menace
+ .SH SYNOPSIS
+-.B nethack
++.B %%HACKNAME%%
+ [
+ .B \-d
+ .I directory
+@@ -149,7 +149,7 @@
+ supplies a directory which is to serve as the playground.
+ It overrides the value from NETHACKDIR, HACKDIR,
+ or the directory specified by the game administrator during compilation
+-(usually /usr/games/lib/nethackdir).
++(usually %%HACKDIR%%).
+ This option is usually only useful to the game administrator.
+ The playground must contain several auxiliary files such as help files,
+ the list of top scorers, and a subdirectory
+@@ -174,7 +174,7 @@
+ distinction, as he may eventually release a new version of his own.
+ .SH FILES
+ .PP
+-All files are in the playground, normally /usr/games/lib/nethackdir.
++All files are in the playground, normally %%HACKDIR%%.
+ If DLB was defined during the compile, the data files and special levels
+ will be inside a larger file, normally nhdat, instead of being separate
+ files.
+@@ -247,7 +247,7 @@
+ In addition, SHOPTYPE is used in debugging (wizard) mode.
+ .SH "SEE ALSO"
+ .PP
+-dgn_comp(6), lev_comp(6), recover(6)
++dgn_comp%%HACKEXT%%(6), lev_comp%%HACKEXT%%(6), recover%%HACKEXT%%(6)
+ .SH BUGS
+ .PP
+ Probably infinite.
diff --git a/games/nethack32/files/patch-recover.6 b/games/nethack32/files/patch-recover.6
new file mode 100644
index 000000000000..a252961f0cbc
--- /dev/null
+++ b/games/nethack32/files/patch-recover.6
@@ -0,0 +1,22 @@
+$FreeBSD$
+
+--- doc/recover.6.orig Mon Apr 12 09:28:09 2004
++++ doc/recover.6 Mon Apr 12 09:31:27 2004
+@@ -31,7 +31,7 @@
+ supplies a directory which is the NetHack playground.
+ It overrides the value from NETHACKDIR, HACKDIR, or the directory
+ specified by the game administrator during compilation
+-(usually /usr/games/lib/nethackdir).
++(usually %%HACKDIR%%).
+ .PP
+ For recovery to be possible,
+ .I nethack
+@@ -103,7 +103,7 @@
+ .I nethack
+ will find them in the uncompressed form.
+ .SH "SEE ALSO"
+-nethack(6)
++%%HACKNAME%%(6)
+ .SH BUGS
+ .PP
+ .I recover
diff --git a/games/nethack32/pkg-deinstall b/games/nethack32/files/pkg-deinstall.in
index c22bc93962b7..eef0b35d65e1 100644
--- a/games/nethack32/pkg-deinstall
+++ b/games/nethack32/files/pkg-deinstall.in
@@ -3,14 +3,14 @@
# $FreeBSD$
if [ "${2}" = "POST-DEINSTALL" ]; then
- if [ -d "${PKG_PREFIX}/share/nethack" ]; then
+ if [ -d "${PKG_PREFIX}/%%HACKDIR%%" ]; then
echo
echo "The ${1} save files have not been removed."
echo
echo "If you are deleting ${1} permanently then you can "
echo "remove the save files with the command:"
echo
- echo " rm -rf ${PKG_PREFIX}/share/nethack"
+ echo " rm -rf ${PKG_PREFIX}/%%HACKDIR%%"
echo
fi
fi
diff --git a/games/nethack32/pkg-plist b/games/nethack32/pkg-plist
index 2c8178ae8b2d..157f99a66ba4 100644
--- a/games/nethack32/pkg-plist
+++ b/games/nethack32/pkg-plist
@@ -1,8 +1,9 @@
-bin/nethack
-%%DATADIR%%/nethack
+%%HACKLINK%%bin/nethack
+bin/%%HACKNAME%%
+%%DATADIR%%/%%HACKNAME%%
@exec mkdir %D/%%DATADIR%%/save
@exec chmod -R 775 %D/%%DATADIR%%
-@exec chmod 2755 %D/%%DATADIR%%/nethack
+@exec chmod 2755 %D/%%DATADIR%%/%%HACKNAME%%
@exec chown games:games %D/%%DATADIR%%/save
@unexec rmdir %D/%%DATADIR%%/save 2>/dev/null || true
%%PORTDOCS%%%%DOCSDIR%%/Guidebook.txt
@@ -118,8 +119,11 @@ bin/nethack
%%DATADIR%%/wizard3.lev
%%DATADIR%%/wizhelp
@mode 664
-%%DATADIR%%/logfile
-%%DATADIR%%/record
%%DATADIR%%/perm
+@mode
+@unexec [ -s %D/%%HACKDIR%%/logfile ] || rm -f %D/%%HACKDIR%%/logfile
+@exec touch %D/%%HACKDIR%%/logfile && chmod 664 %D/%%HACKDIR%%/logfile
+@unexec [ -s %D/%%HACKDIR%%/record ] || rm -f %D/%%HACKDIR%%/record
+@exec touch %D/%%HACKDIR%%/record && chmod 664 %D/%%HACKDIR%%/record
@unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
%%PORTDOCS%%@dirrm %%DOCSDIR%%