RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/varnish-modules#2a9d075e350b7e004a291caeec3c4a0c9c5a9999
This commit is contained in:
Troy Dawson 2020-10-15 13:24:05 -07:00
parent ca8bbddfb2
commit eb3d5292dc
8 changed files with 3709 additions and 0 deletions

5
.gitignore vendored
View File

@ -0,0 +1,5 @@
/varnish-modules-0.12.1.tar.gz
/varnish-modules-0.15.0.tar.gz
/varnish-modules-0032ed8.tar.gz
/varnish-modules-0.16.0.tar.gz
/varnish-modules-4d6593c.tar.gz

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (varnish-modules-4d6593c.tar.gz) = bb118cd844e0519db2dea0b3b4be1f3fda8760e9380537cd1e2a3ef52b2156ed51b608b02a9ce021ec25a405ffa4e5b9bbe811d6c410dab93ff1a4207f694416

View File

@ -0,0 +1,44 @@
--- /dev/null 2019-09-18 14:09:23.308277474 +0200
+++ bootstrap 2019-09-24 09:55:24.218322744 +0200
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+warn() {
+ echo "WARNING: $@" 1>&2
+}
+
+case `uname -s` in
+Darwin)
+ LIBTOOLIZE=glibtoolize
+ ;;
+FreeBSD)
+ LIBTOOLIZE=libtoolize
+ ;;
+Linux)
+ LIBTOOLIZE=libtoolize
+ ;;
+SunOS)
+ LIBTOOLIZE=libtoolize
+ ;;
+*)
+ warn "unrecognized platform:" `uname -s`
+ LIBTOOLIZE=libtoolize
+esac
+
+# check for varnishapi.m4 in custom paths
+dataroot=$(pkg-config --variable=datarootdir varnishapi 2>/dev/null)
+if [ -z "$dataroot" ] ; then
+ cat >&2 <<'EOF'
+Package varnishapi was not found in the pkg-config search path.
+Perhaps you should add the directory containing `varnishapi.pc'
+to the PKG_CONFIG_PATH environment variable
+EOF
+ exit 1
+fi
+set -ex
+mkdir -p m4
+aclocal -I m4 -I ${dataroot}/aclocal
+$LIBTOOLIZE --copy --force
+autoheader
+automake --add-missing --copy --foreign
+autoconf

View File

@ -0,0 +1,44 @@
--- /dev/null 2019-09-28 14:48:27.937320545 +0200
+++ bootstrap 2019-09-29 00:35:05.782099759 +0200
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+warn() {
+ echo "WARNING: $@" 1>&2
+}
+
+case `uname -s` in
+Darwin)
+ LIBTOOLIZE=glibtoolize
+ ;;
+FreeBSD)
+ LIBTOOLIZE=libtoolize
+ ;;
+Linux)
+ LIBTOOLIZE=libtoolize
+ ;;
+SunOS)
+ LIBTOOLIZE=libtoolize
+ ;;
+*)
+ warn "unrecognized platform:" `uname -s`
+ LIBTOOLIZE=libtoolize
+esac
+
+# check for varnishapi.m4 in custom paths
+dataroot=$(pkg-config --variable=datarootdir varnishapi 2>/dev/null)
+if [ -z "$dataroot" ] ; then
+ cat >&2 <<'EOF'
+Package varnishapi was not found in the pkg-config search path.
+Perhaps you should add the directory containing `varnishapi.pc'
+to the PKG_CONFIG_PATH environment variable
+EOF
+ exit 1
+fi
+set -ex
+mkdir -p m4
+aclocal -I m4 -I ${dataroot}/aclocal
+$LIBTOOLIZE --copy --force
+autoheader
+automake --add-missing --copy --foreign
+autoconf

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,268 @@
From 918057c889d850940b0c8d6f2b14dc94d543bae4 Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Wed, 25 Apr 2018 17:02:04 +0200
Subject: [PATCH 1/4] update for master
a11939eb64427847ec11571d328696ba162f8c6a
---
src/vmod_saintmode.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/vmod_saintmode.c b/src/vmod_saintmode.c
index 26191cc..4b4b874 100644
--- a/src/vmod_saintmode.c
+++ b/src/vmod_saintmode.c
@@ -43,6 +43,11 @@
#include "vcc_saintmode_if.h"
+static unsigned
+healthy(const struct director *, const struct busyobj *, double *);
+static const struct director *
+resolve(const struct director *, struct worker *, struct busyobj *);
+
struct trouble {
unsigned magic;
#define TROUBLE_MAGIC 0x4211ab21
@@ -63,6 +68,14 @@ struct vmod_saintmode_saintmode {
VTAILQ_HEAD(, trouble) troublelist;
};
+static const struct director_methods vmod_saintmode_methods[1] = {{
+ .magic = DIRECTOR_METHODS_MAGIC,
+ .type = "saintmode",
+ .healthy = healthy,
+ .resolve = resolve
+}};
+
+
struct saintmode_objs {
unsigned magic;
#define SAINTMODE_OBJS_MAGIC 0x9aa7beec
@@ -269,7 +282,7 @@ healthy(const struct director *dir, const struct busyobj *bo, double *changed)
/* Saintmode is disabled, or list is empty */
if (sm->threshold == 0 || sm->n_trouble == 0)
- return (sm->be->healthy(sm->be, bo, changed));
+ return (sm->be->methods->healthy(sm->be, bo, changed));
if (!bo) {
digest = NULL;
@@ -282,7 +295,7 @@ healthy(const struct director *dir, const struct busyobj *bo, double *changed)
}
retval = is_digest_healthy(dir, digest, t_prev, vsl);
- return (retval ? sm->be->healthy(sm->be, bo, changed) : 0);
+ return (retval ? sm->be->methods->healthy(sm->be, bo, changed) : 0);
}
VCL_BOOL
@@ -343,13 +356,11 @@ vmod_saintmode__init(VRT_CTX, struct vmod_saintmode_saintmode **smp,
VTAILQ_INIT(&sm->troublelist);
sm->sdir->magic = DIRECTOR_MAGIC;
- sm->sdir->resolve = resolve;
- sm->sdir->healthy = healthy;
+ sm->sdir->methods = vmod_saintmode_methods;
#ifdef HAVE_DIRECTOR_ADMIN_HEALTH
sm->sdir->admin_health = VDI_AH_HEALTHY;
#endif
REPLACE(sm->sdir->vcl_name, vcl_name);
- sm->sdir->name = "saintmode";
sm->sdir->priv = sm;
if (!priv->priv) {
From 2141fd9d37f435b4875c07c8fcc3fb1ea5968d74 Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Thu, 26 Apr 2018 14:50:30 +0200
Subject: [PATCH 2/4] Output the health state as baseline information
---
src/tests/saintmode/test02.vtc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/tests/saintmode/test02.vtc b/src/tests/saintmode/test02.vtc
index aa97734..bd8b537 100644
--- a/src/tests/saintmode/test02.vtc
+++ b/src/tests/saintmode/test02.vtc
@@ -51,6 +51,8 @@ varnish v1 -vcl+backend {
} -start
+varnish v1 -cliok "backend.list"
+
client c1 {
txreq -url "/a"
rxresp
From 1e704bfd7d8aa8b1e20d918788f0c7c65488713e Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Thu, 26 Apr 2018 14:50:49 +0200
Subject: [PATCH 3/4] changes required for latest varnish-cache
The director API has changed and, in particular, the director healthy
callback is now only queried for AH_PROBE.
---
src/vmod_saintmode.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/vmod_saintmode.c b/src/vmod_saintmode.c
index 4b4b874..95de050 100644
--- a/src/vmod_saintmode.c
+++ b/src/vmod_saintmode.c
@@ -43,10 +43,10 @@
#include "vcc_saintmode_if.h"
-static unsigned
-healthy(const struct director *, const struct busyobj *, double *);
-static const struct director *
-resolve(const struct director *, struct worker *, struct busyobj *);
+static VCL_BOOL v_matchproto_(vdi_healthy_f)
+healthy(VRT_CTX, VCL_BACKEND, VCL_TIME *);
+static VCL_BACKEND v_matchproto_(vdi_resolve_f)
+resolve(VRT_CTX, VCL_BACKEND);
struct trouble {
unsigned magic;
@@ -266,23 +266,26 @@ is_digest_healthy(const struct director *dir,
}
/* All adapted from PHK's saintmode implementation in Varnish 3.0 */
-static unsigned
-healthy(const struct director *dir, const struct busyobj *bo, double *changed)
+static VCL_BOOL v_matchproto_(vdi_healthy_f)
+healthy(VRT_CTX, VCL_BACKEND dir, VCL_TIME *changed)
{
struct vmod_saintmode_saintmode *sm;
+ const struct busyobj *bo;
unsigned retval;
const uint8_t* digest;
double t_prev;
struct vsl_log* vsl;
+ CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(dir, DIRECTOR_MAGIC);
CAST_OBJ_NOTNULL(sm, dir->priv, VMOD_SAINTMODE_MAGIC);
CHECK_OBJ_NOTNULL(sm->be, DIRECTOR_MAGIC);
+ bo = ctx->bo;
CHECK_OBJ_ORNULL(bo, BUSYOBJ_MAGIC);
/* Saintmode is disabled, or list is empty */
if (sm->threshold == 0 || sm->n_trouble == 0)
- return (sm->be->methods->healthy(sm->be, bo, changed));
+ return (VRT_Healthy(ctx, sm->be, changed));
if (!bo) {
digest = NULL;
@@ -295,7 +298,7 @@ healthy(const struct director *dir, const struct busyobj *bo, double *changed)
}
retval = is_digest_healthy(dir, digest, t_prev, vsl);
- return (retval ? sm->be->methods->healthy(sm->be, bo, changed) : 0);
+ return (retval ? VRT_Healthy(ctx, sm->be, changed) : 0);
}
VCL_BOOL
@@ -316,19 +319,17 @@ vmod_saintmode_is_healthy(VRT_CTX, struct vmod_saintmode_saintmode *sm)
return is_digest_healthy(sm->sdir, digest,
ctx->req->t_prev, ctx->req->vsl);
} else
- return healthy(sm->sdir, ctx->bo, NULL);
+ return healthy(ctx, sm->sdir, NULL);
}
-static const struct director *
-resolve(const struct director *dir, struct worker *wrk, struct busyobj *bo) {
+static VCL_BACKEND v_matchproto_(vdi_resolve_f)
+resolve(VRT_CTX, VCL_BACKEND dir) {
struct vmod_saintmode_saintmode *sm;
- double changed = 0.0;
CHECK_OBJ_NOTNULL(dir, DIRECTOR_MAGIC);
CAST_OBJ_NOTNULL(sm, dir->priv, VMOD_SAINTMODE_MAGIC);
- (void)wrk;
- if (!healthy(dir, bo, &changed))
+ if (!healthy(ctx, dir, NULL))
return (NULL);
return (sm->be);
@@ -358,7 +359,7 @@ vmod_saintmode__init(VRT_CTX, struct vmod_saintmode_saintmode **smp,
sm->sdir->magic = DIRECTOR_MAGIC;
sm->sdir->methods = vmod_saintmode_methods;
#ifdef HAVE_DIRECTOR_ADMIN_HEALTH
- sm->sdir->admin_health = VDI_AH_HEALTHY;
+ sm->sdir->admin_health = VDI_AH_PROBE;
#endif
REPLACE(sm->sdir->vcl_name, vcl_name);
sm->sdir->priv = sm;
From c1c9b6ff4652c34aeff68f209d983be684caeb32 Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Tue, 1 May 2018 18:48:59 +0200
Subject: [PATCH 4/4] reflect latest changes to the director API
---
src/vmod_saintmode.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/src/vmod_saintmode.c b/src/vmod_saintmode.c
index 95de050..b0e4ac6 100644
--- a/src/vmod_saintmode.c
+++ b/src/vmod_saintmode.c
@@ -35,9 +35,6 @@
#include "vmod_config.h"
-#include "cache/cache_director.h"
-#include "cache/cache_backend.h"
-
#include "vsb.h"
#include "vtim.h"
@@ -59,7 +56,7 @@ struct trouble {
struct vmod_saintmode_saintmode {
unsigned magic;
#define VMOD_SAINTMODE_MAGIC 0xa03756e4
- struct director sdir[1];
+ const struct director *sdir;
const struct director *be;
pthread_mutex_t mtx;
unsigned threshold;
@@ -68,8 +65,8 @@ struct vmod_saintmode_saintmode {
VTAILQ_HEAD(, trouble) troublelist;
};
-static const struct director_methods vmod_saintmode_methods[1] = {{
- .magic = DIRECTOR_METHODS_MAGIC,
+static const struct vdi_methods vmod_saintmode_methods[1] = {{
+ .magic = VDI_METHODS_MAGIC,
.type = "saintmode",
.healthy = healthy,
.resolve = resolve
@@ -356,13 +353,7 @@ vmod_saintmode__init(VRT_CTX, struct vmod_saintmode_saintmode **smp,
sm->be = be;
VTAILQ_INIT(&sm->troublelist);
- sm->sdir->magic = DIRECTOR_MAGIC;
- sm->sdir->methods = vmod_saintmode_methods;
-#ifdef HAVE_DIRECTOR_ADMIN_HEALTH
- sm->sdir->admin_health = VDI_AH_PROBE;
-#endif
- REPLACE(sm->sdir->vcl_name, vcl_name);
- sm->sdir->priv = sm;
+ sm->sdir = VRT_AddDirector(ctx, vmod_saintmode_methods, sm, "%s", vcl_name);
if (!priv->priv) {
ALLOC_OBJ(sm_objs, SAINTMODE_OBJS_MAGIC);
@@ -392,7 +383,7 @@ vmod_saintmode__fini(struct vmod_saintmode_saintmode **smp) {
FREE_OBJ(tr);
}
- free(sm->sdir->vcl_name);
+ VRT_DelDirector(&sm->sdir);
AZ(pthread_mutex_destroy(&sm->mtx));
/* We can no longer refer to the sm_objs after this

View File

@ -0,0 +1,23 @@
From 40a8cc063b2819fdd325061a1cb48a3adc3ec910 Mon Sep 17 00:00:00 2001
From: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Wed, 17 Oct 2018 12:42:22 +0200
Subject: [PATCH] 32bit-friendly format in vmod-tcp
Fixes #122
---
src/vmod_tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vmod_tcp.c b/src/vmod_tcp.c
index fee4bd3..570be45 100644
--- a/src/vmod_tcp.c
+++ b/src/vmod_tcp.c
@@ -174,7 +174,7 @@ vmod_set_socket_pace(VRT_CTX, VCL_INT rate)
sizeof(pacerate)) != 0)
VSLb(ctx->vsl, SLT_VCL_Error, "set_socket_pace(): Error setting pace rate.");
else
- VSLb(ctx->vsl, SLT_VCL_Log, "vmod-tcp: Socket paced to %lu KB/s.", rate);
+ VSLb(ctx->vsl, SLT_VCL_Log, "vmod-tcp: Socket paced to %jd KB/s.", (intmax_t)rate);
# ifndef NDEBUG
int retval;

181
varnish-modules.spec Normal file
View File

@ -0,0 +1,181 @@
%global varnishver %(pkg-config --silence-errors --modversion varnishapi || echo 0)
%global commit 4d6593c2c97ecbabd3bd68203bace9cdbd6e960c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%if 0%{?rhel} == 7 || 0%{?rhel} == 6
%global docutils python34-docutils
%global rst2man rst2man-3.4
%else
%global docutils python3-docutils
%global rst2man rst2man
%endif
Name: varnish-modules
Version: 0.17.0
Release: 0.2.klarlack.20200916git%{shortcommit}%{?dist}
Summary: A collection of modules ("vmods") extending Varnish VCL
License: BSD
URL: https://github.com/nigoroll/varnish-modules
Source: https://github.com/nigoroll/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
BuildRequires: gcc
BuildRequires: make
BuildRequires: pkgconfig(varnishapi)
BuildRequires: varnish
# Build from a git checkout
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: %docutils
Requires: varnish = %varnishver
Provides: vmod-bodyaccess = %{version}-%{release}
Provides: vmod-header = %{version}-%{release}
Provides: vmod-saintmode = %{version}-%{release}
Provides: vmod-tcp = %{version}-%{release}
Provides: vmod-var = %{version}-%{release}
Provides: vmod-vsthrottle = %{version}-%{release}
Provides: vmod-xkey = %{version}-%{release}
%description
This is a collection of modules ("vmods") extending Varnish VCL used
for describing HTTP request/response policies with additional
capabilities. This collection contains the following vmods:
bodyaccess, header, saintmode, tcp, var, vsthrottle, xkey
%prep
%autosetup -n %{name}-%{commit}
%build
sh bootstrap
export RST2MAN=%{rst2man}
%configure
%make_build
%install
%make_install docdir=%_pkgdocdir
find %{buildroot}/%{_libdir}/ -name '*.la' -exec rm -f {} ';'
rm %{buildroot}%{_pkgdocdir}/LICENSE # Rather use license macro
%check
%ifarch %ix86 %arm ppc
# 64-bit specific test
sed -i 's,tests/xkey/test12.vtc,,' src/Makefile
%endif
%make_build check VERBOSE=1
%files
%doc docs AUTHORS CHANGES.rst COPYING README.rst
%license LICENSE
%{_libdir}/varnish/vmods/*
%{_mandir}/man3/*.3*
%changelog
* Tue Sep 29 2020 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.17.0-0.2.klarlack.20200916git
- Rebuilt for varnish-6.5.1
* Wed Sep 16 2020 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.17.0-0.1.klarlack.20200916git
- Switched upstream to Nils Goroll's fork which is the defacto current upstream
- Synced description to reality
- This is a snapshot build that needs autotools for building
- Rebuilt for varnish-6.5.0
* Mon Aug 17 2020 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.16.0-3
- Rebuilt for varnish-6.4.0
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sat Mar 28 2020 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.16.0-1
- New upstream release
* Tue Mar 17 2020 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.16.0-0.1.20200317git21d0c84
- Snapshot from 6.4 branch, rebuilt against varnish-6.4.0
- Removed patches merged upstream
- Delete 64-bit specific test on 32-bit arches
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Sep 29 2019 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.15.0-7
- Added patch from Nils Goroll, compatibility for varnish-6.3, closes bz#1736943
- Rebuilt against varnish-6.3.0
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 15 2019 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.15.0-5
- Install docs in correct docdir
* Fri Feb 15 2019 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.15.0-4
- Added a simple patch from upstream, fixing a formatting bug trigged on 32bit
- Removed dependency on docutils. It is not necessary on released tarballs
* Thu Feb 14 2019 Ingvar Hagelund <ingvar@redpill-linpro.com> - 0.15.0-3
- Added a proposed patch from Nils Goroll providing support for vmod_saintmode
on varnish-6.1.1 (closes rhbz #1676183)
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jul 17 2018 Dridi Boukelmoune <dridi@fedoraproject.org> 0.15.0-1
- Update to 0.15.0
- Drop EPEL and older Fedora releases support
- Drop broken manual ABI dependency to Varnish
- Drop commented out references to past patches
- Verbose test suite
- Simplified configure step
- Dependencies cleanup
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Oct 21 2017 Dridi Boukelmoune <dridi@fedoraproject.org> 0.12.1-5
- Update varnishabi requirement for f28
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Jun 01 2017 Ingvar Hagelund <ingvar@redpill-linpro.com> 0.12.1-2
- Set correct varnishabi requirement for the different fedoras
* Wed May 31 2017 Ingvar Hagelund <ingvar@redpill-linpro.com> 0.12.1-1
- New uptream release
- Pull el5 support
* Mon Mar 20 2017 Ingvar Hagelund <ingvar@redpill-linpro.com> 0.11.0-1
- New upstream release
* Sat Sep 24 2016 Ingvar Hagelund <ingvar@redpill-linpro.com> 0.9.2-0.1.20160924gitdaa4f1d
- Upstream git checkout with support for varnish-5.0
- Removed patches that are included upstream
- el5 build fix
* Fri Aug 05 2016 Ingvar Hagelund <ingvar@redpill-linpro.com> 0.9.1-1
- New upstream release
- Build man pages, buildrequires python-docutils
- Added a patch for tests/cookie/08-overflow.vtc, upping workspace_client,
the default is too small on 32bit
- Removed extra cflags for el5, fixed with patch from upstream
- Force readable docs and debug files, they tend to end up with mode 600
* Tue Apr 05 2016 Ingvar Hagelund <ingvar@redpill-linpro.com> 0.9.0-1
- First wrap for fedora
- Uses some old-style specfile components for el5 compatibility, including
the usage of the BuildRoot header and cleaning the buildroot before install