freebsd-ports/comms/ncid/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

142 lines
5.7 KiB
Makefile

PORTNAME= ncid
PORTVERSION= 1.11
CATEGORIES= comms
MASTER_SITES= SF
DISTNAME= ${PORTNAME}-${PORTVERSION}-src
MAINTAINER= ports@FreeBSD.org
COMMENT= Network based Caller ID package
WWW= http://ncid.sourceforge.net/
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/doc/GPL.md
BUILD_DEPENDS= ${RUN_DEPENDS}
LIB_DEPENDS= libpcre.so:devel/pcre
RUN_DEPENDS= bash:shells/bash
USES= compiler:c11 gmake perl5 tk shebangfix
USE_GCC= yes
SHEBANG_FILES= client/ncid.sh \
desktop/xml \
doc/mk* \
extensions/*.sh \
gateway/*.pl gateway/*.sh \
logrotate/*.sh \
man/mk-pdf \
modules/*.sh \
setup/*.sh \
tools/*.pl tools/*.sh
ALL_TARGET= local
MAKE_ARGS= WISH=${WISH} TCLSH=${TCLSH} \
CC=${CC} HOSTCC=${CC} AR=${AR}
INSTALL_TARGET= freebsd-install
SUB_FILES= pkg-message
OPTIONS_DEFINE= DOCS LOGROTATE
OPTIONS_SUB= yes
LOGROTATE_DESC= Install logrotate scripts
LOGROTATE_RUN_DEPENDS= logrotate:sysutils/logrotate
WRKSRC= ${WRKDIR}/${PORTNAME}
post-extract:
@cd ${WRKSRC}/FreeBSD;for i in *.rc; do \
x=`echo $$i | cut -f 1 -d .`; ${CP} $$i $$x; done
.include <bsd.port.pre.mk>
post-patch:
@${GREP} -lr 'etc/ncid' ${WRKSRC}/ | ${XARGS} ${REINPLACE_CMD} -Ee \
's,(/usr/local/etc/ncid | /etc/ncid),${ETCDIR},g'
@${FIND} ${WRKSRC}/ -name Makefile | ${XARGS} ${REINPLACE_CMD} -Ee \
'/install:/s,install-(etc|logrotate),,'
@${REINPLACE_CMD} -Ee '/mkdir.*(INIT|ROTATE|BIN|LOG|ETC)/d ;\
/CFLAGS.*=/s|=|+=|' ${WRKSRC}/Makefile
# Respect PREFIX/MANPREFIX/DATADIR
@${REINPLACE_CMD} -e 's|prefix.*= /usr/local|prefix=$${PREFIX}|g' \
-e 's|$$(prefix)/bin|$${PREFIX}/bin|g' \
-e 's|$$(prefix)/sbin|$${PREFIX}/sbin|g' \
-e 's|$$(prefix)/share|$${PREFIX}/share|g' \
-e 's|$$(SHARE)/man|$${MANPREFIX}/man/|g' \
-e 's|$$(SHARE)/ncid|$${DATADIR}|g' ${WRKSRC}/Makefile
.if ${CHOSEN_COMPILER_TYPE} == gcc
@${REINPLACE_CMD} -e 's|-Wno-stringop-truncation||g' \
${WRKSRC}/Makefile ${WRKSRC}/server/Makefile
.endif
do-install:
@${MKDIR} ${STAGEDIR}${ETCDIR}
${INSTALL_PROGRAM} ${WRKSRC}/server/ncidd ${STAGEDIR}${PREFIX}/sbin
${INSTALL_PROGRAM} ${WRKSRC}/gateway/ncid2ncid ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/gateway/sip2ncid ${STAGEDIR}${PREFIX}/sbin
${INSTALL_SCRIPT} ${WRKSRC}/client/ncid ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/client/ncid.conf ${STAGEDIR}${ETCDIR}/ncid.conf.sample
${INSTALL_DATA} ${WRKSRC}/gateway/ncid2ncid.conf ${STAGEDIR}${ETCDIR}/ncid2ncid.conf.sample
${INSTALL_DATA} ${WRKSRC}/gateway/sip2ncid.conf ${STAGEDIR}${ETCDIR}/sip2ncid.conf.sample
.for d in ncidd.alias ncidd.conf ncidd.blacklist ncidd.whitelist
${INSTALL_DATA} ${WRKSRC}/server/${d} ${STAGEDIR}${ETCDIR}/${d}.sample
.endfor
.for e in hangup-calls hangup-fakenum hangup-fcc hangup-nohangup \
hangup-closed-skel hangup-combo-skel hangup-message-skel hangup-skel
@${MKDIR} ${STAGEDIR}${PREFIX}/share/ncid/extensions
${INSTALL_SCRIPT} ${WRKSRC}/extensions/${e} ${STAGEDIR}${PREFIX}/share/ncid/extensions
.endfor
# ncid2ncid and sip2ncid are installed and stripped before this loop with ${INSTALL_PROGRAM}
.for f in email2ncid obi2ncid rn2ncid wc2ncid xdmf2ncid yac2ncid
${INSTALL_SCRIPT} ${WRKSRC}/gateway/${f} ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/gateway/${f}.conf ${STAGEDIR}${ETCDIR}/${f}.conf.sample
.endfor
${INSTALL_DATA} ${WRKSRC}/client/ncid.gif ${STAGEDIR}${PREFIX}/share/pixmaps/ncid
@${MKDIR} ${STAGEDIR}${PREFIX}/share/ncid/modules
.for g in ncid-alert ncid-initmodem ncid-kpopup ncid-mysql ncid-mythtv ncid-notify ncid-page \
ncid-samba ncid-skel ncid-speak ncid-wakeup ncid-yac
${INSTALL_SCRIPT} ${WRKSRC}/modules/${g} ${STAGEDIR}${PREFIX}/share/ncid/modules
.endfor
${INSTALL_DATA} ${WRKSRC}/server/ncidd.alias ${STAGEDIR}${ETCDIR}/ncidd.alias.sample
.for h in cidcall cidalias cidupdate wct ncidutil
${INSTALL_SCRIPT} ${WRKSRC}/tools/${h} ${STAGEDIR}${PREFIX}/bin
.endfor
.for i in ncid-initmodem ncid-mysql ncid-mythtv ncid-notify ncid-page ncid-samba ncid-speak ncid-yac \
ncid2ncid ncidd obi2ncid rn2ncid sip2ncid wc2ncid xdmf2ncid yac2ncid
${INSTALL_DATA} ${WRKSRC}/FreeBSD/${i} ${STAGEDIR}${PREFIX}/etc/rc.d
.endfor
.for j in CallingDeposit.rmd CannotBeCompleted.rmd DisconnectedNotInService.rmd NotInService.rmd
@${MKDIR} ${STAGEDIR}${PREFIX}/share/ncid/recordings
${INSTALL_DATA} ${WRKSRC}/recordings/${j} ${STAGEDIR}${PREFIX}/share/ncid/recordings
.endfor
.for k in ncid-email2ncid-setup ncid-mysql-setup ncid-setup
${INSTALL_SCRIPT} ${WRKSRC}/setup/${k} ${STAGEDIR}${PREFIX}/bin
.endfor
${INSTALL_MAN} ${WRKSRC}/man/*.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/man/*.5 ${STAGEDIR}${MAN5PREFIX}/man/man5
${INSTALL_MAN} ${WRKSRC}/man/*.7 ${STAGEDIR}${MAN7PREFIX}/man/man7
${INSTALL_MAN} ${WRKSRC}/man/*.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
do-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}/recordings
${INSTALL_DATA} ${WRKSRC}/doc/*.md ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/FreeBSD/README-FreeBSD ${STAGEDIR}${DOCSDIR}
.for l in README-recordings CallingDeposit.pvf CannotBeCompleted.pvf DisconnectedNotInService.pvf NotInService.pvf
${INSTALL_DATA} ${WRKSRC}/recordings/${l} ${STAGEDIR}${DOCSDIR}/recordings
.endfor
post-install:
${STRIP_CMD} ${STAGEDIR}${LOCALBASE}/bin/cidupdate
post-install-LOGROTATE-on:
@${MKDIR} ${STAGEDIR}${PREFIX}/share/ncid/sys
${INSTALL_SCRIPT} ${WRKSRC}/tools/ncid-yearlog ${STAGEDIR}${PREFIX}/share/ncid/sys
${INSTALL_SCRIPT} ${WRKSRC}/logrotate/ncidrotate ${STAGEDIR}${PREFIX}/share/ncid/sys
${INSTALL_DATA} ${WRKSRC}/logrotate/ncidrotate.conf ${STAGEDIR}${ETCDIR}/ncidrotate.conf.sample
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/logrotate.d
${INSTALL_DATA} ${WRKSRC}/logrotate/ncid ${STAGEDIR}${PREFIX}/etc/logrotate.d
${INSTALL_MAN} ${WRKSRC}/logrotate/*.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/logrotate/*.5 ${STAGEDIR}${MAN5PREFIX}/man/man5
.include <bsd.port.post.mk>