Commit 904644e7 authored by arianna-aondio's avatar arianna-aondio

Merge pull request #24 from Dridi/master

Various fixes
parents 2285f10e 42cdf17e
......@@ -8,19 +8,3 @@ DISTCHECK_CONFIGURE_FLAGS = \
EXTRA_DIST = README.rst LICENSE vmod-example.spec debian
doc_DATA = README.rst LICENSE
dist_man_MANS = vmod_example.3
MAINTAINERCLEANFILES = $(dist_man_MANS)
vmod_example.3: src/vmod_example.man.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
......@@ -58,7 +58,7 @@ Usage::
If you have installed Varnish to a non-standard directory, call
``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to
the appropriate path. For example, when varnishd configure was called
the appropriate path. For instance, when varnishd configure was called
with ``--prefix=$PREFIX``, use
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
......@@ -106,4 +106,5 @@ COMMON PROBLEMS
* Incompatibilities with different Varnish Cache versions
Make sure you build this vmod against its correspondent Varnish Cache version.
For example, to build against Varnish Cache 4.0, this vmod must be built from branch 4.0.
For instance, to build against Varnish Cache 4.0, this vmod must be built from
branch 4.0.
AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2011-2015 Varnish Software AS])
AC_INIT([libvmod-example], [trunk])
AC_INIT([libvmod-example], [0.1])
AC_CONFIG_MACRO_DIR([m4])
m4_ifndef([VARNISH_VMOD_INCLUDES], AC_MSG_ERROR([Need varnish.m4 -- see README.rst]))
AC_CONFIG_SRCDIR(src/vmod_example.vcc)
......@@ -26,9 +26,8 @@ AC_PROG_MAKE_SET
# Check for rst utilities
AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], "no")
if test "x$RST2MAN" = "xno"; then
AC_MSG_WARN([rst2man not found - not building man pages])
AC_MSG_ERROR([rst2man not found - cannot build man pages])
fi
AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" != "xno"])
# Checks for header files.
AC_HEADER_STDC
......
......@@ -14,24 +14,31 @@ NAME=$1
if [ -z "$NAME" ]; then
echo "Usage: $0 <new-vmod-name-without-libvmod-prefix>"
echo "Rename libvmod-example source tree."
echo "If the name is an acronym, you can use capital letters."
echo
exit -1
fi
SYM_NAME=${NAME,,*}
CAP_NAME=${NAME^?}
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 mv src/vmod_example.c src/vmod_${SYM_NAME}.c
git mv src/vmod_example.vcc src/vmod_${SYM_NAME}.vcc
git mv vmod-example.spec vmod-${SYM_NAME}.spec
git grep -z -l example | xargs -0 sed -i -s -e "s/example/${NAME}/g"
git grep -z -l example | xargs -0 sed -i -s -e "s/example/${SYM_NAME}/g"
git grep -z -l Example | xargs -0 sed -i -s -e "s/Example/${CAP_NAME}/g"
git rm -f 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}.\""
cat <<EOF
All done.
For your cut&paste needs:
git commit -a -m "Automatic rename of libvmod-example to libvmod-${SYM_NAME}."
EOF
......@@ -12,15 +12,19 @@ nodist_libvmod_example_la_SOURCES = \
vcc_if.c \
vcc_if.h
vmod_example.lo: vcc_if.c vcc_if.h
dist_man_MANS = vmod_example.3
vcc_if.c: vcc_if.h
vmod_example.3: vmod_example.man.rst
${RST2MAN} $< $@
vcc_if.h: @VMODTOOL@ $(top_srcdir)/src/vmod_example.vcc
vmod_example.lo vmod_example.man.rst: vcc
vcc: @VMODTOOL@ $(top_srcdir)/src/vmod_example.vcc
@VMODTOOL@ $(top_srcdir)/src/vmod_example.vcc
VMOD_TESTS = $(top_srcdir)/src/tests/*.vtc
.PHONY: $(VMOD_TESTS)
.PHONY: $(VMOD_TESTS) vcc
$(top_srcdir)/src/tests/*.vtc: libvmod_example.la
@VARNISHTEST@ -Dvarnishd=@VARNISHD@ -Dvmod_topbuild=$(abs_top_builddir) $@
......@@ -35,4 +39,5 @@ CLEANFILES = \
$(builddir)/vcc_if.c \
$(builddir)/vcc_if.h \
$(builddir)/vmod_example.rst \
$(builddir)/vmod_example.man.rst
$(builddir)/vmod_example.man.rst \
$(dist_man_MANS)
......@@ -4,25 +4,30 @@ Version: 0.1
Release: 1%{?dist}
License: BSD
Group: System Environment/Daemons
Source0: libvmod-example.tar.gz
Source0: lib%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: varnish >= 4.0.2
BuildRequires: make
BuildRequires: python-docutils
BuildRequires: varnish >= 4.0.2
BuildRequires: varnish-libs-devel >= 4.0.2
%description
Example VMOD
%prep
%setup -n libvmod-example-trunk
%setup -n lib%{name}-%{version}
%build
%configure --prefix=/usr/
%{__make} %{?_smp_mflags}
%{__make} %{?_smp_mflags} check
%install
[ %{buildroot} != "/" ] && %{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
......@@ -32,12 +37,14 @@ mv %{buildroot}/usr/share/doc/lib%{name} %{buildroot}/usr/share/doc/%{name}
%clean
[ %{buildroot} != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_libdir}/varnis*/vmods/
%doc /usr/share/doc/%{name}/*
%{_mandir}/man?/*
%changelog
* Tue Nov 14 2012 Lasse Karstensen <lasse@varnish-software.com> - 0.1-0.20121114
- Initial version.
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