[master] 74c3c3b Sync up with Debian downstream.

Lasse Karstensen lkarsten at varnish-software.com
Wed Dec 10 11:53:42 CET 2014


commit 74c3c3bb037e1c54ed9ebd64da94090587c6f05d
Author: Lasse Karstensen <lkarsten at varnish-software.com>
Date:   Wed Dec 10 11:16:23 2014 +0100

    Sync up with Debian downstream.
    
    They know this Debian packaging stuff better than us.
    
    I've reviewed each of these files manually, but I may have broken
    something still. Additional review is welcome.

diff --git a/compat b/compat
index 7f8f011..ec63514 100644
--- a/compat
+++ b/compat
@@ -1 +1 @@
-7
+9
diff --git a/control b/control
index 1c51426..6cc69c2 100644
--- a/control
+++ b/control
@@ -8,10 +8,11 @@ Uploaders:
  Stig Sandbeck Mathisen <ssm at debian.org>,
  Tollef Fog Heen <tfheen at debian.org>,
 Build-Depends:
- autoconf,
  automake,
  autotools-dev,
- debhelper (>= 7.0.50~),
+ debhelper (>= 9),
+ dh-autoreconf,
+ dh-systemd,
  libedit-dev,
  libjemalloc-dev,
  libncurses-dev,
@@ -23,11 +24,15 @@ Build-Depends:
 Vcs-Browser: http://git.debian.org/?p=pkg-varnish/pkg-varnish.git;a=summary
 Vcs-Git: git://git.debian.org/pkg-varnish/pkg-varnish.git
 Homepage: http://varnish-cache.org/
-Standards-Version: 3.9.3
+Standards-Version: 3.9.6
 
 Package: varnish
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, gcc (>= 3.3), libc6-dev | libc6.1-dev | libc-dev, adduser, libvarnishapi1 (>= ${binary:Version})
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ adduser,
+ gcc,
+ libc6-dev | libc6.1-dev | libc-dev,
+ libvarnishapi1 (>= ${binary:Version})
 Suggests: varnish-doc
 Provides: varnish, ${Varnish:ABI}, ${Varnish:strictABI}
 Description: state of the art, high-performance web accelerator
@@ -59,6 +64,7 @@ Section: libs
 Architecture: any
 Provides: libvarnish1
 Conflicts: libvarnish1
+Pre-Depends: multiarch-support
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: shared libraries for Varnish
  Shared libraries for the Varnish HTTP accelerator.
@@ -66,7 +72,7 @@ Description: shared libraries for Varnish
 Package: libvarnishapi-dev
 Section: libdevel
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libvarnishapi1 (= ${binary:Version})
+Depends: ${shlibs:Depends}, ${misc:Depends}, libvarnishapi1 (= ${binary:Version}), python
 Provides: libvarnish-dev
 Conflicts: libvarnish-dev
 Description: development files for Varnish
diff --git a/libvarnishapi-dev.install b/libvarnishapi-dev.install
index 7c5c870..3fe4930 100644
--- a/libvarnishapi-dev.install
+++ b/libvarnishapi-dev.install
@@ -1,5 +1,6 @@
 usr/include
-usr/lib/libvarnishapi.so
-usr/lib/pkgconfig/*.pc
 usr/share/aclocal
-usr/share/varnish
+usr/share/varnish/include/* /usr/include/varnish
+usr/share/varnish/vmodtool.py
+/usr/lib/*/libvarnishapi.so
+/usr/lib/*/pkgconfig/*.pc
diff --git a/libvarnishapi1.install b/libvarnishapi1.install
index d0dbfd1..d6a64d3 100644
--- a/libvarnishapi1.install
+++ b/libvarnishapi1.install
@@ -1 +1 @@
-usr/lib/lib*.so.*
+/usr/lib/*/lib*.so.*
diff --git a/rules b/rules
index 20e921b..ebbacac 100755
--- a/rules
+++ b/rules
@@ -2,9 +2,8 @@
 
 DH_VERBOSE=1
 
