Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-file
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-file
Commits
52f046c7
Unverified
Commit
52f046c7
authored
Dec 12, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update and fix build infrastructure by example of vcdk
parent
46c861e1
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
161 additions
and
160 deletions
+161
-160
.gitignore
.gitignore
+37
-40
Makefile.am
Makefile.am
+2
-13
bootstrap
bootstrap
+25
-0
configure.ac
configure.ac
+25
-36
Makefile.am
src/Makefile.am
+41
-40
vmod_file.c
src/vmod_file.c
+1
-1
00basic.vtc
src/vtc/00basic.vtc
+2
-2
blob.vtc
src/vtc/blob.vtc
+1
-1
errors.vtc
src/vtc/errors.vtc
+1
-1
get.vtc
src/vtc/get.vtc
+9
-9
info.vtc
src/vtc/info.vtc
+7
-7
path.vtc
src/vtc/path.vtc
+7
-7
synth.vtc
src/vtc/synth.vtc
+2
-2
temperature.vtc
src/vtc/temperature.vtc
+1
-1
No files found.
.gitignore
View file @
52f046c7
Makefile
Makefile.in
# build system
.deps/
.libs/
*.o
*.lo
autom4te.cache/
build-aux/
m4/
*.la
*.gcda
*.gcno
*~
*.[1-9]
.dirstamp
/aclocal.m4
/ar-lib
/autom4te.cache/
/compile
/config.guess
/config.h
/config.h.in
/config.log
/config.status
/config.sub
/configure
/depcomp
/install-sh
/libtool
/ltmain.sh
/missing
/stamp-h1
/test-driver
/m4/
/src/vcc_if.c
/src/vcc_if.h
/src/vmod_*rst
/src/tests/*.log
/src/tests/*.trs
/src/test-suite.log
/src/tests/pathtest
/src/coverage
*.lo
*.o
*.tar.gz
Makefile
Makefile.in
aclocal.m4
config.h
config.h.in
config.log
config.status
configure
libtool
stamp-h1
# test suite
*.log
*.trs
# vmodtool
vcc_*_if.[ch]
vmod_*.rst
# man
*.1
*_options.rst
*_synopsis.rst
vmod_*.3
Makefile.am
View file @
52f046c7
ACLOCAL_AMFLAGS
=
-I
m4
-I
${
VARNISHAPI_DATAROOTDIR
}
/aclocal
ACLOCAL_AMFLAGS
=
-I
m4
-I
@VARNISHAPI_DATAROOTDIR@
/aclocal
SUBDIRS
=
src
DISTCHECK_CONFIGURE_FLAGS
=
\
VMOD_DIR
=
'$${libdir}/varnish/vmods'
DISTCHECK_CONFIGURE_FLAGS
=
RST2MAN
=
:
coverage
:
$(MAKE)
$(AM_MAKEFLAGS)
-C
src coverage
...
...
@@ -15,13 +14,3 @@ doc_DATA = README.rst LICENSE CONTRIBUTING.rst INSTALL.rst
README.rst
:
src/vmod_file.vcc
$(MAKE)
$(AM_MAKEFLAGS)
-C
src vmod_file.man.rst
cp
src/vmod_file.man.rst README.rst
%.1 %.2 %.3 %.4 %.5 %.6 %.7 %.8 %.9
:
if
HAVE_RST2MAN
${RST2MAN}
$<
$@
else
@echo
"========================================"
@echo
"You need rst2man installed to make dist"
@echo
"========================================"
@false
endif
bootstrap
0 → 100755
View file @
52f046c7
#!/bin/sh
set
-e
set
-u
WORK_DIR
=
$(
pwd
)
ROOT_DIR
=
$(
dirname
"
$0
"
)
cd
"
$ROOT_DIR
"
if
!
command
-v
libtoolize
>
/dev/null
then
echo
"libtoolize: command not found, falling back to glibtoolize"
>
&2
alias
libtoolize
=
glibtoolize
fi
mkdir
-p
m4
aclocal
libtoolize
--copy
--force
autoheader
automake
--add-missing
--copy
--foreign
autoconf
cd
"
$WORK_DIR
"
"
$ROOT_DIR
"
/configure
"
$@
"
configure.ac
View file @
52f046c7
AC_PREREQ(
2.68
)
AC_COPYRIGHT([Copyright (c) 2019 UPLEX - Nils Goroll Systemoptimierung])
AC_PREREQ(
[2.68]
)
AC_COPYRIGHT([Copyright (c) 2019
,2023
UPLEX - Nils Goroll Systemoptimierung])
AC_INIT([libvmod-file], [trunk], [varnish-support@uplex.de], [vmod-file])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(src/vmod_file.vcc)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
AC_LANG(C)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.12 -Wall -Werror foreign parallel-tests])
AM_SILENT_RULES([yes])
AM_PROG_AR
LT_PREREQ([2.2.6])
LT_INIT([dlopen disable-static])
AC_PROG_CC
AC_PROG_CC_STDC
if test "x$ac_cv_prog_cc_c99" = xno; then
AC_MSG_ERROR([Could not find a C99 compatible compiler])
fi
AC_PROG_CPP
AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
AC_ARG_WITH([rst2man],
AS_HELP_STRING(
[--with-rst2man=PATH],
[Location of rst2man (auto)]),
[RST2MAN="$withval"],
AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], []))
AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" != "xno"])
[AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], [])])
AC_ARG_WITH([lcov],
AS_HELP_STRING(
[--with-lcov=PATH],
[Location of lcov to generate coverage data (auto)]),
[LCOV="$withval"],
AC_CHECK_PROGS(LCOV, [lcov], [])
)
[AC_CHECK_PROGS(LCOV, [lcov], [])]
)
AM_CONDITIONAL(HAVE_LCOV, [test -n "$LCOV"])
AC_ARG_WITH([genhtml],
...
...
@@ -48,20 +26,16 @@ AC_ARG_WITH([genhtml],
[--with-genhtml=PATH],
[Location of genhtml to generate coverage reports (auto)]),
[GENHTML="$withval"],
AC_CHECK_PROGS(GENHTML, [genhtml], [])
)
[AC_CHECK_PROGS(GENHTML, [genhtml], [])]
)
AM_CONDITIONAL(HAVE_GENHTML, [test -n "$GENHTML"])
m4_ifndef([VARNISH_PREREQ], AC_MSG_ERROR([Need varnish.m4 -- see README.rst]))
VARNISH_PREREQ([6.5.0])
VARNISH_VMODS([file])
VMOD_TESTS="$(cd $srcdir/src && echo tests/*.vtc)"
AC_SUBST(VMOD_TESTS)
AM_PROG_AR
PKG_CHECK_VAR([LIBVARNISHAPI_LIBDIR], [varnishapi], [libdir])
AC_SUBST([VARNISH_LIBRARY_PATH],
[$LIBVARNISHAPI_LIBDIR:$LIBVARNISHAPI_LIBDIR/varnish])
LT_PREREQ([2.2.6])
LT_INIT([dlopen disable-static])
# Checks for C sources
AC_CHECK_FUNCS([memset])
...
...
@@ -108,4 +82,19 @@ AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
AS_ECHO("
==== $PACKAGE_STRING ====
varnish: $VARNISH_VERSION
prefix: $prefix
vmoddir: $vmoddir
vcldir: $vcldir
pkgvcldir: $pkgvcldir
compiler: $CC
cflags: $CFLAGS
ldflags: $LDFLAGS
")
src/Makefile.am
View file @
52f046c7
AUTOMAKE_OPTIONS
=
subdir-objects
AM_CFLAGS
=
$(VARNISHAPI_CFLAGS)
-Wall
-Werror
-Wextra
-std
=
c99
AM_LDFLAGS
=
$(VARNISHAPI_LIBS)
-ldl
-lrt
vmod_LTLIBRARIES
=
libvmod_file.la
# Modules
libvmod_file_la_SOURC
ES
=
\
vmod_file.c
vmod_LTLIBRARI
ES
=
\
libvmod_file.la
libvmod_file_la_LDFLAGS
=
$(VMOD_LDFLAGS)
libvmod_file_la_SOURCES
=
vmod_file.c
nodist_libvmod_file_la_SOURCES
=
\
vcc_if.c
\
vcc_if.h
vmod_file.lo
:
$(nodist_libvmod_file_la_SOURCES)
dist_man_MANS
=
vmod_file.3
vcc_if.h vmod_file.rst vmod_file.man.rst
:
vcc_if.c
vcc_file_if.c
\
vcc_file_if.h
vcc_if.c
:
vmod_file.vcc
$(AM_V_VMODTOOL)
$(PYTHON)
$(VMODTOOL)
-o
vcc_if
$(srcdir)
/vmod_file.vcc
@BUILD_VMOD_FILE@
vmod_file.3
:
vmod_file.man.rst
$(AM_V_GEN)
$(RST2MAN)
vmod_file.man.rst vmod_file.3
# Test suite
AM_TESTS_ENVIRONMENT
=
\
PATH
=
"
$(
VMOD_TEST_
PATH)
"
\
PATH
=
"
$(
abs_builddir)
:
$(VARNISH_TEST_PATH)
:
$(
PATH)
"
\
LD_LIBRARY_PATH
=
"
$(VARNISH_LIBRARY_PATH)
"
TEST_EXTENSIONS
=
.vtc
VTC_LOG_COMPILER
=
varnishtest
-v
AM_VTC_LOG_FLAGS
=
-Dvmod_file
=
"
$(VMOD_FILE)
"
TESTS
=
@VMOD_TESTS@
AM_VTC_LOG_FLAGS
=
\
-p
vcl_path
=
"
$(abs_top_srcdir)
/vcl:
$(VARNISHAPI_VCLDIR)
"
\
-p
vmod_path
=
"
$(abs_builddir)
/.libs:
$(vmoddir)
:
$(VARNISHAPI_VMODDIR)
"
TESTS
=
\
vtc/00basic.vtc
\
vtc/blob.vtc
\
vtc/errors.vtc
\
vtc/get.vtc
\
vtc/info.vtc
\
vtc/path.vtc
\
vtc/synth.vtc
\
vtc/temperature.vtc
# Documentation
dist_doc_DATA
=
\
vmod_file.vcc
\
$(TESTS)
# To test an individual VTC test named test.vtc:
# $ cd src/
# $ make check TESTS=tests/test.vtc
dist_man_MANS
=
\
vmod_file.3
gcov
:
clean
$(AM_V_at)$(MAKE)
$(AM_MAKEFLAGS)
CC
=
gcc
\
CFLAGS
=
"
${
AM_CFLAGS
}
--coverage -fno-inline -g -O0"
check
.rst.1
:
$(AM_V_GEN)
$(RST2MAN)
$<
$@
# Coverage
# Set QUIET=-q for non-verbose builds, otherwise set to empty.
QUIET_0
=
-q
QUIET_
=
$
(
QUIET_@AM_DEFAULT_V@
)
QUIET
=
$
(
QUIET_@AM_V@
)
gcov
:
clean
$(AM_V_at)$(MAKE)
$(AM_MAKEFLAGS)
CC
=
gcc
\
CFLAGS
=
"
${
AM_CFLAGS
}
--coverage -fno-inline -g -O0"
check
coverage/lcov.info
:
gcov
if
HAVE_LCOV
$(AM_V_at)@mkdir
$(builddir)/coverage
...
...
@@ -67,18 +81,5 @@ else
@false
endif
EXTRA_DIST
=
\
vmod_file.vcc
\
$(VMOD_TESTS)
CLEANFILES
=
\
$(builddir)
/vcc_if.c
\
$(builddir)
/vcc_if.h
\
$(builddir)
/vmod_file.rst
\
$(builddir)
/vmod_file.man.rst
\
$(builddir)
/vmod_file.3
\
$(builddir)
/
*
.gcda
\
$(builddir)
/
*
.gcno
clean-local
:
@
rm
-rf
$(builddir)
/coverage
src/vmod_file.c
View file @
52f046c7
...
...
@@ -47,7 +47,7 @@
#include "vsb.h"
#include "vsha256.h"
#include "vcc_if.h"
#include "vcc_
file_
if.h"
#define VFAIL(ctx, fmt, ...) \
VRT_fail((ctx), "vmod file failure: " fmt, __VA_ARGS__)
...
...
src/
tests
/00basic.vtc
→
src/
vtc
/00basic.vtc
View file @
52f046c7
...
...
@@ -3,7 +3,7 @@
varnishtest "vcl.use and .discard, and version strings"
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
} -start
...
...
@@ -21,7 +21,7 @@ varnish v1 -cli "vcl.discard vcl1"
varnish v1 -cli "vcl.list"
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_recv {
...
...
src/
tests
/blob.vtc
→
src/
vtc
/blob.vtc
View file @
52f046c7
...
...
@@ -5,7 +5,7 @@ varnishtest "reader.blob()"
shell {echo -n "foo bar baz quux" > ${tmpdir}/blob}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
import blob;
backend b None;
...
...
src/
tests
/errors.vtc
→
src/
vtc
/errors.vtc
View file @
52f046c7
...
...
@@ -5,7 +5,7 @@ varnishtest "reader.error()"
shell {touch ${tmpdir}/error}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
src/
tests
/get.vtc
→
src/
vtc
/get.vtc
View file @
52f046c7
...
...
@@ -5,7 +5,7 @@ varnishtest "reader constructor and .get()"
shell {echo -n "foo bar baz quux" > ${tmpdir}/file}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -32,7 +32,7 @@ client c1 {
shell {ln -s ${tmpdir}/file ${tmpdir}/link}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -52,7 +52,7 @@ varnish v1 -vcl {
client c1 -run
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -130,7 +130,7 @@ client c1 -run
shell {echo -n "The quick brown fox jumps over the lazy dog." > ${tmpdir}/fox}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -168,7 +168,7 @@ client c1 {
} -run
varnish v1 -errvcl {cannot open} {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -177,7 +177,7 @@ varnish v1 -errvcl {cannot open} {
}
varnish v1 -errvcl {not a regular file} {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -188,7 +188,7 @@ varnish v1 -errvcl {not a regular file} {
shell {ln -s ${tmpdir} ${tmpdir}/dirlink}
varnish v1 -errvcl {not a regular file} {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -197,7 +197,7 @@ varnish v1 -errvcl {not a regular file} {
}
varnish v1 -errvcl {vmod file failure: new rdr: name is empty} {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -206,7 +206,7 @@ varnish v1 -errvcl {vmod file failure: new rdr: name is empty} {
}
varnish v1 -errvcl {vmod file failure: new rdr: ttl -1.000 must be >= 0s} {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
src/
tests
/info.vtc
→
src/
vtc
/info.vtc
View file @
52f046c7
...
...
@@ -5,7 +5,7 @@ varnishtest "methods for information about files and timers"
shell {echo -n "foo bar baz quux" > ${tmpdir}/sz}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -80,7 +80,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
shell {touch ${tmpdir}/mtime}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -114,7 +114,7 @@ logexpect l1 -wait
shell {touch ${tmpdir}/nxtchk}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -149,7 +149,7 @@ client c1 {
shell {touch ${tmpdir}/deleteme}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -182,7 +182,7 @@ client c1 {
shell {touch ${tmpdir}/id}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
import blob;
backend b None;
...
...
@@ -216,7 +216,7 @@ client c1 -run
shell {echo -n "foo bar baz quux" > ${tmpdir}/sha}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
import blob;
backend b None;
...
...
@@ -250,7 +250,7 @@ client c1 -run
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
import blob;
backend b None;
...
...
src/
tests
/path.vtc
→
src/
vtc
/path.vtc
View file @
52f046c7
...
...
@@ -10,7 +10,7 @@ shell {
}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -40,7 +40,7 @@ client c1 {
} -run
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -67,7 +67,7 @@ shell {echo -n "1 only" > ${tmpdir}/d1/pathtest}
shell {echo -n "2 only" > ${tmpdir}/d2/pathtest}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -95,7 +95,7 @@ client c1 {
} -run
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -128,7 +128,7 @@ shell {
}
varnish v1 -errvcl {new rdr: unreadable not found or not readable on path} {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -140,7 +140,7 @@ shell {rm -f ${tmpdir}/d1/pathtest}
shell {rm -f ${tmpdir}/d2/pathtest}
varnish v1 -errvcl {new rdr: pathtest not found or not readable on path} {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -150,7 +150,7 @@ varnish v1 -errvcl {new rdr: pathtest not found or not readable on path} {
}
varnish v1 -errvcl {new rdr: path is empty} {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
src/
tests
/synth.vtc
→
src/
vtc
/synth.vtc
View file @
52f046c7
...
...
@@ -8,7 +8,7 @@ shell {
}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
@@ -78,7 +78,7 @@ shell {
}
varnish v1 -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
src/
tests
/temperature.vtc
→
src/
vtc
/temperature.vtc
View file @
52f046c7
...
...
@@ -7,7 +7,7 @@ shell {echo -n "foo bar baz quux" > ${tmpdir}/file}
# Debug param vclrel causes VCLs to be released without delay, making
# it possible to check the effects of temperature changes.
varnish v1 -arg "-p debug=+vclrel" -vcl {
import
${vmod_file}
;
import
file
;
backend b None;
sub vcl_init {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment