git: 41777cde6693 - main - www/varnish-libvmod-redis: New port providing a VCL interface to interact with redis servers

From: Ryan Steinmetz <zi_at_FreeBSD.org>
Date: Fri, 08 Apr 2022 14:46:08 UTC
The branch main has been updated by zi:

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

commit 41777cde6693f26b82effb16bf4ef555dee94f88
Author:     Ryan Steinmetz <zi@FreeBSD.org>
AuthorDate: 2022-04-08 14:46:00 +0000
Commit:     Ryan Steinmetz <zi@FreeBSD.org>
CommitDate: 2022-04-08 14:46:00 +0000

    www/varnish-libvmod-redis: New port providing a VCL interface to interact with redis servers
---
 www/Makefile                                       |  1 +
 www/varnish-libvmod-redis/Makefile                 | 38 ++++++++++++++++++++++
 www/varnish-libvmod-redis/distinfo                 |  3 ++
 www/varnish-libvmod-redis/files/patch-src_core.c   | 12 +++++++
 .../files/patch-src_vmod__redis.c                  | 12 +++++++
 www/varnish-libvmod-redis/pkg-descr                |  3 ++
 www/varnish-libvmod-redis/pkg-plist                |  4 +++
 7 files changed, 73 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 100f4c9af3c0..e20f09bad0a6 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -2305,6 +2305,7 @@
     SUBDIR += varnish-libvmod-dynamic
     SUBDIR += varnish-libvmod-maxminddb
     SUBDIR += varnish-libvmod-querystring
+    SUBDIR += varnish-libvmod-redis
     SUBDIR += varnish-modules
     SUBDIR += varnish-nagios
     SUBDIR += varnish4
diff --git a/www/varnish-libvmod-redis/Makefile b/www/varnish-libvmod-redis/Makefile
new file mode 100644
index 000000000000..9ae7ca4cfe7c
--- /dev/null
+++ b/www/varnish-libvmod-redis/Makefile
@@ -0,0 +1,38 @@
+PORTNAME=	libvmod-redis
+PORTVERSION=	20220118
+CATEGORIES=	www
+PKGNAMEPREFIX=	varnish-
+
+MAINTAINER=	zi@FreeBSD.org
+COMMENT=	Varnish Module (vmod) for redis
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+LIB_DEPENDS=	libev.so:devel/libev \
+		libhiredis.so:databases/hiredis
+BUILD_DEPENDS=	rst2man:textproc/py-docutils@${PY_FLAVOR}
+
+USES=		autoreconf compiler:c11 gmake libtool pkgconfig \
+		python:3.5+,build varnish:7
+USE_LDCONFIG=	yes
+
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--disable-static --disable-tls
+INSTALL_TARGET=	install-strip
+DOCSDIR=	${PREFIX}/share/doc/vmod-redis
+MAKE_JOBS_UNSAFE=	yes
+
+CFLAGS+=	-I${WRKSRC}/src
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	carlosabalde
+GH_TAGNAME=	5e1c20e
+
+OPTIONS_DEFINE=	DOCS
+
+post-patch:
+	${REINPLACE_CMD} 's|$${VARNISHAPI_DATAROOTDIR}|${LOCALBASE}/share|' \
+		${WRKSRC}/Makefile.am
+
+.include <bsd.port.mk>
diff --git a/www/varnish-libvmod-redis/distinfo b/www/varnish-libvmod-redis/distinfo
new file mode 100644
index 000000000000..6333685df8af
--- /dev/null
+++ b/www/varnish-libvmod-redis/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1649271156
+SHA256 (carlosabalde-libvmod-redis-20220118-5e1c20e_GH0.tar.gz) = 2e2896950c2b5c06e30c7b1887cc17e9ad2ff5f473d12fc3c1ce57230e979af9
+SIZE (carlosabalde-libvmod-redis-20220118-5e1c20e_GH0.tar.gz) = 219765
diff --git a/www/varnish-libvmod-redis/files/patch-src_core.c b/www/varnish-libvmod-redis/files/patch-src_core.c
new file mode 100644
index 000000000000..ed75c85a740b
--- /dev/null
+++ b/www/varnish-libvmod-redis/files/patch-src_core.c
@@ -0,0 +1,12 @@
+--- src/core.c.orig	2022-04-06 18:56:08 UTC
++++ src/core.c
+@@ -11,6 +11,9 @@
+ #include <hiredis/hiredis_ssl.h>
+ #endif
+ #include <arpa/inet.h>
++#ifdef __FreeBSD__
++#include <sys/socket.h>
++#endif
+ 
+ #include "cache/cache.h"
+ 
diff --git a/www/varnish-libvmod-redis/files/patch-src_vmod__redis.c b/www/varnish-libvmod-redis/files/patch-src_vmod__redis.c
new file mode 100644
index 000000000000..c43c83d427f2
--- /dev/null
+++ b/www/varnish-libvmod-redis/files/patch-src_vmod__redis.c
@@ -0,0 +1,12 @@
+--- src/vmod_redis.c.orig	2022-04-06 18:57:49 UTC
++++ src/vmod_redis.c
+@@ -10,6 +10,9 @@
+ #include <hiredis/hiredis_ssl.h>
+ #endif
+ #include <arpa/inet.h>
++#ifdef __FreeBSD__
++#include <sys/socket.h>
++#endif
+ 
+ #include "cache/cache.h"
+ #include "vsb.h"
diff --git a/www/varnish-libvmod-redis/pkg-descr b/www/varnish-libvmod-redis/pkg-descr
new file mode 100644
index 000000000000..a81015c03a6e
--- /dev/null
+++ b/www/varnish-libvmod-redis/pkg-descr
@@ -0,0 +1,3 @@
+This module provides an interface to access redis servers, via VCL.
+
+WWW: https://github.com/carlosabalde/libvmod-redis
diff --git a/www/varnish-libvmod-redis/pkg-plist b/www/varnish-libvmod-redis/pkg-plist
new file mode 100644
index 000000000000..f0db16ef6a54
--- /dev/null
+++ b/www/varnish-libvmod-redis/pkg-plist
@@ -0,0 +1,4 @@
+lib/varnish/vmods/libvmod_redis.so
+man/man3/vmod_redis.3.gz
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE
+%%PORTDOCS%%%%DOCSDIR%%/README.rst