diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..5b7e2ab --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,4 @@ +files +libvmod-var +*substvars +*log diff --git a/debian/changelog b/debian/changelog index bb91328..0a523f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libvmod-var (0.1) unstable; urgency=medium + + * Rebuild packages. + + -- Lasse Karstensen Fri, 04 Apr 2014 14:40:38 +0200 + libvmod-var (0.1) unstable; urgency=low * First version diff --git a/debian/rules b/debian/rules index 82ac88f..061b520 100755 --- a/debian/rules +++ b/debian/rules @@ -1,17 +1,20 @@ #!/usr/bin/make -f export DH_VERBOSE=1 -VARNISHSRC = $(DEBIAN_VARNISH_SRC) -VMODDIR = $(shell PKG_CONFIG_PATH="$(VARNISHSRC)" pkg-config --variable=vmoddir varnishapi) +VARNISHSRC ?= $(DEBIAN_VARNISH_SRC) +VMODDIR ?= $(shell PKG_CONFIG_PATH="$(VARNISHSRC)" pkg-config --variable=vmoddir varnishapi) +VMOD_ABI ?= $(shell printf '\#include "vmod_abi.h"\nVMOD_ABI_Version' | cpp - -I$(DEBIAN_VARNISH_SRC)/include | sed '/^\#/D;s/"//g;s/\([A-Z]\)/\L\1/g;s/[^a-z0-9.]/-/g;s/varnish/varnishabi/') override_dh_auto_configure: dh_auto_configure -- VMODDIR="$(VMODDIR)" VARNISHSRC="$(VARNISHSRC)" override_dh_gencontrol: + echo "Varnish:ABI=$(VMOD_ABI)" >> debian/substvars + if [ -n "$$DEBIAN_OVERRIDE_BINARY_VERSION" ]; then \ - dh_gencontrol -- -v$$DEBIAN_OVERRIDE_BINARY_VERSION; \ + dh_gencontrol -- -Tdebian/substvars -v$$DEBIAN_OVERRIDE_BINARY_VERSION; \ else \ - dh_gencontrol ; \ + dh_gencontrol -- -Tdebian/substvars; \ fi %: diff --git a/man/.gitignore b/man/.gitignore new file mode 100644 index 0000000..9f706da --- /dev/null +++ b/man/.gitignore @@ -0,0 +1 @@ +vmod_var.3 diff --git a/man/Makefile.am b/man/Makefile.am index f0257ed..91ab35e 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,12 +1,12 @@ # -dist_man_MANS = vmod_example.3 +dist_man_MANS = vmod_var.3 MAINTAINERCLEANFILES = $(dist_man_MANS) -EXTRA_DIST = vmod_example.rst +EXTRA_DIST = vmod_var.rst -vmod_example.3: vmod_example.rst +vmod_var.3: vmod_var.rst if HAVE_RST2MAN - ${RST2MAN} vmod_example.rst $@ + ${RST2MAN} vmod_var.rst $@ else @echo "========================================" @echo "You need rst2man installed to make dist" diff --git a/man/vmod_example.rst b/man/vmod_var.rst similarity index 56% rename from man/vmod_example.rst rename to man/vmod_var.rst index c8e91b1..629f951 100644 --- a/man/vmod_example.rst +++ b/man/vmod_var.rst @@ -1,14 +1,14 @@ -============ -vmod_example -============ +======== +vmod_var +======== ----------------------- -Varnish Example Module ----------------------- +------------------------ +Varnish Variables Module +------------------------ :Author: Tollef Fog Heen :Date: 2011-09-28 -:Version: 1.0 +:Version: 1.1 :Manual section: 3 SYNOPSIS @@ -33,7 +33,9 @@ Prototype Return value NONE Description - Sets the variable identified by S to the value T. + Sets the variable identified by S to the value T. The variable is + associated with the current request and will go away when the request + has been processed. Example var.set_string("bar", "some random string"); @@ -46,7 +48,7 @@ Prototype Return value STRING Description - Returns the string identified by the supplied string. + Returns the session variable string identified by the supplied string. Example set resp.http.foo = var.get_string("bar"); @@ -64,6 +66,31 @@ There are similar functions named: get and set are shorthand for get_string and set_string. +global_set +---------- + +Prototype + global_set(STRING S, STRING T) +Return value + NONE +Description + Sets the variable identified by S to the value T. The variable is + global and will persist as long as the vmod is loaded. +Example + var.global_set("bar", "some random string"); + +global_get +---------- + +Prototype + global_get(STRING S) +Return value + STRING +Description + Returns the global variable string identified by the supplied string. +Example + set resp.http.foo = var.global_get("bar"); + clear ----- @@ -86,6 +113,6 @@ COPYRIGHT ========= This document is licensed under the same license as the -libvmod-example project. See LICENSE for details. +libvmod-var project. See LICENSE for details. * Copyright (c) 2012 Varnish Software diff --git a/package.sh b/package.sh new file mode 100755 index 0000000..99fa377 --- /dev/null +++ b/package.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -x + +export VARNISH_VERSION=${VARNISH_VERSION:="3.0.5"} +export VARNISHSRC=../varnish-${VARNISH_VERSION} +export DEBIAN_VARNISH_SRC=$VARNISHSRC +export VMODDIR=/usr/lib/varnish/vmods + +git submodule update --init +./autogen.sh && ./configure && make +dpkg-buildpackage -uc -us -b diff --git a/vmod-var.spec b/vmod-var.spec index cd4ac58..67361b1 100644 --- a/vmod-var.spec +++ b/vmod-var.spec @@ -1,7 +1,7 @@ -Summary: Variable VMOD for Varnish +Summary: Variable VMOD for Varnish %{VARNISHVER} Name: vmod-var Version: 0.1 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Group: System Environment/Daemons Source0: libvmod-var.tar.gz @@ -10,7 +10,7 @@ Requires: varnish > 3.0 BuildRequires: make, python-docutils %description -Variables for Varnish +VCL variables for Varnish %{VARNISHVER}. %prep %setup -n libvmod-var