1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-22 00:35:15 +00:00
freebsd-ports/games/nethack33/Makefile
Greg Lewis 3c9859b76f . Make PORTNAME nethack33 rather than using nethack and relying on
LATEST_LINK to provide differentiation.  This makes the package name
  unique.
. Minor portlint petting.

Requested by:	bapt@
2013-11-30 04:42:23 +00:00

111 lines
3.4 KiB
Makefile

# Created by: asami
# $FreeBSD$
PORTNAME= nethack33
PORTVERSION= 3.3.1
PORTREVISION= 10
CATEGORIES?= games
MASTER_SITES= SF
DISTNAME= ${TRUEPORTNAME}-${PORTVERSION:S/.//g}
EXTRACT_SUFX= .tgz
MAINTAINER= glewis@FreeBSD.org
COMMENT= A dungeon explorin', slashin', hackin' game
WRKSRC= ${WRKDIR}/${TRUEPORTNAME}-${PORTVERSION}
LATEST_LINK= ${TRUEPORTNAME}33${PKGNAMESUFFIX}
USE_GMAKE= yes
MAKE_ENV= GRAPHICS="${GRAPHICS}"
PLIST_SUB= HACKNAME="${HACKNAME}" \
HACKEXT="${HACKEXT}"
MAKE_JOBS_UNSAFE= yes
TRUEPORTNAME= nethack
MAN6= dgn_comp${HACKEXT}.6 dlb${HACKEXT}.6 lev_comp${HACKEXT}.6 \
${HACKNAME}.6 recover${HACKEXT}.6
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)
USE_XORG= xaw xpm
GRAPHICS= X11_GRAPHICS
.else
.if ${PKGNAMESUFFIX} == "-nox11"
GRAPHICS= # none
.endif
.endif
NO_STAGE= yes
.include <bsd.port.pre.mk>
.include <bsd.port.options.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} read 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
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 ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/Guidebook.txt ${DOCSDIR}
.endif
.include <bsd.port.post.mk>