git: f11d9efc95a6 - main - www/gatling: Update version 0.15=>0.16

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Tue, 21 Mar 2023 14:10:43 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f11d9efc95a60cb990409f0ff25f51193c2d1d8a

commit f11d9efc95a60cb990409f0ff25f51193c2d1d8a
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-03-21 14:07:36 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-03-21 14:10:35 +0000

    www/gatling: Update version 0.15=>0.16
    
    - Update MASTER_SITES to https scheme
    - UNBREAK
    - Remove DEPRECATION
    - Utilize USES=localbase:lkdflags and refactor
    - Refactor ambiguous VARS like `bin` asnd `sbin`
    - Refactor make makepatch compatible patches
    - While I(bofh) am here pet portclippy/portfmt/OPTIONSNG
    
    PR:             253763
---
 www/gatling/Makefile                | 118 +++++++++++++++++-------------------
 www/gatling/distinfo                |   6 +-
 www/gatling/files/patch-GNUmakefile |  32 ++++++----
 www/gatling/files/patch-dl.c        |   6 +-
 www/gatling/files/patch-gatling.c   |   6 +-
 www/gatling/files/patch-smb.c       |   6 +-
 6 files changed, 87 insertions(+), 87 deletions(-)

diff --git a/www/gatling/Makefile b/www/gatling/Makefile
index 563d4afe692c..fbc06f22330f 100644
--- a/www/gatling/Makefile
+++ b/www/gatling/Makefile
@@ -1,8 +1,7 @@
 PORTNAME=	gatling
-PORTVERSION=	0.15
-PORTREVISION=	2
+PORTVERSION=	0.16
 CATEGORIES=	www benchmarks ftp
-MASTER_SITES=	http://www.fefe.de/gatling/
+MASTER_SITES=	https://www.fefe.de/gatling/
 
 MAINTAINER=	coco@executive-computing.de
 COMMENT=	High performance webserver with scalability benchmark tools
@@ -10,82 +9,75 @@ WWW=		https://www.fefe.de/gatling/
 
 LICENSE=	GPLv2
 
-BROKEN=		Outdated and doesn't compile "ld: error: duplicate symbol: first_deferred"
 BROKEN_mips=	fails to compile: dirfd.c: error: expected ';', ',' or ')' before 'key'
 BROKEN_mips64=	fails to compile: dirfd.c: error: expected ';', ',' or ')' before 'key'
-DEPRECATED=	Broken since 2021
-EXPIRATION_DATE=	2023-03-21
 
-BUILD_DEPENDS=	libowfat>=0.31:devel/libowfat
+BUILD_DEPENDS=	libowfat>=0.32:devel/libowfat
 
-USES=		compiler:c++11-lang gmake ssl tar:xz
+USES=		compiler:c++11-lang gmake localbase:ldflags ssl tar:xz
 USE_RC_SUBR=	gatling
 
-CFLAGS+=	-I${LOCALBASE}/include/libowfat -I${OPENSSLINC} -I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -L${OPENSSLLIB}
-
 MAKEFILE=	GNUmakefile
 
-bin=		dl
-sbin=		gatling
-GATLING8=	gatling.8
-PLIST_FILES=	man/man8/gatling.8.gz
+CFLAGS+=	-I${LOCALBASE}/include/libowfat -I${OPENSSLINC}
+# Make alloca() prototype visible
+CFLAGS+=	-D__BSD_VISIBLE
+# Make crypt() prototype visible
+CFLAGS+=	-D__XSI_VISIBLE
+LDFLAGS+=	-L${OPENSSLLIB}
+
+PLIST_FILES=	${PLIST_BIN:S,^,bin/,} \
+		${PLIST_SBIN:S,^,sbin/,} \
+		man/man8/gatling.8.gz \
+		sbin/gatling_wrapper
+
 PORTDOCS=	CHANGES README README.antidos README.cgi README.ftp \