-# List of architectures that lack the *_2POW definitions in varnish,
-# which is needed by jemalloc
-DISABLE_JEMALLOC_ARCH_LIST := hppa s390 sparc m68k
+# List of architectures where jemalloc is not available
+DISABLE_JEMALLOC_ARCH_LIST := hppa m68k
 
 # Explicitly initialize a variable to select architecture, unless it has been
 # defined before.  This is compared against the DISABLE_*_LIST variables later
@@ -27,7 +26,7 @@ VMOD_ABI = $(shell printf '\#include "vrt.h"\nvarnishabi- VRT_MAJOR_VERSION . VR
 
 # Main build rule, leave everything to debhelper
 %:
-	dh $@ --parallel
+	dh $@ --parallel --with=systemd,autoreconf
 
 ifeq (,$(filter test,$(LOCAL_BUILD_OPTIONS)))
 # Disable automated build tests
@@ -40,11 +39,8 @@ override_dh_auto_configure:
 
 override_dh_auto_install:
 	dh_auto_install -a
-	@ # Install the example as default.
-	mkdir -p $(CURDIR)/debian/tmp/etc/varnish/
-	install -o root -g root -m 644 $(CURDIR)/etc/example.vcl \
-		$(CURDIR)/debian/tmp/etc/varnish/default.vcl
-	rm $(CURDIR)/debian/tmp/usr/share/doc/varnish/*vcl
+	install -d debian/tmp/etc/varnish
+	install -T -m 0644 etc/example.vcl debian/tmp/etc/varnish/default.vcl
 	@ # Remove .la files
 	@ # (See http://wiki.debian.org/ReleaseGoals/LAFileRemoval)
 	find $(CURDIR)/debian/ -name \*.la -delete
diff --git a/varnish.NEWS b/varnish.NEWS
index 9daf13b..cdf0ce0 100644
--- a/varnish.NEWS
+++ b/varnish.NEWS
@@ -1,3 +1,15 @@
+varnish (4.0.0-1) unstable; urgency=medium
+
+  The syntax of the VCL has changed. If upgrading from a previous version of
+  varnish, you will need to update your VCL before varnish will start.
+
+  For instructions on rewriting your VCL, please see the file
+  /usr/share/doc/varnish-doc/html/whats-new/upgrading.html in the varnish-doc
+  package, or https://www.varnish-cache.org/docs/4.0/whats-new/upgrading.html
+  for online documentation
+
+ -- Stig Sandbeck Mathisen <ssm at debian.org>  Thu, 10 Apr 2014 13:53:53 +0200
+
 varnish (2.1.3-2) lucid; urgency=low
 
   Varnish will no longer start by default when installed.  Edit
diff --git a/varnish.init b/varnish.init
index fd8cd4b..b86a4f8 100644
--- a/varnish.init
+++ b/varnish.init
@@ -20,7 +20,7 @@ NAME=varnishd
 DESC="HTTP accelerator"
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/sbin/varnishd
-PIDFILE=/var/run/$NAME.pid
+PIDFILE=/run/$NAME.pid
 
 test -x $DAEMON || exit 0
 
@@ -73,6 +73,15 @@ stop_varnishd() {
     else
         log_end_msg 1
     fi
+
+    if test -r $PIDFILE; then
+        read -r PID < $PIDFILE
+        if test ! -d /proc/$PID ; then
+            # stale pidfile
+            unset PID
+            rm -f $PIDFILE
+        fi
+    fi
 }
 
 reload_varnishd() {
@@ -85,10 +94,18 @@ reload_varnishd() {
 }
 
 status_varnishd() {
-    status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
+    start-stop-daemon \
+        --status --quiet --pidfile $PIDFILE \
+        --exec $DAEMON
     exit $?
 }
 
+configtest() {
+    $DAEMON ${DAEMON_OPTS} -C -n /tmp > /dev/null
+}
+
+
+
 case "$1" in
     start)
         case "${START:-}" in
@@ -110,13 +127,20 @@ case "$1" in
         status_varnishd
         ;;
     restart|force-reload)
+	if status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" 1>/dev/null; then
+	    if ! configtest; then
+		log_failure_msg "Syntax check failed, not restarting"
+		exit 1
+	    fi
+	fi
         $0 stop
         $0 start
         ;;
+    configtest)
+        configtest && log_success_msg "Syntax ok"
+        ;;
     *)
-        log_success_msg "Usage: $0 {start|stop|restart|force-reload}"
+        log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload|configtest}"
         exit 1
         ;;
 esac
-
-exit 0
diff --git a/varnish.install b/varnish.install
index 172753c..580430d 100644
--- a/varnish.install
+++ b/varnish.install
@@ -1,6 +1,7 @@
 etc/varnish/default.vcl
 usr/bin/*
 usr/sbin/*
-usr/lib/varnish
+/usr/lib/*/varnish
 usr/share/man
 debian/*.service lib/systemd/system/
+usr/share/doc/varnish/*.vcl
diff --git a/varnish.logrotate b/varnish.logrotate
index 59ebe1b..010abe0 100644
--- a/varnish.logrotate
+++ b/varnish.logrotate
@@ -1,4 +1,4 @@
-/var/log/varnish/varnish.log /var/log/varnish/varnishncsa.log {
+/var/log/varnish/varnish.log {
   daily
   rotate 7
   missingok
@@ -6,10 +6,18 @@
   delaycompress
   missingok
   postrotate
-    for service in varnishlog varnishncsa; do
-      if /usr/bin/pgrep -P 1 $service >/dev/null; then
-        /usr/sbin/invoke-rc.d $service reload > /dev/null
-      fi
-    done
+    /usr/sbin/invoke-rc.d varnishlog reload > /dev/null
+  endscript
+}
+
+/var/log/varnish/varnishncsa.log {
+  daily
+  rotate 7
+  missingok
+  compress
+  delaycompress
+  missingok
+  postrotate
+    /usr/sbin/invoke-rc.d varnishncsa reload > /dev/null
   endscript
 }
diff --git a/varnish.postinst b/varnish.postinst
index 565f916..0bc7d0b 100644
--- a/varnish.postinst
+++ b/varnish.postinst
@@ -49,12 +49,6 @@ upgrade_change_log_permissions() {
     chown -Rhf ${log_user}: ${log_dir}
 }
 
-# varnish version 2.1.3-1 and older started varnishd at boot, we keep
-# this default for upgrading clients
-upgrade_enable_varnishd() {
-    sed -i '/^START=/s/no/yes/g' /etc/default/varnish
-}
-
 case ${1:-} in
     configure)
 
@@ -68,7 +62,6 @@ case ${1:-} in
 
         if dpkg --compare-versions "2.1.3-2" "gt-nl" "${2:-}" ; then
             upgrade_change_log_permissions
-            upgrade_enable_varnishd
         fi
         ;;
 esac
diff --git a/varnish.postrm b/varnish.postrm
index 8d852fa..026b5c5 100644
--- a/varnish.postrm
+++ b/varnish.postrm
@@ -9,25 +9,33 @@ case "$1" in
         remove|failed-upgrade|abort-install|abort-upgrade|disappear)
 
         if test -e /var/log/varnish ; then
+
             rm -r /var/log/varnish > /dev/null 2>&1 || exit 78
+
         fi
 
         if test -e /var/lib/varnish; then
+
                 rm -r /var/lib/varnish > /dev/null 2>&1 || exit 78
         fi
+
         ;;
 
         purge)
+
         if test -e /var/log/varnish; then
-            rm -r /var/log/varnish > /dev/null 2>&1 || exit 78
+
+                rm -r /var/log/varnish > /dev/null 2>&1 || exit 78
+
         fi
 
         if test -e /var/lib/varnish; then
-	    rm -r /var/lib/varnish > /dev/null 2>&1 || exit 78
+
+                rm -r /var/lib/varnish > /dev/null 2>&1 || exit 78
         fi
-        
-	rm -f /etc/varnish/secret
-	dpkg-statoverride --remove /var/log/varnish || true
+
+        rm -f /etc/varnish/secret
+
         ;;
 
     *)
diff --git a/varnish.service b/varnish.service
index e2eb99b..0e2050a 100644
--- a/varnish.service
+++ b/varnish.service
@@ -5,7 +5,9 @@ Description=Varnish HTTP accelerator
 Type=forking
 LimitNOFILE=131072
 LimitMEMLOCK=82000
+ExecStartPre=/usr/sbin/varnishd -C -f /etc/varnish/default.vcl
 ExecStart=/usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
+ExecReload=/usr/share/varnish/reload-vcl
 
 [Install]
 WantedBy=multi-user.target
diff --git a/varnish.varnishlog.init b/varnish.varnishlog.init
index 1574ace..4597934 100644
--- a/varnish.varnishlog.init
+++ b/varnish.varnishlog.init
@@ -17,7 +17,7 @@ NAME=varnishlog
 DESC="HTTP accelerator log deamon"
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/bin/$NAME
-PIDFILE=/var/run/$NAME/$NAME.pid
+PIDFILE=/run/$NAME/$NAME.pid
 LOGFILE=/var/log/varnish/varnish.log
 USER=varnishlog
 DAEMON_OPTS="-a -w ${LOGFILE} -D -P $PIDFILE"
@@ -103,5 +103,3 @@ case "$1" in
         exit 1
         ;;
 esac
-
-exit 0
diff --git a/varnish.varnishncsa.default b/varnish.varnishncsa.default
index e8ad83e..de36fb4 100644
--- a/varnish.varnishncsa.default
+++ b/varnish.varnishncsa.default
@@ -1,5 +1,7 @@
 # Configuration file for varnishncsa
 #
+# This shell script fragment is sourced by /etc/init.d/varnishncsa
+#
 # Note: If systemd is installed, this file is obsolete and ignored.  You will
 # need to copy /lib/systemd/system/varnishncsa.service to /etc/systemd/system/
 # and edit that file.
@@ -10,3 +12,8 @@
 #
 # NCSA log format, to be used by HTTP log analyzers
 # VARNISHNCSA_ENABLED=1
+#
+# If you want to add more arguments to varnishncsa, such as providing
+# a different log format, you can override the DAEMON_OPTS variable
+# from /etc/init.d/varnishncsa here.
+# DAEMON_OPTS="-a -w ${LOGFILE} -D -P ${PIDFILE}"
diff --git a/varnish.varnishncsa.init b/varnish.varnishncsa.init
index 1d098ad..9799d5a 100644
--- a/varnish.varnishncsa.init
+++ b/varnish.varnishncsa.init
@@ -17,7 +17,7 @@ NAME=varnishncsa
 DESC="HTTP accelerator log deamon"
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/bin/$NAME
-PIDFILE=/var/run/$NAME/$NAME.pid
+PIDFILE=/run/$NAME/$NAME.pid
 LOGFILE=/var/log/varnish/varnishncsa.log
 USER=varnishlog
 DAEMON_OPTS="-a -w ${LOGFILE} -D -P ${PIDFILE}"
@@ -103,5 +103,3 @@ case "$1" in
         exit 1
         ;;
 esac
-
-exit 0
diff --git a/varnishlog.service b/varnishlog.service
index 24cf0de..189aa2e 100644
--- a/varnishlog.service
+++ b/varnishlog.service
@@ -1,9 +1,11 @@
 [Unit]
 Description=Varnish HTTP accelerator log daemon
+After=varnish.service
 
 [Service]
 User=varnishlog
 ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log
+ExecReload=/bin/kill -HUP $MAINPID
 
 [Install]
 WantedBy=multi-user.target
diff --git a/varnishncsa.service b/varnishncsa.service
index 4542e50..c9fe95c 100644
--- a/varnishncsa.service
+++ b/varnishncsa.service
@@ -1,9 +1,11 @@
 [Unit]
 Description=Varnish HTTP accelerator log daemon
+After=varnish.service
 
 [Service]
 User=varnishlog
 ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log
+ExecReload=/bin/kill -HUP $MAINPID
 
 [Install]
 WantedBy=multi-user.target
diff --git a/watch b/watch
index 7f9d001..4ad9629 100644
--- a/watch
+++ b/watch
@@ -1,3 +1,3 @@
 version=3
 
-opts="uversionmangle=s/-(beta|rc)/~$1/" http://repo.varnish-cache.org/source/varnish-(\d.*)\.tar\.gz
+opts="uversionmangle=s/-(beta|rc|tp)/~$1/" http://repo.varnish-cache.org/source/varnish-(\d.*)\.tar\.gz



More information about the varnish-commit mailing list