freebsd-ports/games/nethack33/Makefile
Stefan Eßer b7f05445c0 Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.

Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.

There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.

This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.

There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.

The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.

Approved by:		portmgr (tcberner)
2022-09-07 23:10:59 +02:00

109 lines
3.5 KiB
Makefile

PORTNAME= nethack33
PORTVERSION= 3.3.1
PORTREVISION= 11
CATEGORIES= games
MASTER_SITES= SF/${TRUEPORTNAME}/${TRUEPORTNAME}/${PORTVERSION}
DISTNAME= ${TRUEPORTNAME}-${PORTVERSION:S/.//g}
MAINTAINER= glewis@FreeBSD.org
COMMENT= Dungeon explorin', slashin', hackin' game
WWW= https://www.nethack.org/
WRKSRC= ${WRKDIR}/${TRUEPORTNAME}-${PORTVERSION}
USES= gmake ncurses tar:tgz
MAKE_ENV= GRAPHICS="${GRAPHICS}"
PLIST_SUB= HACKNAME="${HACKNAME}" \
HACKEXT="${HACKEXT}"
MAKE_JOBS_UNSAFE= yes
TRUEPORTNAME= nethack
HACKEXT?= 33
HACKNAME?= ${TRUEPORTNAME}${HACKEXT}
HACKDIR?= share/${HACKNAME}
HACKLINK= ${TRUEPORTNAME}
DATADIR= ${PREFIX}/${HACKDIR}
DOCSDIR= ${PREFIX}/share/doc/${HACKNAME}
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
.if !defined(PKGNAMESUFFIX)
USES+= xorg
USE_XORG= xaw xpm
GRAPHICS= X11_GRAPHICS
.else
.if ${PKGNAMESUFFIX} == "-nox11"
GRAPHICS= # none
.endif
.endif
OPTIONS_DEFINE= DOCS
.include <bsd.port.pre.mk>
.if !exists(${PREFIX}/bin/${HACKLINK}) && ${HACKNAME} != ${HACKLINK}
PLIST_SUB+= HACKLINK=""
.else
PLIST_SUB+= HACKLINK="@comment "
.endif
pre-everything::
.if defined(WITH_TTY_GRAPHICS) || defined(WITHOUT_X11)
@${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
@${ECHO_MSG} " You cannot install nethack and ${PKGBASE} in parallel "
@${ECHO_MSG} " But ${PKGBASE} reads your prior nethack scores "
@${ECHO_MSG} " Don't forget to backup your nethack libdir if it's "
@${ECHO_MSG} " important for you "
@${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
.else
@${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
@${ECHO_MSG} " You may use the following build options: "
@${ECHO_MSG} " WITH_TTY_GRAPHICS=yes build with no GUI "
@${ECHO_MSG} " WITHOUT_X11=yes same as above "
@${ECHO_MSG} " "
@${ECHO_MSG} " By default, nethack port is built with X11 GUI. "
@${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
.endif
post-patch:
@${REINPLACE_CMD} -e \
's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/include/config.h
@${REINPLACE_CMD} -e \
's|<malloc.h>|<stdlib.h>|g' ${WRKSRC}/win/Qt/qt_win.cpp
.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
do-configure:
@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} ${STAGEDIR}${PREFIX}/bin/${HACKLINK}
.endif
@cd ${WRKSRC}/doc; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} manpages
@${MKDIR} ${STAGEDIR}${DATADIR}/save
# Make "sample" files from records to prevent them being removed
# if they have been altered
@${CP} ${STAGEDIR}/${DATADIR}/logfile ${STAGEDIR}/${DATADIR}/logfile.sample
@${CP} ${STAGEDIR}/${DATADIR}/record ${STAGEDIR}/${DATADIR}/record.sample
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/Guidebook.txt ${STAGEDIR}${DOCSDIR}
.endif
.include <bsd.port.post.mk>