-		README.htaccess \
-		README.http README.performance README.prefetch README.proxy \
-		README.redirect
-PORTEXAMPLES=	run-gatling cgi acc getlinks hcat hitprofile matchiprange \
-		referrer
-
-OPTIONS_DEFINE=	BENCHMARKS SMB TLS ZLIB OPTIMIZED_CFLAGS DOCS EXAMPLES DEBUG
-OPTIONS_SUB=	yes
-OPTIONS_DEFAULT=	BENCHMARKS SMB TLS ZLIB OPTIMIZED_CFLAGS
+		README.htaccess README.http README.performance README.prefetch \
+		README.proxy README.redirect
+PORTEXAMPLES=	acc cgi getlinks hcat hitprofile matchiprange referrer \
+		run-gatling
+
+OPTIONS_DEFINE=		BENCHMARKS BROKEN_ITOJUN_V6 DEBUG DOCS EXAMPLES \
+			OPTIMIZED_CFLAGS SMB TLS ZLIB
+OPTIONS_DEFAULT=	BENCHMARKS OPTIMIZED_CFLAGS SMB TLS ZLIB
+OPTIONS_SUB=		yes
+
 BENCHMARKS_DESC=	Install some benchmark programs
+BROKEN_ITOJUN_V6_DESC=	Works around problems binding to IPv4 addresses
 TLS_DESC=		Build and install tlsgatling
 ZLIB_DESC=		Compress outgoing data
 
-.include <bsd.port.pre.mk>
+BENCHMARKS_MAKE_ENV=		BENCHMARKS=1
+BENCHMARKS_PLIST_FILES=		man/man1/bench.1.gz
+BENCHMARKS_PORTDOCS=		README.bindbench README.forkbench \
+				README.httpbench README.manymapbench \
+				README.mmapbench
+BENCHMARKS_PORTEXAMPLES=	prep run-bench
+BENCHMARKS_VARS=		BENCH1=bench.1 \
+		PLIST_BIN+=bindbench forkbench forksbench httpbench ioerr manymapbench mktestdata mmapbench pthreadbench
+# Causes a warning about "KAME madness" but works around
+# gatling failing to bind to IPv4 addresses.
+BROKEN_ITOJUN_V6_CFLAGS=	-D__broken_itojun_v6__
+DEBUG_MAKE_ENV=			DEBUG=1
+DEBUG_VARS=			STRIP=
+SMB_USES=			iconv
+SMB_MAKE_ENV=			ICONV=1
+SMB_EXTRA_PATCHES_OFF=		${PATCHDIR}/extra-patch-disable_smb
+TLS_MAKE_ENV=			TLSGATLING=1
+TLS_PORTDOCS=			README.tls
+TLS_VARS=			PLIST_SBIN+=tlsgatling
+ZLIB_MAKE_ENV=			ZLIB=1
+
+PLIST_BIN=	dl
+PLIST_SBIN=	gatling
+GATLING8=	gatling.8
 
-.if ${PORT_OPTIONS:MBENCHMARKS}
-PORTDOCS+=	README.bindbench README.forkbench README.httpbench \
-		README.manymapbench README.mmapbench
-bin+=		bindbench forkbench forksbench httpbench ioerr manymapbench \
-		mktestdata mmapbench pthreadbench
-PORTEXAMPLES+=	prep run-bench
-BENCH1=		bench.1
-PLIST_FILES+=	man/man1/bench.1.gz
-MAKE_ENV+=	BENCHMARKS=1
-.endif
+.include <bsd.port.pre.mk>
 
 .if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS} && !defined(WITH_DEBUG)
 CFLAGS+=	-O2 -fomit-frame-pointer
 .endif
 
-.if ${PORT_OPTIONS:MSMB}
-USES+=		iconv
-CFLAGS+=	-I${LOCALBASE}/include
-MAKE_ENV+=	ICONV=1
-.else
-EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-disable_smb
-.endif
-
-.if ${PORT_OPTIONS:MTLS}
-MAKE_ENV+=	TLSGATLING=1
-sbin+=		tlsgatling
-PORTDOCS+=	README.tls
-.endif
-
-.if ${PORT_OPTIONS:MZLIB}
-MAKE_ENV+=	ZLIB=1
-.endif
-
-.if ${PORT_OPTIONS:MDEBUG}
-MAKE_ENV+=	DEBUG=1
-STRIP=
-.endif
-
-PLIST_FILES+=	${bin:S,^,bin/,} ${sbin:S,^,sbin/,} sbin/gatling_wrapper
-
 post-patch:
 	${REINPLACE_CMD} -e 's/\(trymd5.c\) \(-lcrypto\)/\1 $$(LDFLAGS) \2/'	\
 		${WRKSRC}/GNUmakefile
