From b7123f3276715f758fc40c38f1ae1d1e9f71a6d0 Mon Sep 17 00:00:00 2001 From: Ryan Steinmetz Date: Thu, 22 Aug 2019 17:48:51 +0000 Subject: [PATCH] New port: varnish-libvmod-dynamic This module provides a varnish director for dynamic creation of backends based on calls to the system's network address resolution service which, in turn, typically use information from the /etc/hosts file and the Domain Name Service (DNS), but can be configured to use other sources like LDAP or more advanced DNS resolution where getdns is available. While standard varnish backends defined in VCL may also be defined in terms of host names, changes of the name service information will only be picked up with a VCL reload. WWW: https://github.com/nigoroll/libvmod-dynamic --- www/Makefile | 1 + www/varnish-libvmod-dynamic/Makefile | 38 +++++++++++++++++++ www/varnish-libvmod-dynamic/distinfo | 3 ++ .../files/patch-src_dyn__resolver__getdns.c | 15 ++++++++ www/varnish-libvmod-dynamic/pkg-descr | 11 ++++++ www/varnish-libvmod-dynamic/pkg-plist | 4 ++ 6 files changed, 72 insertions(+) create mode 100644 www/varnish-libvmod-dynamic/Makefile create mode 100644 www/varnish-libvmod-dynamic/distinfo create mode 100644 www/varnish-libvmod-dynamic/files/patch-src_dyn__resolver__getdns.c create mode 100644 www/varnish-libvmod-dynamic/pkg-descr create mode 100644 www/varnish-libvmod-dynamic/pkg-plist diff --git a/www/Makefile b/www/Makefile index ee3e8073f169..04e0aacb5345 100644 --- a/www/Makefile +++ b/www/Makefile @@ -2402,6 +2402,7 @@ SUBDIR += validator SUBDIR += varnish-libvmod-awsrest SUBDIR += varnish-libvmod-digest + SUBDIR += varnish-libvmod-dynamic SUBDIR += varnish-libvmod-maxminddb SUBDIR += varnish-modules SUBDIR += varnish-nagios diff --git a/www/varnish-libvmod-dynamic/Makefile b/www/varnish-libvmod-dynamic/Makefile new file mode 100644 index 000000000000..471181d8a915 --- /dev/null +++ b/www/varnish-libvmod-dynamic/Makefile @@ -0,0 +1,38 @@ +# $FreeBSD$ + +PORTNAME= libvmod-dynamic +PORTVERSION= 20190822 +CATEGORIES= www +PKGNAMEPREFIX= varnish- + +MAINTAINER= zi@FreeBSD.org +COMMENT= Varnish Module (vmod) for dynamic backends + +LICENSE= BSD2CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libgetdns.so:dns/getdns +BUILD_DEPENDS= rst2man:textproc/py-docutils@${PY_FLAVOR} + +USES= autoreconf gmake libtool pkgconfig python:3.5+,build varnish:6 +USE_LDCONFIG= yes + +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --disable-static +INSTALL_TARGET= install-strip +DOCSDIR= ${PREFIX}/share/doc/vmod-dynamic +MAKE_JOBS_UNSAFE= yes + +CFLAGS+= -I${WRKSRC}/src + +USE_GITHUB= yes +GH_ACCOUNT= nigoroll +GH_TAGNAME= 220fd64 + +OPTIONS_DEFINE= DOCS + +post-patch: + ${REINPLACE_CMD} 's|$${VARNISHAPI_DATAROOTDIR}|${LOCALBASE}/share|' \ + ${WRKSRC}/Makefile.am + +.include diff --git a/www/varnish-libvmod-dynamic/distinfo b/www/varnish-libvmod-dynamic/distinfo new file mode 100644 index 000000000000..3c0120a97cf3 --- /dev/null +++ b/www/varnish-libvmod-dynamic/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1566493821 +SHA256 (nigoroll-libvmod-dynamic-20190822-220fd64_GH0.tar.gz) = 072e6c20cef5b8c9074d5c0eb4aaf9ba5f8b6a6b786be88421c18ada5d5d62e4 +SIZE (nigoroll-libvmod-dynamic-20190822-220fd64_GH0.tar.gz) = 40136 diff --git a/www/varnish-libvmod-dynamic/files/patch-src_dyn__resolver__getdns.c b/www/varnish-libvmod-dynamic/files/patch-src_dyn__resolver__getdns.c new file mode 100644 index 000000000000..80e234c3ba5f --- /dev/null +++ b/www/varnish-libvmod-dynamic/files/patch-src_dyn__resolver__getdns.c @@ -0,0 +1,15 @@ +--- src/dyn_resolver_getdns.c.orig 2019-08-22 17:20:58 UTC ++++ src/dyn_resolver_getdns.c +@@ -33,6 +33,12 @@ + #include + #include + ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#endif ++ + #include + #include + diff --git a/www/varnish-libvmod-dynamic/pkg-descr b/www/varnish-libvmod-dynamic/pkg-descr new file mode 100644 index 000000000000..c60e45825c27 --- /dev/null +++ b/www/varnish-libvmod-dynamic/pkg-descr @@ -0,0 +1,11 @@ +This module provides a varnish director for dynamic creation of backends based +on calls to the system's network address resolution service which, in turn, +typically use information from the /etc/hosts file and the Domain Name Service +(DNS), but can be configured to use other sources like LDAP or more advanced +DNS resolution where getdns is available. + +While standard varnish backends defined in VCL may also be defined in terms of +host names, changes of the name service information will only be picked up +with a VCL reload. + +WWW: https://github.com/nigoroll/libvmod-dynamic diff --git a/www/varnish-libvmod-dynamic/pkg-plist b/www/varnish-libvmod-dynamic/pkg-plist new file mode 100644 index 000000000000..24032a9fe107 --- /dev/null +++ b/www/varnish-libvmod-dynamic/pkg-plist @@ -0,0 +1,4 @@ +lib/varnish/vmods/libvmod_dynamic.so +man/man3/vmod_dynamic.3.gz +%%PORTDOCS%%%%DOCSDIR%%/LICENSE +%%PORTDOCS%%%%DOCSDIR%%/README.rst