Commit 764587bd authored by Nils Goroll's avatar Nils Goroll

rename libvmod-example to libvmod-convert

parent e429b8f0
...@@ -5,14 +5,14 @@ SUBDIRS = src ...@@ -5,14 +5,14 @@ SUBDIRS = src
DISTCHECK_CONFIGURE_FLAGS = \ DISTCHECK_CONFIGURE_FLAGS = \
VMOD_DIR='$${libdir}/varnish/vmods' VMOD_DIR='$${libdir}/varnish/vmods'
EXTRA_DIST = README.rst LICENSE vmod-example.spec debian EXTRA_DIST = README.rst LICENSE vmod-convert.spec debian
doc_DATA = README.rst LICENSE doc_DATA = README.rst LICENSE
dist_man_MANS = vmod_example.3 dist_man_MANS = vmod_convert.3
MAINTAINERCLEANFILES = $(dist_man_MANS) MAINTAINERCLEANFILES = $(dist_man_MANS)
vmod_example.3: README.rst vmod_convert.3: README.rst
%.1 %.2 %.3 %.4 %.5 %.6 %.7 %.8 %.9: %.1 %.2 %.3 %.4 %.5 %.6 %.7 %.8 %.9:
if HAVE_RST2MAN if HAVE_RST2MAN
......
============ ============
vmod_example vmod_convert
============ ============
---------------------- ----------------------
...@@ -13,7 +13,7 @@ Varnish Example Module ...@@ -13,7 +13,7 @@ Varnish Example Module
SYNOPSIS SYNOPSIS
======== ========
import example; import convert;
DESCRIPTION DESCRIPTION
=========== ===========
...@@ -39,7 +39,7 @@ Description ...@@ -39,7 +39,7 @@ Description
Example Example
:: ::
set resp.http.hello = example.hello("World"); set resp.http.hello = convert.hello("World");
INSTALLATION INSTALLATION
============ ============
...@@ -58,7 +58,7 @@ Usage:: ...@@ -58,7 +58,7 @@ Usage::
If you have installed Varnish to a non-standard directory, call If you have installed Varnish to a non-standard directory, call
``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to ``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to
the appropriate path. For example, when varnishd configure was called the appropriate path. For convert, when varnishd configure was called
with ``--prefix=$PREFIX``, use with ``--prefix=$PREFIX``, use
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
...@@ -73,11 +73,11 @@ Make targets: ...@@ -73,11 +73,11 @@ Make targets:
In your VCL you could then use this vmod along the following lines:: In your VCL you could then use this vmod along the following lines::
import example; import convert;
sub vcl_deliver { sub vcl_deliver {
# This sets resp.http.hello to "Hello, World" # This sets resp.http.hello to "Hello, World"
set resp.http.hello = example.hello("World"); set resp.http.hello = convert.hello("World");
} }
COMMON PROBLEMS COMMON PROBLEMS
......
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2011-2015 Varnish Software AS]) AC_COPYRIGHT([Copyright (c) 2011-2015 Varnish Software AS])
AC_INIT([libvmod-example], [trunk]) AC_INIT([libvmod-convert], [trunk])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
m4_ifndef([VARNISH_VMOD_INCLUDES], AC_MSG_ERROR([Need varnish.m4 -- see README.rst])) m4_ifndef([VARNISH_VMOD_INCLUDES], AC_MSG_ERROR([Need varnish.m4 -- see README.rst]))
AC_CONFIG_SRCDIR(src/vmod_example.vcc) AC_CONFIG_SRCDIR(src/vmod_convert.vcc)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
......
libvmod-example (0.1) unstable; urgency=low libvmod-convert (0.1) unstable; urgency=low
* First version * First version
......
Source: libvmod-example Source: libvmod-convert
Section: web Section: web
Priority: extra Priority: extra
Maintainer: Varnish Software <support@varnish-software.com> Maintainer: Varnish Software <support@varnish-software.com>
...@@ -9,9 +9,9 @@ Build-Depends: debhelper (>= 7), ...@@ -9,9 +9,9 @@ Build-Depends: debhelper (>= 7),
varnish (>= 4.0.2), varnish (>= 4.0.2),
libvarnishapi-dev (>= 4.0.2) libvarnishapi-dev (>= 4.0.2)
Standards-Version: 3.8.1 Standards-Version: 3.8.1
Vcs-Git: git://github.com/varnish/libvmod-example.git Vcs-Git: git://github.com/varnish/libvmod-convert.git
Package: libvmod-example Package: libvmod-convert
Architecture: any Architecture: any
Depends: varnish (>= 4.0.2), ${shlibs:Depends}, ${misc:Depends}, ${Varnish:ABI} Depends: varnish (>= 4.0.2), ${shlibs:Depends}, ${misc:Depends}, ${Varnish:ABI}
Description: Example vmod for Varnish Description: Example vmod for Varnish
usr/share/doc/libvmod-example usr/share/doc/libvmod-convert
#!/bin/bash
#
# Script to rename libvmod-example into libvmod-foo.
# (where "foo" is your new vmod name, of course.)
#
# Leaves the changes uncommitted in the working tree, so you get to fix any
# unintended changes.
#
# Author: Lasse Karstensen <lkarsten@varnish-software.com>, September 2014.
#
set -o errexit
NAME=$1
if [ -z "$NAME" ]; then
echo "Usage: $0 <new-vmod-name-without-libvmod-prefix>"
echo "Rename libvmod-example source tree."
echo
exit -1
fi
if ! git diff-index --quiet HEAD --; then
echo "ERROR: Need a clean working tree. Run \"git stash\" first."
exit -2
fi
git mv src/vmod_example.c src/vmod_${NAME}.c
git mv src/vmod_example.vcc src/vmod_${NAME}.vcc
git mv vmod-example.spec vmod-${NAME}.spec
git grep -z -l example | xargs -0 sed -i -s -e "s/example/${NAME}/g"
git rm rename-vmod-script
echo "All done."
echo -e "For your cut&paste needs:\n git commit -a -m \"Automatic rename of libvmod-example to libvmod-${NAME}.\""
AM_CPPFLAGS = @VMOD_INCLUDES@ -Wall -Werror AM_CPPFLAGS = @VMOD_INCLUDES@ -Wall -Werror
vmoddir = @VMOD_DIR@ vmoddir = @VMOD_DIR@
vmod_LTLIBRARIES = libvmod_example.la vmod_LTLIBRARIES = libvmod_convert.la
libvmod_example_la_LDFLAGS = -module -export-dynamic -avoid-version -shared libvmod_convert_la_LDFLAGS = -module -export-dynamic -avoid-version -shared
libvmod_example_la_SOURCES = \ libvmod_convert_la_SOURCES = \
vmod_example.c vmod_convert.c
nodist_libvmod_example_la_SOURCES = \ nodist_libvmod_convert_la_SOURCES = \
vcc_if.c \ vcc_if.c \
vcc_if.h vcc_if.h
vmod_example.lo: vcc_if.c vcc_if.h vmod_convert.lo: vcc_if.c vcc_if.h
vcc_if.c: vcc_if.h vcc_if.c: vcc_if.h
vcc_if.h: @VMODTOOL@ $(top_srcdir)/src/vmod_example.vcc vcc_if.h: @VMODTOOL@ $(top_srcdir)/src/vmod_convert.vcc
@VMODTOOL@ $(top_srcdir)/src/vmod_example.vcc @VMODTOOL@ $(top_srcdir)/src/vmod_convert.vcc
VMOD_TESTS = $(top_srcdir)/src/tests/*.vtc VMOD_TESTS = $(top_srcdir)/src/tests/*.vtc
.PHONY: $(VMOD_TESTS) .PHONY: $(VMOD_TESTS)
$(top_srcdir)/src/tests/*.vtc: libvmod_example.la $(top_srcdir)/src/tests/*.vtc: libvmod_convert.la
@VARNISHTEST@ -Dvarnishd=@VARNISHD@ -Dvmod_topbuild=$(abs_top_builddir) $@ @VARNISHTEST@ -Dvarnishd=@VARNISHD@ -Dvmod_topbuild=$(abs_top_builddir) $@
check: $(VMOD_TESTS) check: $(VMOD_TESTS)
EXTRA_DIST = \ EXTRA_DIST = \
vmod_example.vcc \ vmod_convert.vcc \
$(VMOD_TESTS) $(VMOD_TESTS)
CLEANFILES = \ CLEANFILES = \
$(builddir)/vcc_if.c \ $(builddir)/vcc_if.c \
$(builddir)/vcc_if.h \ $(builddir)/vcc_if.h \
$(builddir)/vmod_example.rst \ $(builddir)/vmod_convert.rst \
$(builddir)/vmod_example.man.rst $(builddir)/vmod_convert.man.rst
varnishtest "Test example vmod" varnishtest "Test convert vmod"
server s1 { server s1 {
rxreq rxreq
...@@ -6,10 +6,10 @@ server s1 { ...@@ -6,10 +6,10 @@ server s1 {
} -start } -start
varnish v1 -vcl+backend { varnish v1 -vcl+backend {
import example from "${vmod_topbuild}/src/.libs/libvmod_example.so"; import convert from "${vmod_topbuild}/src/.libs/libvmod_convert.so";
sub vcl_deliver { sub vcl_deliver {
set resp.http.hello = example.hello("World"); set resp.http.hello = convert.hello("World");
} }
} -start } -start
......
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
# (vmodtool requires this format.) # (vmodtool requires this format.)
# #
$Module example 3 Example VMOD $Module convert 3 Example VMOD
DESCRIPTION DESCRIPTION
=========== ===========
This is the embedded documentation for the example VMOD. It should This is the embedded documentation for the convert VMOD. It should
mention what the vmod is intended to do. mention what the vmod is intended to do.
It can span multiple lines and is written in RST format. It can span multiple lines and is written in RST format.
You can even have links and lists in here: You can even have links and lists in here:
* https://github.com/varnish/libvmod-example/ * https://github.com/varnish/libvmod-convert/
* https://www.varnish-cache.org/ * https://www.varnish-cache.org/
The init-function declared next does not have documentation. The init-function declared next does not have documentation.
......
Summary: Example VMOD for Varnish Summary: Example VMOD for Varnish
Name: vmod-example Name: vmod-convert
Version: 0.1 Version: 0.1
Release: 1%{?dist} Release: 1%{?dist}
License: BSD License: BSD
Group: System Environment/Daemons Group: System Environment/Daemons
Source0: libvmod-example.tar.gz Source0: libvmod-convert.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: varnish >= 4.0.2 Requires: varnish >= 4.0.2
BuildRequires: make BuildRequires: make
...@@ -16,7 +16,7 @@ BuildRequires: varnish-libs-devel >= 4.0.2 ...@@ -16,7 +16,7 @@ BuildRequires: varnish-libs-devel >= 4.0.2
Example VMOD Example VMOD
%prep %prep
%setup -n libvmod-example-trunk %setup -n libvmod-convert-trunk
%build %build
%configure --prefix=/usr/ %configure --prefix=/usr/
......
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