@@ -94,8 +86,8 @@ pre-install:
 	cd ${WRKSRC} && ${CP} gatling.1 gatling.8
 
 do-install:
-	cd ${WRKSRC} && ${INSTALL_PROGRAM} ${bin} ${STAGEDIR}${PREFIX}/bin
-	cd ${WRKSRC} && ${INSTALL_PROGRAM} ${sbin} ${STAGEDIR}${PREFIX}/sbin
+	cd ${WRKSRC} && ${INSTALL_PROGRAM} ${PLIST_BIN} ${STAGEDIR}${PREFIX}/bin
+	cd ${WRKSRC} && ${INSTALL_PROGRAM} ${PLIST_SBIN} ${STAGEDIR}${PREFIX}/sbin
 	${INSTALL_SCRIPT} ${FILESDIR}/gatling_wrapper ${STAGEDIR}${PREFIX}/sbin
 	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
 	cd ${WRKSRC} && ${INSTALL_SCRIPT} ${PORTEXAMPLES} ${STAGEDIR}${EXAMPLESDIR}
@@ -103,6 +95,8 @@ do-install:
 	cd ${WRKSRC} && ${INSTALL_MAN} ${BENCH1} ${STAGEDIR}${MAN1PREFIX}/man/man1
 .endif
 	cd ${WRKSRC} && ${INSTALL_MAN} ${GATLING8} ${STAGEDIR}${MAN8PREFIX}/man/man8
+
+do-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
 
diff --git a/www/gatling/distinfo b/www/gatling/distinfo
index 35ee959b389e..061ca31df1a6 100644
--- a/www/gatling/distinfo
+++ b/www/gatling/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1487014927
-SHA256 (gatling-0.15.tar.xz) = 6fa329d0ced0c80deb8dde5460e9d9e984bee94f265043d7fdec0e253dce9aa4
-SIZE (gatling-0.15.tar.xz) = 121804
+TIMESTAMP = 1613797941
+SHA256 (gatling-0.16.tar.xz) = 5f96438ee201d7f1f6c2e0849ff273b196bdc7493f29a719ce8ed08c8be6365b
+SIZE (gatling-0.16.tar.xz) = 126844
diff --git a/www/gatling/files/patch-GNUmakefile b/www/gatling/files/patch-GNUmakefile
index 53fb9adfbdb3..e5c9647a07a7 100644
--- a/www/gatling/files/patch-GNUmakefile
+++ b/www/gatling/files/patch-GNUmakefile
@@ -1,8 +1,8 @@
---- /tmp/GNUmakefile	2017-02-13 11:43:57.882750000 -0800
-+++ GNUmakefile	2017-02-13 11:56:19.109139000 -0800
-@@ -1,24 +1,22 @@
--#DEBUG=1
--ZLIB=1
+--- GNUmakefile.orig	2020-05-13 13:53:27 UTC
++++ GNUmakefile
+@@ -1,13 +1,19 @@ ZLIB=1
+ #DEBUG=1
+ ZLIB=1
 -prefix=/opt/diet
 +prefix=${PREFIX}
  BINDIR=${prefix}/bin
@@ -10,7 +10,7 @@
  man1dir=$(MANDIR)/man1
  
 -TARGETS=gatling httpbench bindbench dl ioerr bench tlsgatling_nofail \
--pthreadbench cgi ptlsgatling_nofail
+-pthreadbench cgi ptlsgatling_nofail tlsdl_nofail ptlsdl_nofail
 -TARGETS2=mktestdata mmapbench manymapbench forkbench forksbench
 +TARGETS=gatling dl cgi
 +TARGETS2=
