Over the past several months portscout.freebsd.org appears to have been
more frequently NOT finding updates, particularly for ports that use
CHEESESHOP (PyPI) as their MASTER_SITES.
Portscout has also never worked for ports using GitHub for distribution
files due to the following:
a) Portscout, prior to 'guessing', requests a randomly named file
from the Site and expects a 4xx (404) in response. If it doesn't
receive a 4xx response, it increments a 'lie counter' and does not
check the site again in the next run.
b) The GitHUB handlers (SUBDIR/MASTER_SITES) in bsd.sites.mk
construct a URL that ends in a a dummy query paramater (for the
filename), so that fetch saves the correct filename to DISTDIR.
This means for any DISTFILE name provided, a 200 OK response is
returned
These two factors unfortunately leave us in a position where there is no
good way to workaround this in the ports framework, including overriding
DISTFILES, DISTNAME, FETCH_ARGS, or the SUBDIR URL itself for various
reasons (not matching distinfo, file conflicts in DISTDIR, etc)
Fortunately, the portroach project (OpenBSD's fork of portscout)
contains a site handler for GitHub and PyPI (among others) already [1].
These site handlers use API endpoints at GitHub and PyPI that respond
JSON respectively, providing a faster and more accurate way to determine
the latest version of a package, without having to go through the
'guessing' process.
This commit:
- Adds GitHub and PyPI site handlers, and modifies or extends them to
accept/match our MASTER_SITES URL's.
- Adds authenticated API request support and two settings for the
GitHub site handler
- Add p5-JSON to RUN_DEPENDS (needed by new site handlers)
- Add HTTPS option for supporting https:// MASTER_SITES. Currently
portscout does not check (fails) https:// MASTER_SITES [2]
- Take MAINTAINER'ship
- Adds badly needed logging/debugging messages to key parts of the
process retaining the conditional logic that ties the verbosity to
"quiet" or "debug" portscout.conf settings.
- Renables the SQLITE3 option (previously commented out) and renames it
to SQLITE (the standard, as per bsd.options.desk.mk)
- Creates a DATABASE option group allowing either/or SQLITE or
POSTGRESQL to be selected
- Switches option conditionals where possible to options helpers
- Backport a fix for maintainer matching/mapping [3]
- Adds LICENSE (BSD2CLAUSE)
- Updates and sorts pkg-plist
This change was tested again ports maintained by me, and resulted in
'new versions' being found and reported for 42 of my ports (of 123).
[1] https://github.com/jasperla/portroach/tree/master/Portroach/SiteHandler
[2] Reported by: truckman
[3] 2f6ee134dd
PR: 203996
Approved by: maintainer (timeout, 15 days)
Differential Revision: https://reviews.freebsd.org/D3996
117 lines
4.2 KiB
Makefile
117 lines
4.2 KiB
Makefile
# Created by: Shaun Amott <shaun@inerd.com>
|
|
# $FreeBSD$
|
|
|
|
PORTNAME= portscout
|
|
PORTVERSION= 0.8.1
|
|
PORTREVISION= 4
|
|
CATEGORIES= ports-mgmt
|
|
MASTER_SITES= http://mirror.inerd.com/FreeBSD/distfiles/${PORTNAME}/ \
|
|
http://www.atarininja.org/~wxs/distfiles/ \
|
|
http://www.inerd.com/software/${PORTNAME}/
|
|
|
|
MAINTAINER= koobs@FreeBSD.org
|
|
COMMENT= Tool to scan for new versions of FreeBSD ports
|
|
|
|
LICENSE= BSD2CLAUSE
|
|
|
|
RUN_DEPENDS= p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \
|
|
p5-Proc-Queue>=0:${PORTSDIR}/devel/p5-Proc-Queue \
|
|
p5-Net>=0:${PORTSDIR}/net/p5-Net \
|
|
p5-URI>=0:${PORTSDIR}/net/p5-URI \
|
|
p5-XML-XPath>=0:${PORTSDIR}/textproc/p5-XML-XPath \
|
|
p5-MIME-Lite>=0:${PORTSDIR}/mail/p5-MIME-Lite \
|
|
p5-libwww>=0:${PORTSDIR}/www/p5-libwww \
|
|
p5-JSON>0:${PORTSDIR}/converters/p5-JSON
|
|
|
|
OPTIONS_DEFINE= DOCS HTTPS
|
|
OPTIONS_DEFAULT= HTTPS PGSQL
|
|
|
|
OPTIONS_MULTI= DATABASE
|
|
OPTIONS_MULTI_DATABASE= SQLITE PGSQL
|
|
|
|
DATABASE_DESC= Database Backends
|
|
USES= perl5 shebangfix
|
|
|
|
NO_BUILD= yes
|
|
SHEBANG_FILES= ${WRKSRC}/portscout.pl
|
|
|
|
PORTDOCS= UPDATING portscout-portconfig.txt xml-datasrc-example.xml
|
|
|
|
HTTPS_RUN_DEPENDS= p5-LWP-Protocol-https>=0:${PORTSDIR}/www/p5-LWP-Protocol-https
|
|
|
|
SQLITE_USE= SQLITE=3
|
|
SQLITE_RUN_DEPENDS= p5-DBD-SQLite>=0:${PORTSDIR}/databases/p5-DBD-SQLite
|
|
|
|
PGSQL_USES= pgsql
|
|
PGSQL_RUN_DEPENDS= p5-DBD-Pg>=0:${PORTSDIR}/databases/p5-DBD-Pg
|
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
pre-everything::
|
|
.if ${PORT_OPTIONS:MSQLITE}
|
|
@${ECHO_MSG} "+-------------------------------------------------------------+"
|
|
@${ECHO_MSG} "| Warning! although SQLite is supported, portscout will only |"
|
|
@${ECHO_MSG} "| operate in non-forking mode with this database backend. It |"
|
|
@${ECHO_MSG} "| is therefore recommended only for use with light workloads. |"
|
|
@${ECHO_MSG} "+-------------------------------------------------------------+"
|
|
.endif
|
|
|
|
post-extract:
|
|
@${CP} ${FILESDIR}/files-Portscout-SiteHandler-GitHub.pm ${WRKSRC}/Portscout/SiteHandler/GitHub.pm
|
|
@${CP} ${FILESDIR}/files-Portscout-SiteHandler-PyPI.pm ${WRKSRC}/Portscout/SiteHandler/PyPI.pm
|
|
|
|
post-patch:
|
|
.if ${PORT_OPTIONS:MSQLITE}
|
|
@${REINPLACE_CMD} 's/^\([^#]*DBI:Pg.*\)$$/#\1/g' ${WRKSRC}/portscout.conf
|
|
@${REINPLACE_CMD} 's/^#\(.*DBI:SQLite.*\)$$/\1/g' ${WRKSRC}/portscout.conf
|
|
.endif
|
|
@${REINPLACE_CMD} -e "s#^\(templates .*\)/etc#\1/share#" \
|
|
-e "s#^prefix\( *= *\).*#prefix\1${PREFIX}#" \
|
|
${WRKSRC}/portscout.conf
|
|
@${REINPLACE_CMD} -e "s#^\(.*PREFIX.*=> *\)'.*'#\1'${PREFIX}'#" \
|
|
${WRKSRC}/Portscout/Const.pm
|
|
@${MV} ${WRKSRC}/docs/*.* ${WRKSRC}
|
|
|
|
do-install:
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/DataSrc
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/SiteHandler
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/SQL
|
|
${INSTALL_SCRIPT} ${WRKSRC}/Portscout/*.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/
|
|
${INSTALL_SCRIPT} ${WRKSRC}/Portscout/DataSrc/*.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/DataSrc/
|
|
${INSTALL_SCRIPT} ${WRKSRC}/Portscout/SiteHandler/*.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/SiteHandler/
|
|
${INSTALL_SCRIPT} ${WRKSRC}/Portscout/SQL/*.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/SQL/
|
|
${INSTALL_SCRIPT} ${WRKSRC}/Portscout.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout.pm
|
|
${INSTALL_SCRIPT} ${WRKSRC}/portscout.pl ${STAGEDIR}${PREFIX}/bin/portscout
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/portscout.pod ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}
|
|
|
|
pod2man ${WRKSRC}/portscout.pod ${WRKSRC}/portscout.1
|
|
${INSTALL_MAN} ${WRKSRC}/portscout.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/
|
|
|
|
@${MKDIR} ${STAGEDIR}${DATADIR}/templates
|
|
cd ${WRKSRC}/templates \
|
|
&& ${INSTALL_DATA} * ${STAGEDIR}${DATADIR}/templates
|
|
|
|
@${MKDIR} ${STAGEDIR}${DATADIR}/sql
|
|
cd ${WRKSRC}/sql && ${INSTALL_DATA} *.sql ${STAGEDIR}${DATADIR}/sql
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/portscout.conf ${STAGEDIR}${PREFIX}/etc/portscout.conf.sample
|
|
|
|
.if ${PORT_OPTIONS:MDOCS}
|
|
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
|
. for f in ${PORTDOCS}
|
|
${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
|
|
. endfor
|
|
.endif
|
|
|
|
test:
|
|
${PERL} ${WRKSRC}/t/00-use.t
|
|
${PERL} ${WRKSRC}/t/01-vercompare.t
|
|
.if ${PORT_OPTIONS:MSQLITE}
|
|
${PERL} ${WRKSRC}/t/10-sqlite.t
|
|
#.else
|
|
# ${PERL} ${WRKSRC}/10-postgresql.t
|
|
.endif
|
|
|
|
.include <bsd.port.mk>
|