Commit 3a308c36 authored by Lasse Karstensen's avatar Lasse Karstensen

Rename default.vcl to builtin.vcl.

The default.vcl name was thought up in 2007 and have been a point of confusion
since.

New users take the old default VCL, uncomment what they think makes sense, and
always end with return(lookup) because that seems to be needed. But it isn't,
and the defaults in the built-in VCL are much better at handling all things
they haven't learned about yet.
parent d9cc0a70
......@@ -44,8 +44,8 @@ cscope.*out
/varnishapi-uninstalled.pc
# Default vcl made from bin/varnishd/default.vcl
/bin/varnishd/default_vcl.h
/etc/default.vcl
/bin/varnishd/builtin_vcl.h
/etc/builtin.vcl
# Various auto-generated code snippets
/include/vcl.h
......
......@@ -93,7 +93,7 @@ noinst_HEADERS = \
cache/cache_backend.h \
cache/cache_esi.h \
common/heritage.h \
default_vcl.h \
builtin_vcl.h \
hash/hash_slinger.h \
mgt/mgt.h \
mgt/mgt_cli.h \
......@@ -126,26 +126,26 @@ varnishd_LDADD = \
@PCRE_LIBS@ \
${DL_LIBS} ${PTHREAD_LIBS} ${NET_LIBS} ${LIBM} ${LIBUMEM}
EXTRA_DIST = default.vcl
DISTCLEANFILES = default_vcl.h
EXTRA_DIST = builtin.vcl
DISTCLEANFILES = builtin_vcl.h
#
# Turn the default.vcl file into a C-string we can include in the program.
# Turn the builtin.vcl file into a C-string we can include in the program.
#
default_vcl.h: default.vcl
builtin_vcl.h: builtin.vcl
echo '/*' > $@
echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@
echo ' *' >> $@
echo ' * Edit default.vcl instead and run make' >> $@
echo ' * Edit builtin.vcl instead and run make' >> $@
echo ' *' >> $@
echo ' */' >> $@
echo '' >> $@
sed -e 's/"/\\"/g' \
-e 's/$$/\\n"/' \
-e 's/^/ "/' $(srcdir)/default.vcl >> $@
-e 's/^/ "/' $(srcdir)/builtin.vcl >> $@
# Explicitly record dependency
mgt/mgt_vcc.c: default_vcl.h
mgt/mgt_vcc.c: builtin_vcl.h
varnishd.1: $(top_srcdir)/doc/sphinx/reference/varnishd.rst
if HAVE_RST2MAN
......
......@@ -95,7 +95,7 @@ LD_ADD += -lm
RST_MAN += $(TOPDIR)/doc/sphinx/reference/varnishd.rst
MADE_FILES += default_vcl.h
MADE_FILES += builtin_vcl.h
TODO_INSTALL += install_etc
......@@ -103,20 +103,20 @@ TOPDIR = $(CURDIR)/../..
include $(TOPDIR)/Makefile.inc.phk
#
# Turn the default.vcl file into a C-string we can include in the program.
# Turn the builtin.vcl file into a C-string we can include in the program.
#
default_vcl.h: default.vcl
builtint_vcl.h: builtin.vcl
echo '/*' > $@
echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@
echo ' *' >> $@
echo ' * Edit default.vcl instead and run make' >> $@
echo ' * Edit builtin.vcl instead and run make' >> $@
echo ' *' >> $@
echo ' */' >> $@
echo '' >> $@
sed -e 's/"/\\"/g' \
-e 's/$$/\\n"/' \
-e 's/^/ "/' default.vcl >> $@
-e 's/^/ "/' builtin.vcl >> $@
.PHONY: install_etc
install_etc: default_vcl.h
@cp default_vcl.h $(INSTALL_BASE)/etc/
install_etc: builtin_vcl.h
@cp builtin_vcl.h $(INSTALL_BASE)/etc/
......@@ -28,7 +28,7 @@
*
*
* The default VCL code.
* The built-in (previously called default) VCL code.
*
* NB! You do NOT need to copy & paste all of these functions into your
* own vcl code, if you do not provide a definition of one of these
......
......@@ -71,8 +71,8 @@ static struct vcc *vcc;
/*--------------------------------------------------------------------*/
static const char * const default_vcl =
#include "default_vcl.h"
static const char * const builtin_vcl =
#include "builtin_vcl.h"
"" ;
/*--------------------------------------------------------------------
......@@ -488,7 +488,7 @@ mgt_vcc_init(void)
vcc = VCC_New();
AN(vcc);
VCC_Default_VCL(vcc, default_vcl);
VCC_Default_VCL(vcc, builtin_vcl);
AZ(atexit(mgt_vcc_atexit));
}
......
......@@ -922,7 +922,7 @@ specified:
.port = "http";
}
.. include:: ../../../bin/varnishd/default.vcl
.. include:: ../../../bin/varnishd/builtin.vcl
:literal:
The following example shows how to support multiple sites running on
......
#
DISTCLEANFILES = default.vcl
DISTCLEANFILES = builtin.vcl
dist_varnishconf_DATA = default.vcl
dist_varnishconf_DATA = builtin.vcl
default.vcl: $(top_srcdir)/bin/varnishd/default.vcl
( printf "vcl 4.0;\nThis is a basic VCL configuration file for varnish. See the vcl(7)\n\
man page for details on VCL syntax and semantics.\n\
\n\
Default backend definition. Set this to point to your content\n\
server.\n\
\n\
backend default {\n\
.host = \"127.0.0.1\";\n\
.port = \"8080\";\n\
}\n\
\n\
Below is a commented-out copy of the default VCL logic. If you\n\
redefine any of these subroutines, the built-in logic will be\n\
appended to your code.\n" ; \
sed -n '/vcl_recv/,$$p' $(top_srcdir)/bin/varnishd/default.vcl ) | \
sed 's/^\(.*\)$$/# \1/' > default.vcl
builtin.vcl: $(top_srcdir)/bin/varnishd/builtin.vcl
( printf "This is the VCL configuration Varnish will automatically append to your VCL\nfile during compilation/loading. See the vcl(7) man page for details on syntax\nand semantics.\n\
New users is recommended to use the example.vcl file as a starting point.\n\n";\
sed -n '/vcl_recv/,$$p' $(top_srcdir)/bin/varnishd/builtin.vcl ) | \
sed 's/^\(.*\)$$/# \1/' > builtin.vcl
......@@ -12,7 +12,7 @@ dist_man_MANS = vcl.7 varnish-cli.7 varnish-counters.7 vsl.7 vsl-query.7
MAINTAINERCLEANFILES = $(dist_man_MANS)
vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \
$(top_srcdir)/bin/varnishd/default.vcl
$(top_srcdir)/bin/varnishd/builtin.vcl
if HAVE_RST2MAN
${RST2MAN} $(top_srcdir)/doc/sphinx/reference/vcl.rst $@
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment