net/echoping: keep up with changes

echping does not exist at SourceForge anymore.
Use distfile from Github and deal with differences:

- new distfile has no configure scripts but configure.ac
and requires generation of configure, but modern autoreconf
cannot handle its configure.ac files properly so they need
some polishing with pre-configure target to be useful;

- broad usage of HTTP Strict Transport Security
requires new patch fixing echoping's HTTP "accept_redirects" mode,
so this echoping does not fail in this mode on HTTP redirects;

- pet portlint;
- bump PORTREVISION.
This commit is contained in:
Eugene Grosbein
2019-06-04 19:07:18 +00:00
parent 8f4d9c329f
commit 24255cb18b
3 changed files with 29 additions and 7 deletions

View File

@@ -3,9 +3,8 @@
PORTNAME= echoping
PORTVERSION= 6.0.2
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= net ipv6
MASTER_SITES= SF
MAINTAINER= ports@FreeBSD.org
COMMENT= Ping-like program that uses TCP and/or HTTP
@@ -16,7 +15,8 @@ LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libpopt.so:devel/popt \
libidn.so:dns/libidn
USES= cpe libtool ssl
USES= autoreconf cpe libtool ssl
CPE_VENDOR= echoping_project
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-http --enable-icp --enable-smtp --with-ssl \
@@ -26,6 +26,12 @@ INSTALL_TARGET= install-strip
PING_PLUGINS= dns random whois
USE_GITHUB= yes
GH_ACCOUNT= bortzmeyer
GH_PROJECT= ${PORTNAME}
GH_TAGNAME= dfe95b5
WRKSRC= ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}/SRC
OPTIONS_DEFINE= LDAP PGSQL
OPTIONS_DEFAULT=LDAP
OPTIONS_SUB= yes
@@ -36,7 +42,11 @@ LDAP_VARS= PING_PLUGINS+=ldap
PGSQL_USES= pgsql
PGSQL_VARS= PING_PLUGINS+=postgresql
post-patch:
@${REINPLACE_CMD} '/^echoping_LDADD =/s/$$/ -lm/' ${WRKSRC}/Makefile.in
pre-configure:
${FIND} ${WRKSRC} -name configure.ac -execdir ${SH} -c '\
${CAT} ${WRKSRC}/configure-common.ac > configure.ac.tmp && \
${SED} '/configure-common\.ac/d' configure.ac >> configure.ac.tmp && \
${MV} configure.ac.tmp configure.ac' \;
${REINPLACE_CMD} '/^echoping_LDADD =/s/$$/ -lm/' ${WRKSRC}/Makefile.am
.include <bsd.port.mk>

View File

@@ -1,2 +1,3 @@
SHA256 (echoping-6.0.2.tar.gz) = 1dfa4c45bf461b2379ff91773ed7136176e2abac9e85c26bc9654942b5155eac
SIZE (echoping-6.0.2.tar.gz) = 1660983
TIMESTAMP = 1559666517
SHA256 (bortzmeyer-echoping-6.0.2-dfe95b5_GH0.tar.gz) = 712ec52f47281aac8e6121fa4e261df22360112221eb3615f4cfa22fb5efd0ce
SIZE (bortzmeyer-echoping-6.0.2-dfe95b5_GH0.tar.gz) = 130632

View File

@@ -0,0 +1,11 @@
--- http.c.orig 2015-06-03 13:06:16 UTC
+++ http.c
@@ -113,6 +113,8 @@ read_from_server(CHANNEL fs, short ssl,
/* 204 No Content is not an error, message body is empty by definition, see RFC 2616 */
if (reply_code == 204)
return 0; /* zero bytes is correct */
+ if (accept_redirects && reply_code >= 300 && reply_code < 400)
+ return 0;
if (! (reply_code >= 200 && reply_code < 300) &&
! ((reply_code >= 300 && reply_code < 400) && accept_redirects))