freebsd-ports/www/amphetadesk/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

114 lines
3.3 KiB
Makefile

PORTNAME= amphetadesk
PORTVERSION= 0.93.1
PORTREVISION= 7
CATEGORIES= www perl5
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-src/${PORTNAME}-src-v${PORTVERSION}
DISTNAME= ${PORTNAME}-src-v${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= RSS client that serves HTTP to your local web browser
WWW= https://www.disobey.com/amphetadesk/index.html
LICENSE= EULA
LICENSE_NAME= The Clarified Artistic License
LICENSE_FILE= ${WRKSRC}/docs/LICENSE
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
RUN_DEPENDS= \
p5-HTML-Parser>=0:www/p5-HTML-Parser \
p5-XML-Parser>=0:textproc/p5-XML-Parser \
p5-HTML-Tagset>=0:www/p5-HTML-Tagset \
p5-libwww>=0:www/p5-libwww \
p5-XML-Simple>=0:textproc/p5-XML-Simple \
p5-Text-Template>=0:textproc/p5-Text-Template \
p5-URI>=0:net/p5-URI
USES= perl5
USE_PERL5= run
USE_RC_SUBR= ${PORTNAME}
NO_BUILD= yes
# Add PERL substitution to SUB_LIST only if there is not already
# one listed
.if !defined(SUB_LIST) || ( defined(SUB_LIST) && !${SUB_LIST:MPERL} )
SUB_LIST+= PERL="${PERL}"
.endif
PORTDOCS= *
OPTIONS_DEFINE= DOCS
.include <bsd.port.pre.mk>
post-patch:
@${FIND} ${WRKSRC} -type f -print0 | \
${XARGS} -0 -x -n 10 \
${REINPLACE_CMD} -E \
-e 's|([[:space:]]+)(AmphetaDesk)|\1AmphetaDesk::\2|g' \
-e 's|([[:space:]]*)(Text::Template)|\1AmphetaDesk::\2|g' \
-e 's|([[:space:]]*)(XML::Simple)|\1AmphetaDesk::\2|g' \
-e 's|^.*use[[:space:]]*FindBin.*$$||' \
-e "s|\([\$$]Bin|\(\$$ENV{'DIRNAME'}|g"
@${REINPLACE_CMD} -E \
-e 's|%%DATADIR%%|${DATADIR}|' \
-e 's|%%DOCSDIR%%|${DOCSDIR}|' \
${WRKSRC}/lib/AmphetaDesk/Settings.pm
post-configure:
@${REINPLACE_CMD} -E \
-e 's|^.*/usr/bin/perl.*$$||' \
${WRKSRC}/AmphetaDesk.pl
@${SED} \
-e "s|%%PREFIX%%|${PREFIX}|" \
-e 's|%%DATADIR%%|${DATADIR}|' \
-e "s|%%PERL%%|${PERL}|" \
${FILESDIR}/wrapper.sh > \
${WRKDIR}/wrapper.sh
do-install:
## create site_perl
# dirs
@${MKDIR} ${SITE_PERL:S|${LOCALBASE}|${STAGEDIR}${PREFIX}|}/AmphetaDesk
@(cd ${WRKSRC}/lib && \
${FIND} * -type d ! -empty -print0 | \
${XARGS} -0 -x -n 10 -I {} \
${MKDIR} ${SITE_PERL:S|${LOCALBASE}|${STAGEDIR}${PREFIX}|}/AmphetaDesk/{})
# files
(cd ${WRKSRC}/lib && \
${FIND} * -type f -name "*pm" -print0 | \
${XARGS} -0 -x -n 10 -I {} \
${INSTALL_DATA} {} ${SITE_PERL:S|${LOCALBASE}|${STAGEDIR}${PREFIX}|}/AmphetaDesk/{})
# script
${INSTALL_DATA} ${WRKSRC}/AmphetaDesk.pl \
${STAGEDIR}${PREFIX}/bin/AmphetaDesk-real
${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh \
${STAGEDIR}${PREFIX}/bin/AmphetaDesk
## docs
@${MKDIR} ${STAGEDIR}${DOCSDIR}
.for ext in html txt xml
${INSTALL_DATA} ${WRKSRC}/docs/*.${ext} ${STAGEDIR}${DOCSDIR}
.endfor
@${MKDIR} ${STAGEDIR}${DOCSDIR}/images
.for ext in gif jpg
${INSTALL_DATA} ${WRKSRC}/docs/images/*.${ext} \
${STAGEDIR}${DOCSDIR}/images
.endfor
## lists
@${MKDIR} ${STAGEDIR}${DATADIR}/lists
${INSTALL_DATA} ${WRKSRC}/data/lists/services-channels-recent.xml \
${STAGEDIR}${DATADIR}/lists
## templates
# dirs
(cd ${WRKSRC} && \
${FIND} templates -type d ! -empty -print0 | \
${XARGS} -0 -x -n 10 -I {} \
${MKDIR} ${STAGEDIR}${DATADIR}/{})
# files
.for ext in gif html ico png pict
(cd ${WRKSRC} && \
${FIND} templates -type f -name "*.${ext}" -print0 | \
${XARGS} -0 -x -n 10 -I {} \
${INSTALL_DATA} {} ${STAGEDIR}${DATADIR}/{})
.endfor
.include <bsd.port.post.mk>