@@ -24,18 +24,23 @@
  ALLTARGETS=$(TARGETS) acc hcat referrer hitprofile matchiprange getlinks \
  rellink $(TARGETS2)
  
- all: $(ALLTARGETS)
+@@ -18,15 +24,7 @@ gcc_path = $(foreach dir,$(path),$(wildcard $(dir)/$(C
  
--CROSS=
--#CROSS=i686-mingw32-
+ path = $(subst :, ,$(PATH))
+ gcc_path = $(foreach dir,$(path),$(wildcard $(dir)/$(CROSS)gcc))
+-ifeq ($(strip $(gcc_path)),)
+-CC=$(CROSS)clang
+-else
 -CC=$(CROSS)gcc
+-endif
+ 
 -CFLAGS=-pipe -Wall
 -LDFLAGS=
 -
  #CFLAGS+=-DSTATE_DEBUG -DMOREDEBUG -DDEBUG_EVENTS -DSMDEBUG
  
- path = $(subst :, ,$(PATH))
-@@ -36,15 +34,11 @@
+ diet_path = $(foreach dir,$(path),$(wildcard $(dir)/diet))
+@@ -43,16 +41,12 @@ endif
  # to build without diet libc support, use $ make DIET=
  # see http://www.fefe.de/dietlibc/ for details about the diet libc
  
@@ -49,11 +54,12 @@
 -LDFLAGS+=-s
 -ifneq ($(DIET),)
 -DIET+=-Os
--endif
  endif
+-endif
  
  LDLIBS=-lowfat
-@@ -136,11 +130,13 @@
+ 
+@@ -159,11 +153,13 @@ libiconv: tryiconv.c
  	rm -f trysocket
  
  libiconv: tryiconv.c
diff --git a/www/gatling/files/patch-dl.c b/www/gatling/files/patch-dl.c
index 100ac22daea5..1439d3921b45 100644
--- a/www/gatling/files/patch-dl.c
+++ b/www/gatling/files/patch-dl.c
@@ -1,9 +1,9 @@
---- dl.c.orig	2014-08-12 18:52:40.000000000 +0200
-+++ dl.c	2014-08-12 18:55:42.000000000 +0200
+--- dl.c.orig	2020-11-26 15:36:13 UTC
++++ dl.c
 @@ -1,3 +1,6 @@
 +#ifdef __FreeBSD__
 +#include <stdio.h>
 +#endif
  #define _FILE_OFFSET_BITS 64
  #define _GNU_SOURCE
- #include "socket.h"
+ 
diff --git a/www/gatling/files/patch-gatling.c b/www/gatling/files/patch-gatling.c
index 1242eacdf18f..145cb570709a 100644
--- a/www/gatling/files/patch-gatling.c
+++ b/www/gatling/files/patch-gatling.c
@@ -1,6 +1,6 @@
---- gatling.c.orig	2014-08-12 18:41:26.000000000 +0200
-+++ gatling.c	2014-08-12 18:42:24.000000000 +0200
-@@ -1736,7 +1736,7 @@
+--- gatling.c.orig	2020-04-07 13:25:34 UTC
++++ gatling.c
+@@ -1950,7 +1950,7 @@ usage:
      Y=sizeof(workgroup_utf16);
      x=workgroup;
      y=workgroup_utf16;
diff --git a/www/gatling/files/patch-smb.c b/www/gatling/files/patch-smb.c
index 0e298fab286b..9bbdea333544 100644
--- a/www/gatling/files/patch-smb.c
+++ b/www/gatling/files/patch-smb.c
@@ -1,6 +1,6 @@
---- smb.c.orig	2014-08-12 18:48:53.000000000 +0200
-+++ smb.c	2014-08-12 18:49:02.000000000 +0200
-@@ -511,7 +511,11 @@
+--- smb.c.orig	2017-03-13 11:29:29 UTC
++++ smb.c
+@@ -512,7 +512,11 @@ static size_t utf16toutf8(char* dest,size_t dsize,uint
    X=ssize;
    Y=dsize?dsize-1:dsize;	// the -1 makes sure we have a 0 byte at the end
    memset(dest,0,dsize);