Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit bae5798

Browse files
committed
Move to RST-based README and merge with manfile
1 parent 1039dd3 commit bae5798

6 files changed

Lines changed: 112 additions & 102 deletions

File tree

Makefile.am

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
ACLOCAL_AMFLAGS = -I m4
22

3-
SUBDIRS = src man
3+
SUBDIRS = src
4+
5+
EXTRA_DIST = README.rst
6+
7+
dist_man_MANS = vmod_example.3
8+
MAINTAINERCLEANFILES = $(dist_man_MANS)
9+
10+
vmod_example.3: README.rst
11+
if HAVE_RST2MAN
12+
${RST2MAN} README.rst $@
13+
else
14+
@echo "========================================"
15+
@echo "You need rst2man installed to make dist"
16+
@echo "========================================"
17+
@false
18+
endif

README

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.rst

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
============
2+
vmod_example
3+
============
4+
5+
----------------------
6+
Varnish Example Module
7+
----------------------
8+
9+
:Author: Martin Blix Grydeland
10+
:Date: 2011-05-26
11+
:Version: 1.0
12+
:Manual section: 3
13+
14+
SYNOPSIS
15+
========
16+
17+
import example;
18+
19+
DESCRIPTION
20+
===========
21+
22+
Example Varnish vmod demonstrating how to write an out-of-tree Varnish vmod.
23+
24+
Implements the traditional Hello World as a vmod.
25+
26+
FUNCTIONS
27+
=========
28+
29+
hello
30+
-----
31+
32+
Prototype
33+
::
34+
35+
hello(STRING S)
36+
Return value
37+
STRING
38+
Description
39+
Returns "Hello, " prepended to S
40+
Example
41+
::
42+
43+
set resp.http.hello = example.hello("World");
44+
45+
INSTALLATION
46+
============
47+
48+
This is an example skeleton for developing out-of-tree Varnish
49+
vmods. It implements the "Hello, World!" as a vmod callback. Not
50+
particularly useful in good hello world tradition, but demonstrates how
51+
to get the glue around a vmod working.
52+
53+
The source tree is based on autotools to configure the building, and
54+
does also have the necessary bits in place to do functional unit tests
55+
using the varnishtest tool.
56+
57+
Usage::
58+
59+
./configure VARNISHSRC=DIR [VMODDIR=DIR]
60+
61+
`VARNISHSRC` is the directory of the Varnish source tree for which to
62+
compile your vmod. Both the `VARNISHSRC` and `VARNISHSRC/include`
63+
will be added to the include search paths for your module.
64+
65+
Optionally you can also set the vmod install directory by adding
66+
`VMODDIR=DIR` (defaults to the pkg-config discovered directory from your
67+
Varnish installation).
68+
69+
Make targets:
70+
71+
* make - builds the vmod
72+
* make install - installs your vmod in `VMODDIR`
73+
* make check - runs the unit tests in ``src/tests/*.vtc``
74+
75+
In your VCL you could then use this vmod along the following lines::
76+
77+
import example;
78+
79+
sub vcl_deliver {
80+
# This sets resp.http.hello to "Hello, World"
81+
set resp.http.hello = example.hello("World");
82+
}
83+
84+
HISTORY
85+
=======
86+
87+
This manual page was released as part of the libvmod-example package,
88+
demonstrating how to create an out-of-tree Varnish vmod.
89+
90+
COPYRIGHT
91+
=========
92+
93+
This document is licensed under the same license as the
94+
libvmod-example project. See LICENSE for details.
95+
96+
* Copyright (c) 2011 Varnish Software

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,5 @@ fi
6868
AC_CONFIG_FILES([
6969
Makefile
7070
src/Makefile
71-
man/Makefile
7271
])
7372
AC_OUTPUT

man/Makefile.am

Lines changed: 0 additions & 14 deletions
This file was deleted.

man/vmod_example.rst

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)