1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-22 08:58:47 +00:00

Support stage

Use options helpers
Use shebangfix
This commit is contained in:
Baptiste Daroussin 2014-01-05 01:24:29 +00:00
parent 486305ac81
commit b409d35e0c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=338733
2 changed files with 17 additions and 24 deletions

View File

@ -13,10 +13,11 @@ EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= andrewclarkii@gmail.com
COMMENT= TCP/UDP network testing tool
USES= shebangfix
SHEBANG_FILES= ../nuttscp
USE_BZIP2= yes
MAKEFILE= /dev/null
ALL_TARGET= ${PORTNAME}
MAN8= ${PORTNAME}.8
NUTTSCPVERSION= 1.7
NUTTSCPDISTFILE=nuttscp-${NUTTSCPVERSION}
@ -25,45 +26,36 @@ OPTIONS_DEFINE= NUTTSCP
OPTIONS_DEFAULT= NUTTSCP
NUTTSCP_DESC= Install script for copying files over nuttcp
OPTIONS_SUB= yes
NUTTSCP_USES= perl5
NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MNUTTSCP}
USES+= perl5
PLIST_SUB+= NUTTSCP=""
.else
PLIST_SUB+= NUTTSCP="@comment "
.endif
post-extract:
@${CP} ${DISTDIR}/${DIST_SUBDIR}/${NUTTSCPDISTFILE} ${WRKDIR}/nuttscp
.include <bsd.port.pre.mk>
post-extract: .SILENT
${CP} ${DISTDIR}/${DIST_SUBDIR}/${NUTTSCPDISTFILE} ${WRKDIR}/nuttscp
post-patch: .SILENT
post-patch:
${FIND} ${WRKSRC}/ -type f -exec \
${REINPLACE_CMD} 's|/usr/local|${PREFIX}|g' {} +
${REINPLACE_CMD} 's|/usr/bin/perl|${PERL}|g' ${WRKDIR}/nuttscp
do-install:
. if ${PORT_OPTIONS:MNUTTSCP}
${INSTALL_SCRIPT} ${WRKDIR}/nuttscp ${PREFIX}/bin/
( cd ${PREFIX}/bin; ${LN} -sf nuttscp nuttrcp )
${INSTALL_SCRIPT} ${WRKDIR}/nuttscp ${STAGEDIR}${PREFIX}/bin/
( cd ${STAGEDIR}${PREFIX}/bin; ${LN} -sf nuttscp nuttrcp )
. endif
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/
${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${MAN8PREFIX}/man/man8/
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${MAN8PREFIX}/man/man8/
${MKDIR} ${DATADIR}/
${MKDIR} ${STAGEDIR}${DATADIR}/
. for file in LICENSE README examples.txt
${INSTALL_DATA} ${WRKSRC}/${file} ${DATADIR}/
${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DATADIR}/
. endfor
${MKDIR} ${PREFIX}/etc/xinetd.d/
${MKDIR} ${STAGEDIR}${PREFIX}/etc/xinetd.d/
. for file in ${PORTNAME} ${PORTNAME}4 ${PORTNAME}6
${INSTALL_DATA} ${WRKSRC}/xinetd.d/${file} \
${PREFIX}/etc/xinetd.d/
${STAGEDIR}${PREFIX}/etc/xinetd.d/
. endfor
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -7,5 +7,6 @@ bin/nuttcp
etc/xinetd.d/nuttcp
etc/xinetd.d/nuttcp4
etc/xinetd.d/nuttcp6
man/man8/nuttcp.8.gz
@dirrm %%DATADIR%%
@dirrmtry etc/xinetd.d