From bb8d82a2c6cc377f0f5843750d0fe6b45eecc7cc9454f2d900fe0b2955f035bd Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 15 Apr 2011 08:09:03 +0000 Subject: [PATCH 01/13] . OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=44 --- varnish.changes | 1 + varnish.spec | 25 ++++++++----------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/varnish.changes b/varnish.changes index 11ce118..176aef3 100644 --- a/varnish.changes +++ b/varnish.changes @@ -2,6 +2,7 @@ Sun Apr 3 23:38:24 UTC 2011 - jengelh@medozas.de - Fix security-problematic ownership of /etc/varnish files + (bnc#678811) - Run spec-beautifier over it - Replace default shipped vcl.conf by something working - Run as varnish user diff --git a/varnish.spec b/varnish.spec index e685eb7..4e4bc2f 100644 --- a/varnish.spec +++ b/varnish.spec @@ -1,7 +1,7 @@ # -# spec file for package varnish +# spec file for package varnish (Version 2.0.5) # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,13 +20,13 @@ Name: varnish Version: 2.1.3 -Release: 5 +Release: 0 # License: BSD Group: Productivity/Networking/Web/Proxy # -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: libxslt ncurses-devel pcre-devel pkg-config +BuildRoot: %_tmppath/%name-%version-build +BuildRequires: libxslt, ncurses-devel, pcre-devel, pkg-config Prereq(post): %_sbindir/useradd %_sbindir/groupadd %if 0%{?suse_version} Recommends: logrotate @@ -35,16 +35,15 @@ Recommends: logrotate %define pkg_logdir %_localstatedir/log/%name %define pkg_cachedir %_localstatedir/cache/%name # -Url: http://www.varnish-cache.org/ +URL: http://www.varnish-cache.org/ Source0: http://downloads.sourceforge.net/varnish/varnish-%version.tar.gz # http://downloads.sourceforge.net/varnish/varnish-%version.tar.bz2 Source2: varnish.init Source3: varnish.sysconfig -Source4: vcl.conf -Source5: varnish.logrotate +Source4: vcl.conf +Source5: varnish.logrotate # Summary: Varnish is a high-performance HTTP accelerator - %description Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy) is an application that stores (caches) documents that have been @@ -61,14 +60,10 @@ Authors: Poul-Henning Kamp %define library_name libvarnish1 - %package -n %library_name - - Group: Productivity/Networking/Web/Proxy # Summary: Shared libraries for Varnish - %description -n %library_name Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy) is an application that stores (caches) documents that have been @@ -89,13 +84,10 @@ Authors: %package devel - - Group: Development/Libraries/C and C++ Requires: %name = %version # Summary: Development files for Varnish - %description devel Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy) is an application that stores (caches) documents that have been @@ -175,7 +167,6 @@ mkdir -p "%buildroot/%_localstatedir/log/varnish" %endif %post -n %library_name -p /sbin/ldconfig - %postun -n %library_name -p /sbin/ldconfig %files From e5736c01a22089216d3b44ba19b03287532746d7cd3bbe1436dff2cf5b9657d7 Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Fri, 15 Apr 2011 22:38:17 +0000 Subject: [PATCH 02/13] - use pkgconfig instead of pkg-config on SLES 9 OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=45 --- varnish.changes | 5 +++++ varnish.spec | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/varnish.changes b/varnish.changes index 176aef3..c25b73c 100644 --- a/varnish.changes +++ b/varnish.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Apr 15 22:36:02 UTC 2011 - mrueckert@suse.de + +- use pkgconfig instead of pkg-config on SLES 9 + ------------------------------------------------------------------- Sun Apr 3 23:38:24 UTC 2011 - jengelh@medozas.de diff --git a/varnish.spec b/varnish.spec index 4e4bc2f..db40484 100644 --- a/varnish.spec +++ b/varnish.spec @@ -26,7 +26,12 @@ License: BSD Group: Productivity/Networking/Web/Proxy # BuildRoot: %_tmppath/%name-%version-build -BuildRequires: libxslt, ncurses-devel, pcre-devel, pkg-config +BuildRequires: libxslt, ncurses-devel, pcre-devel +%if %{suse_version} >= 1010 +BuildRequires: pkg-config +%else +BuildRequires: pkgconfig +%endif Prereq(post): %_sbindir/useradd %_sbindir/groupadd %if 0%{?suse_version} Recommends: logrotate From a01483ae9c2946430914fb0e11bc4d25de5755e3608fc059c627cd18fe748a74 Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Fri, 15 Apr 2011 22:59:54 +0000 Subject: [PATCH 03/13] - only use recommends on sle 10 or newer OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=46 --- varnish.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/varnish.spec b/varnish.spec index db40484..703174d 100644 --- a/varnish.spec +++ b/varnish.spec @@ -33,7 +33,7 @@ BuildRequires: pkg-config BuildRequires: pkgconfig %endif Prereq(post): %_sbindir/useradd %_sbindir/groupadd -%if 0%{?suse_version} +%if 0%{?suse_version} >= 1010 Recommends: logrotate %endif %define pkg_home %_localstatedir/lib/%name From 30c7794caf7c6712a8f590e27a5620f487fa7f800eccb7a72a1985ceca3df165 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 27 Apr 2011 16:15:53 +0000 Subject: [PATCH 04/13] Accepting request 67653 from home:elvigia:branches:server:http tbr OBS-URL: https://build.opensuse.org/request/show/67653 OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=47 --- _service | 12 ++++++++++++ _service:download_url:varnish-2.1.5.tar.gz | 3 +++ varnish-2.1.3.tar.gz | 3 --- varnish.changes | 18 ++++++++++++++++++ varnish.spec | 6 +++--- 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 _service create mode 100644 _service:download_url:varnish-2.1.5.tar.gz delete mode 100644 varnish-2.1.3.tar.gz diff --git a/_service b/_service new file mode 100644 index 0000000..f2fb70e --- /dev/null +++ b/_service @@ -0,0 +1,12 @@ + + + http + repo.varnish-cache.org + /source/varnish-2.1.5.tar.gz + + + _service:download_url:varnish-2.1.5.tar.gz + sha256 + 2d8049be14ada035d0e3a54c2b519143af40d03d917763cf72d53d8188e5ef83 + + \ No newline at end of file diff --git a/_service:download_url:varnish-2.1.5.tar.gz b/_service:download_url:varnish-2.1.5.tar.gz new file mode 100644 index 0000000..b0f604c --- /dev/null +++ b/_service:download_url:varnish-2.1.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d8049be14ada035d0e3a54c2b519143af40d03d917763cf72d53d8188e5ef83 +size 1530856 diff --git a/varnish-2.1.3.tar.gz b/varnish-2.1.3.tar.gz deleted file mode 100644 index 318d1b5..0000000 --- a/varnish-2.1.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:09a97dabbc081a28f3b4530491fcbc6f2510ee9964794e24cbc9f1f6935340ef -size 886945 diff --git a/varnish.changes b/varnish.changes index c25b73c..1c17427 100644 --- a/varnish.changes +++ b/varnish.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Sat Apr 16 17:26:10 UTC 2011 - crrodriguez@opensuse.org + +- remove configure option --enable-debugging-symbols + it overrides buildsystem optimization levels. + +------------------------------------------------------------------- +Sat Apr 16 17:12:11 UTC 2011 - crrodriguez@opensuse.org + +- Update to version 2.1.5 + * Two bugs relating to Content-Length and possible duplication + of Content-Length headers have been resolved. + * Fixed an issue with re-using connections after Chunked-Encoding. + * Use the time of cache-insertion for "If-Modified-Since" requests + if a "Last-Modified" header isn't provided by the backend. + * Merge multi-line Vary and Cache-Control headers from clients, + which Google Chromium seem to split up. + ------------------------------------------------------------------- Fri Apr 15 22:36:02 UTC 2011 - mrueckert@suse.de diff --git a/varnish.spec b/varnish.spec index 703174d..0f2aae2 100644 --- a/varnish.spec +++ b/varnish.spec @@ -19,7 +19,7 @@ Name: varnish -Version: 2.1.3 +Version: 2.1.5 Release: 0 # License: BSD @@ -119,8 +119,8 @@ Authors: %if 0%{?suse_version} > 1000 export CFLAGS="%optflags -fstack-protector" %endif -%configure --disable-static --localstatedir=%_localstatedir/cache/ \ - --enable-debugging-symbols \ +%configure --disable-static \ + --localstatedir=%_localstatedir/cache/ \ --enable-developer-warnings make %{?_smp_mflags} From 75c7d87f692cfc1e144a1e0780d643c44829bc7a8c25a7611fecbcf3fd3a73fb Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 27 Apr 2011 16:19:51 +0000 Subject: [PATCH 05/13] with tarballs OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=48 --- _service | 12 ------------ _service:download_url:varnish-2.1.5.tar.gz | 3 --- varnish-2.1.5.tar.xz | 3 +++ varnish.spec | 3 ++- 4 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 _service delete mode 100644 _service:download_url:varnish-2.1.5.tar.gz create mode 100644 varnish-2.1.5.tar.xz diff --git a/_service b/_service deleted file mode 100644 index f2fb70e..0000000 --- a/_service +++ /dev/null @@ -1,12 +0,0 @@ - - - http - repo.varnish-cache.org - /source/varnish-2.1.5.tar.gz - - - _service:download_url:varnish-2.1.5.tar.gz - sha256 - 2d8049be14ada035d0e3a54c2b519143af40d03d917763cf72d53d8188e5ef83 - - \ No newline at end of file diff --git a/_service:download_url:varnish-2.1.5.tar.gz b/_service:download_url:varnish-2.1.5.tar.gz deleted file mode 100644 index b0f604c..0000000 --- a/_service:download_url:varnish-2.1.5.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2d8049be14ada035d0e3a54c2b519143af40d03d917763cf72d53d8188e5ef83 -size 1530856 diff --git a/varnish-2.1.5.tar.xz b/varnish-2.1.5.tar.xz new file mode 100644 index 0000000..372e6d0 --- /dev/null +++ b/varnish-2.1.5.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec04d8dd3e498b570294fb0c6fbb4a2ae4005b039436e2f8913660be598b3c70 +size 846684 diff --git a/varnish.spec b/varnish.spec index 0f2aae2..54ffef6 100644 --- a/varnish.spec +++ b/varnish.spec @@ -41,7 +41,7 @@ Recommends: logrotate %define pkg_cachedir %_localstatedir/cache/%name # URL: http://www.varnish-cache.org/ -Source0: http://downloads.sourceforge.net/varnish/varnish-%version.tar.gz +Source0: %name-%version.tar.xz # http://downloads.sourceforge.net/varnish/varnish-%version.tar.bz2 Source2: varnish.init Source3: varnish.sysconfig @@ -49,6 +49,7 @@ Source4: vcl.conf Source5: varnish.logrotate # Summary: Varnish is a high-performance HTTP accelerator +BuildRequires: xz %description Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy) is an application that stores (caches) documents that have been From 387c352a0f1680b45db1573510e9c4cd5de475503ba3b669bc2256998ac2b71b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 10 May 2011 14:18:49 +0000 Subject: [PATCH 06/13] Accepting request 69979 from home:elvigia:branches:server:http - Varnish Requires a C compiler, the vcl scripts are compiled and loaded as DSO. OBS-URL: https://build.opensuse.org/request/show/69979 OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=49 --- varnish.changes | 6 ++++++ varnish.spec | 1 + 2 files changed, 7 insertions(+) diff --git a/varnish.changes b/varnish.changes index 1c17427..4278749 100644 --- a/varnish.changes +++ b/varnish.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 10 14:01:13 UTC 2011 - crrodriguez@opensuse.org + +- Varnish Requires a C compiler, the vcl scripts are compiled + and loaded as DSO. + ------------------------------------------------------------------- Sat Apr 16 17:26:10 UTC 2011 - crrodriguez@opensuse.org diff --git a/varnish.spec b/varnish.spec index 54ffef6..4d90a9a 100644 --- a/varnish.spec +++ b/varnish.spec @@ -50,6 +50,7 @@ Source5: varnish.logrotate # Summary: Varnish is a high-performance HTTP accelerator BuildRequires: xz +Requires: c_compiler %description Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy) is an application that stores (caches) documents that have been From 6e7c66d0634a15e3f4c11150f481a6d9f5a6228cf33263e15c91b9b2957ac99d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 9 Dec 2011 04:53:26 +0000 Subject: [PATCH 07/13] Accepting request 95972 from devel:openSUSE:Factory:for-legal - fix license to be in spdx.org format OBS-URL: https://build.opensuse.org/request/show/95972 OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=50 --- varnish.changes | 5 +++++ varnish.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/varnish.changes b/varnish.changes index 4278749..e8a4189 100644 --- a/varnish.changes +++ b/varnish.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Dec 8 13:51:14 UTC 2011 - coolo@suse.com + +- fix license to be in spdx.org format + ------------------------------------------------------------------- Tue May 10 14:01:13 UTC 2011 - crrodriguez@opensuse.org diff --git a/varnish.spec b/varnish.spec index 4d90a9a..3055ca1 100644 --- a/varnish.spec +++ b/varnish.spec @@ -22,7 +22,7 @@ Name: varnish Version: 2.1.5 Release: 0 # -License: BSD +License: BSD2c Group: Productivity/Networking/Web/Proxy # BuildRoot: %_tmppath/%name-%version-build From d85a0ca41d52b4c71b3341d3ace00b8a1769e7c413333e2cb76c6efaab3bdb17 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 8 Feb 2012 23:28:53 +0000 Subject: [PATCH 08/13] varnish 3.0.2 OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=51 --- varnish-2.1.5.tar.xz | 3 -- varnish-3.0.2.tar.xz | 3 ++ varnish.changes | 12 +++++ varnish.spec | 104 +++++++++++++++---------------------------- 4 files changed, 52 insertions(+), 70 deletions(-) delete mode 100644 varnish-2.1.5.tar.xz create mode 100644 varnish-3.0.2.tar.xz diff --git a/varnish-2.1.5.tar.xz b/varnish-2.1.5.tar.xz deleted file mode 100644 index 372e6d0..0000000 --- a/varnish-2.1.5.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ec04d8dd3e498b570294fb0c6fbb4a2ae4005b039436e2f8913660be598b3c70 -size 846684 diff --git a/varnish-3.0.2.tar.xz b/varnish-3.0.2.tar.xz new file mode 100644 index 0000000..1ba760c --- /dev/null +++ b/varnish-3.0.2.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81243b849308defc2996ed72a1f4acc1351b3ae4ce8fc57d608d0e9429581f9e +size 1101616 diff --git a/varnish.changes b/varnish.changes index e8a4189..4622644 100644 --- a/varnish.changes +++ b/varnish.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Wed Feb 8 23:26:10 UTC 2012 - jengelh@medozas.de + +- Update to new upstream release 3.0.2 +* Add support for ESI and gzip +* Handle objects larger than 2G +* HTTP Range support is now enabled by default +* "307 Temporary redirect" is now considered cacheable +* see ChangeLog (packaged) or + http://varnish-cache.org/trac/browser/doc/changes.rst + for details + ------------------------------------------------------------------- Thu Dec 8 13:51:14 UTC 2011 - coolo@suse.com diff --git a/varnish.spec b/varnish.spec index 3055ca1..6cbf55f 100644 --- a/varnish.spec +++ b/varnish.spec @@ -15,23 +15,25 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - - Name: varnish -Version: 2.1.5 +%define library_name libvarnishapi1 +Version: 3.0.2 Release: 0 -# -License: BSD2c +Summary: Varnish is a high-performance HTTP accelerator +License: BSD-2-Clause Group: Productivity/Networking/Web/Proxy -# +URL: http://varnish-cache.org/ + +#DL-URL: http://downloads.sourceforge.net/varnish/varnish-%version.tar.bz2 +Source0: %name-%version.tar.xz +Source2: varnish.init +Source3: varnish.sysconfig +Source4: vcl.conf +Source5: varnish.logrotate + BuildRoot: %_tmppath/%name-%version-build BuildRequires: libxslt, ncurses-devel, pcre-devel -%if %{suse_version} >= 1010 -BuildRequires: pkg-config -%else -BuildRequires: pkgconfig -%endif +BuildRequires: pkgconfig, xz Prereq(post): %_sbindir/useradd %_sbindir/groupadd %if 0%{?suse_version} >= 1010 Recommends: logrotate @@ -39,18 +41,8 @@ Recommends: logrotate %define pkg_home %_localstatedir/lib/%name %define pkg_logdir %_localstatedir/log/%name %define pkg_cachedir %_localstatedir/cache/%name -# -URL: http://www.varnish-cache.org/ -Source0: %name-%version.tar.xz -# http://downloads.sourceforge.net/varnish/varnish-%version.tar.bz2 -Source2: varnish.init -Source3: varnish.sysconfig -Source4: vcl.conf -Source5: varnish.logrotate -# -Summary: Varnish is a high-performance HTTP accelerator -BuildRequires: xz Requires: c_compiler + %description Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy) is an application that stores (caches) documents that have been @@ -61,16 +53,10 @@ given the cached document, or a "fresh" document requested from a backend server. The purpose of this is to minimize the requests going to the backend server(s) by serving the same document to potentially many users. - -Authors: --------- - Poul-Henning Kamp - -%define library_name libvarnish1 %package -n %library_name Group: Productivity/Networking/Web/Proxy -# Summary: Shared libraries for Varnish + %description -n %library_name Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy) is an application that stores (caches) documents that have been @@ -81,20 +67,13 @@ given the cached document, or a "fresh" document requested from a backend server. The purpose of this is to minimize the requests going to the backend server(s) by serving the same document to potentially many users. - This package holds the shared libraries for varnish. - -Authors: --------- - Poul-Henning Kamp - - %package devel Group: Development/Libraries/C and C++ Requires: %name = %version -# Summary: Development files for Varnish + %description devel Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy) is an application that stores (caches) documents that have been @@ -105,15 +84,8 @@ given the cached document, or a "fresh" document requested from a backend server. The purpose of this is to minimize the requests going to the backend server(s) by serving the same document to potentially many users. - This package holds the development files for varnish. - -Authors: --------- - Poul-Henning Kamp - - %prep %setup -q @@ -150,7 +122,7 @@ install -D -m 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf install -D -m 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf.example find "%buildroot" -type f -name "*.la" -delete -mkdir -p "%buildroot/%_localstatedir/log/varnish" +mkdir -p "%buildroot/%pkg_logdir" %pre %_bindir/getent group varnish >/dev/null || \ @@ -177,39 +149,37 @@ mkdir -p "%buildroot/%_localstatedir/log/varnish" %postun -n %library_name -p /sbin/ldconfig %files -%defattr(-,root,root,-) +%defattr(-,root,root) +%_initrddir/%name +%config(noreplace) %_sysconfdir/logrotate.d/varnish +%dir %attr(0750,root,varnish) %_sysconfdir/%name/ +%config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf +%config %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf.example +%config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/default.vcl +%_libdir/varnish +%_sbindir/varnish* +%_mandir/man*/* +%doc ChangeLog LICENSE README +%dir %attr(0750,varnish,varnish) %pkg_home +%dir %attr(0750,varnish,varnish) %pkg_cachedir +%dir %attr(0750,varnish,varnish) %pkg_logdir + %if 0%{?suse_version} %_sbindir/rc%name -/var/adm/fillup-templates/sysconfig.%name +%_localstatedir/adm/fillup-templates/sysconfig.%name %else %config(noreplace) %_sysconfdir/sysconfig/%name -%endif -%config(noreplace) %_sysconfdir/init.d/%name -# -%dir %attr(750,root,varnish) %_sysconfdir/%name/ -%config(noreplace) %attr(640,root,varnish) %_sysconfdir/%name/vcl.conf -%config %attr(640,root,varnish) %_sysconfdir/%name/vcl.conf.example -%config(noreplace) %attr(640,root,varnish) %_sysconfdir/%name/default.vcl -# -%_sbindir/* -%doc %_mandir/*/* -%doc ChangeLog LICENSE README -%if ! 0%{?suse_version} %doc redhat/README.redhat %endif -%dir %attr(750,varnish,varnish) %pkg_home -%dir %attr(750,varnish,varnish) %pkg_cachedir -%config(noreplace) %_sysconfdir/logrotate.d/varnish -%dir %attr(750,varnish,varnish) %_localstatedir/log/varnish %files -n %library_name %defattr(-,root,root,-) -%_libdir/*.so.* +%_libdir/libvarnishapi.so.1* %files devel %defattr(-,root,root,-) -%_includedir/varnish/ +%_includedir/varnish %_libdir/pkgconfig/* -%_libdir/*.so +%_libdir/libvarnishapi.so %changelog From 5fe83bda9c41e14242ddb16dfac44db5d7b4c5994322ce63b84f18db6d36fc48 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 18 Feb 2012 00:56:34 +0000 Subject: [PATCH 09/13] systemd unit files OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=52 --- varnish.changes | 4 ++ varnish.init | 12 +--- varnish.service | 11 +++ varnish.spec | 37 +++++----- varnish.sysconfig | 2 +- varnishlog.init | 164 +++++++++++++++++++++++++++++++++++++++++++++ varnishlog.service | 10 +++ 7 files changed, 212 insertions(+), 28 deletions(-) create mode 100644 varnish.service create mode 100644 varnishlog.init create mode 100644 varnishlog.service diff --git a/varnish.changes b/varnish.changes index 4622644..0df15cd 100644 --- a/varnish.changes +++ b/varnish.changes @@ -9,6 +9,10 @@ Wed Feb 8 23:26:10 UTC 2012 - jengelh@medozas.de * see ChangeLog (packaged) or http://varnish-cache.org/trac/browser/doc/changes.rst for details +- Note that the -s file,/var/cache/varnish,524288 argument (check + /etc/sysconfig/varnish) needs at least "1M" instead of 524288 + or the daemon will not start anymore. +- Add systemd unit files ------------------------------------------------------------------- Thu Dec 8 13:51:14 UTC 2011 - coolo@suse.com diff --git a/varnish.init b/varnish.init index 7dca46c..0b3c2d9 100644 --- a/varnish.init +++ b/varnish.init @@ -79,13 +79,10 @@ case "$1" in echo -n "Starting varnish " ## Start daemon with startproc(8). If this fails ## the return value is set appropriately by startproc. - /sbin/startproc "$VARNISHD_BIN" -P "$VARNISHD_PID" ${VARNISHD_PARAMS:--f /etc/varnish/vcl.conf -T:6082 -s file,/var/cache/varnish,524288 -u varnish} + /sbin/startproc "$VARNISHD_BIN" -P "$VARNISHD_PID" ${VARNISHD_PARAMS:--f /etc/varnish/vcl.conf -T:6082 -s file,/var/cache/varnish,1M -u varnish} # Remember status and be verbose rc_status -v - echo -n "Starting varnishlog " - /sbin/startproc "$VARNISHLOG_BIN" -P "$VARNISHLOG_PID" ${VARNISHLOG_PARAMS:--a -w /var/log/varnish/varnish.log} - rc_status -v ;; stop) echo -n "Shutting down varnish " @@ -96,8 +93,6 @@ case "$1" in # Remember status and be verbose rc_status -v - echo -n "Shutting down varnishlog " - /sbin/killproc -p "$VARNISHLOG_PID" "$VARNISHLOG_BIN" ;; try-restart|condrestart) ## Do a restart only if the service was active before. @@ -149,8 +144,6 @@ case "$1" in /sbin/killproc -p "$VARNISHD_PID" -HUP "$VARNISHD_BIN" #touch /var/run/varnish.pid rc_status -v - echo -n "Reload service varnishlog " - /sbin/killproc -p "$VARNISHLOG_PID" -HUP "$VARNISHLOG_BIN" ## Otherwise if it does not support reload: #rc_failed 3 @@ -174,9 +167,6 @@ case "$1" in # NOTE: rc_status knows that we called this init script with # "status" option and adapts its messages accordingly. rc_status -v - echo -n "Checking for service varnishlog " - /sbin/checkproc -p "$VARNISHLOG_PID" "$VARNISHLOG_BIN" - rc_status -v ;; probe) ## Optional: Probe for the necessity of a reload, print out the diff --git a/varnish.service b/varnish.service new file mode 100644 index 0000000..29df45e --- /dev/null +++ b/varnish.service @@ -0,0 +1,11 @@ +[Unit] +Description=Varnish HTTP accelerator/reverse proxy +After=network.target + +[Service] +EnvironmentFile=/etc/sysconfig/varnish +PIDFile=/var/run/varnishd.pid +ExecStart=/usr/sbin/varnishd $VARNISHD_PARAMS -P /var/run/varnishd.pid -F + +[Install] +WantedBy=multi-user.target diff --git a/varnish.spec b/varnish.spec index 6cbf55f..954f930 100644 --- a/varnish.spec +++ b/varnish.spec @@ -24,12 +24,15 @@ License: BSD-2-Clause Group: Productivity/Networking/Web/Proxy URL: http://varnish-cache.org/ -#DL-URL: http://downloads.sourceforge.net/varnish/varnish-%version.tar.bz2 +#DL-URL: http://downloads.sf.net/varnish/%name-%version.tar.bz2 Source0: %name-%version.tar.xz Source2: varnish.init Source3: varnish.sysconfig Source4: vcl.conf Source5: varnish.logrotate +Source6: varnishlog.init +Source7: varnish.service +Source8: varnishlog.service BuildRoot: %_tmppath/%name-%version-build BuildRequires: libxslt, ncurses-devel, pcre-devel @@ -110,16 +113,18 @@ mv %buildroot/%_bindir/* %buildroot/%_sbindir/ # ##missing directories install -d -m 0755 %buildroot{%pkg_logdir,%pkg_home} -install -D -m 0644 %{S:5} %buildroot%_sysconfdir/logrotate.d/varnish +install -Dpm 0644 %{S:5} %buildroot%_sysconfdir/logrotate.d/varnish # ##init scripts -install -D -m 0644 %{S:3} %buildroot/var/adm/fillup-templates/sysconfig.%name -install -D -m 0755 %{S:2} %buildroot%_sysconfdir/init.d/%name -ln -s -f %_sysconfdir/init.d/%name %buildroot%_sbindir/rc%name +install -Dpm 0644 %{S:3} %buildroot/var/adm/fillup-templates/sysconfig.%name +install -Dpm 0755 %{S:2} %buildroot/%_initddir/varnish +install -Dpm 0755 %{S:6} %buildroot/%_initddir/varnishlog +install -Dpm 0644 "%{S:7}" "%buildroot/lib/systemd/system/varnish.service"; +install -Dpm 0644 "%{S:8}" "%buildroot/lib/systemd/system/varnishlog.service"; # ##config files -install -D -m 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf -install -D -m 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf.example +install -Dpm 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf +install -Dpm 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf.example find "%buildroot" -type f -name "*.la" -delete mkdir -p "%buildroot/%pkg_logdir" @@ -130,27 +135,28 @@ mkdir -p "%buildroot/%pkg_logdir" %_bindir/getent passwd varnish >/dev/null || \ %_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \ -d %pkg_home varnish || : -%if 0%{?suse_version} %post -%fillup_and_insserv %name +%fillup_and_insserv varnish +%fillup_and_insserv varnishlog %preun -%stop_on_removal %name +%stop_on_removal varnish +%stop_on_removal varnishlog %postun -%restart_on_update %name +%restart_on_update varnish +%restart_on_update varnishlog %insserv_cleanup -%else -# how to do the same for RH/mandriva? -%endif %post -n %library_name -p /sbin/ldconfig %postun -n %library_name -p /sbin/ldconfig %files %defattr(-,root,root) -%_initrddir/%name +%_initddir/varnish +%_initddir/varnishlog +/lib/systemd %config(noreplace) %_sysconfdir/logrotate.d/varnish %dir %attr(0750,root,varnish) %_sysconfdir/%name/ %config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf @@ -165,7 +171,6 @@ mkdir -p "%buildroot/%pkg_logdir" %dir %attr(0750,varnish,varnish) %pkg_logdir %if 0%{?suse_version} -%_sbindir/rc%name %_localstatedir/adm/fillup-templates/sysconfig.%name %else %config(noreplace) %_sysconfdir/sysconfig/%name diff --git a/varnish.sysconfig b/varnish.sysconfig index f3b0bbb..9c271e9 100644 --- a/varnish.sysconfig +++ b/varnish.sysconfig @@ -10,7 +10,7 @@ # # You might want to keep "/var/cache/varnish" when using the file backend. # -VARNISHD_PARAMS="-f /etc/varnish/vcl.conf -T:6082 -s file,/var/cache/varnish,524288 -u varnish" +VARNISHD_PARAMS="-f /etc/varnish/vcl.conf -T:6082 -s file,/var/cache/varnish,1M -u varnish" ## Path: Network/WWW/Varnishd ## Description: Start parameters for varnishlog diff --git a/varnishlog.init b/varnishlog.init new file mode 100644 index 0000000..fa4ca35 --- /dev/null +++ b/varnishlog.init @@ -0,0 +1,164 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: varnishlog +# Required-Start: $syslog $remote_fs +# Should-Start: $time ypbind sendmail +# Required-Stop: $syslog $remote_fs +# Should-Stop: $time ypbind sendmail +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: varnish logger +# Description: varnish logger +### END INIT INFO + +# Check for missing binaries (stale symlinks should not happen) +# Note: Special treatment of stop for LSB conformance +VARNISH_BIN=/usr/sbin/varnishd +test -x $VARNISH_BIN || { echo "$VARNISH_BIN not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + +# Check for existence of needed config file and read it +VARNISH_CONFIG=/etc/sysconfig/varnish +test -r $VARNISH_CONFIG || { echo "$VARNISH_CONFIG not existing"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } + +VARNISHD_BIN="$VARNISH_BIN" +VARNISHD_PID=/var/run/varnishd.pid +VARNISHLOG_BIN=/usr/sbin/varnishncsa +VARNISHLOG_PID=/var/run/varnishlog.pid + +# Read config +. $VARNISH_CONFIG + +# Source LSB init functions +# providing start_daemon, killproc, pidofproc, +# log_success_msg, log_failure_msg and log_warning_msg. +# This is currently not used by UnitedLinux based distributions and +# not needed for init scripts for UnitedLinux only. If it is used, +# the functions from rc.status should not be sourced or used. +#. /lib/lsb/init-functions + +# Shell functions sourced from /etc/rc.status: +# rc_check check and set local and overall rc status +# rc_status check and set local and overall rc status +# rc_status -v be verbose in local rc status and clear it afterwards +# rc_status -v -r ditto and clear both the local and overall rc status +# rc_status -s display "skipped" and exit with status 3 +# rc_status -u display "unused" and exit with status 3 +# rc_failed set local and overall rc status to failed +# rc_failed set local and overall rc status to +# rc_reset clear both the local and overall rc status +# rc_exit exit appropriate to overall rc status +# rc_active checks whether a service is activated by symlinks +. /etc/rc.status + +# Reset status of this service +rc_reset + +# Return values acc. to LSB for all commands but status: +# 0 - success +# 1 - generic or unspecified error +# 2 - invalid or excess argument(s) +# 3 - unimplemented feature (e.g. "reload") +# 4 - user had insufficient privileges +# 5 - program is not installed +# 6 - program is not configured +# 7 - program is not running +# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl) +# +# Note that starting an already running service, stopping +# or restarting a not-running service as well as the restart +# with force-reload (in case signaling is not supported) are +# considered a success. + +case "$1" in + start) + echo -n "Starting varnishlog " + /sbin/startproc "$VARNISHLOG_BIN" -P "$VARNISHLOG_PID" ${VARNISHLOG_PARAMS:--a -w /var/log/varnish/varnish.log} + rc_status -v + ;; + stop) + echo -n "Shutting down varnishlog " + /sbin/killproc -p "$VARNISHLOG_PID" "$VARNISHLOG_BIN" + rc_status -v + ;; + try-restart|condrestart) + ## Do a restart only if the service was active before. + ## Note: try-restart is now part of LSB (as of 1.9). + ## RH has a similar command named condrestart. + if test "$1" = "condrestart"; then + echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" + fi + $0 status + if test $? = 0; then + $0 restart + else + rc_reset # Not running is not a failure. + fi + # Remember status and be quiet + rc_status + ;; + restart) + ## Stop the service and regardless of whether it was + ## running or not, start it again. + $0 stop + $0 start + + # Remember status and be quiet + rc_status + ;; + force-reload) + ## Signal the daemon to reload its config. Most daemons + ## do this on signal 1 (SIGHUP). + ## If it does not support it, restart the service if it + ## is running. + + "$0" reload + rc_status + + ## Otherwise: + #$0 try-restart + #rc_status + ;; + reload) + ## Like force-reload, but if daemon does not support + ## signaling, do nothing (!) + + echo -n "Reload service varnishlog " + /sbin/killproc -p "$VARNISHLOG_PID" -HUP "$VARNISHLOG_BIN" + rc_status -v + ;; + status) + ## Check status with checkproc(8), if process is running + ## checkproc will return with exit status 0. + + # Return value is slightly different for the status command: + # 0 - service up and running + # 1 - service dead, but /var/run/ pid file exists + # 2 - service dead, but /var/lock/ lock file exists + # 3 - service not running (unused) + # 4 - service status unknown :-( + # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.) + + echo -n "Checking for service varnishlog " + /sbin/checkproc -p "$VARNISHLOG_PID" "$VARNISHLOG_BIN" + rc_status -v + ;; + probe) + ## Optional: Probe for the necessity of a reload, print out the + ## argument to this init script which is required for a reload. + ## Note: probe is not (yet) part of LSB (as of 1.9) + + test /etc/sysconfig/varnish -nt "$VARNISHD_PID" && \ + test -f /etc/varnish/default.vcl.net -nt "$VARNISHD_PID" && \ + echo reload + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 + ;; +esac +rc_exit diff --git a/varnishlog.service b/varnishlog.service new file mode 100644 index 0000000..4e5dd4f --- /dev/null +++ b/varnishlog.service @@ -0,0 +1,10 @@ +[Unit] +Description=Varnish log generator + +[Service] +EnvironmentFile=/etc/sysconfig/varnish +PIDFile=/var/run/varnishlog.pid +ExecStart=/usr/sbin/varnishncsa $VARNISHLOG_PARAMS -P /var/run/varnishlog.pid -F + +[Install] +WantedBy=multi-user.target From cdbd881dad2c05f43818b4f98f0fd6f6ff4306d55f8b9ad8debad97294603cb3 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 18 Feb 2012 01:12:57 +0000 Subject: [PATCH 10/13] systemd unit files OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=53 --- varnishlog.service | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/varnishlog.service b/varnishlog.service index 4e5dd4f..6eb94f7 100644 --- a/varnishlog.service +++ b/varnishlog.service @@ -1,10 +1,12 @@ [Unit] Description=Varnish log generator +Requires=varnish.service +#After= is not required [Service] EnvironmentFile=/etc/sysconfig/varnish PIDFile=/var/run/varnishlog.pid -ExecStart=/usr/sbin/varnishncsa $VARNISHLOG_PARAMS -P /var/run/varnishlog.pid -F +ExecStart=/usr/sbin/varnishncsa $VARNISHLOG_PARAMS -P /var/run/varnishlog.pid [Install] WantedBy=multi-user.target From 06d2f47997cb2d69fc71b1e1ce47570732621f9bc4ca61bb39a9870a4ab9eba1 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 28 Feb 2012 14:47:45 +0000 Subject: [PATCH 11/13] Add systemd macros as per http://en.opensuse.org/openSUSE:Systemd_packaging_guidelines OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=54 --- varnish.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/varnish.spec b/varnish.spec index 954f930..861e206 100644 --- a/varnish.spec +++ b/varnish.spec @@ -41,6 +41,10 @@ Prereq(post): %_sbindir/useradd %_sbindir/groupadd %if 0%{?suse_version} >= 1010 Recommends: logrotate %endif +%if 0%{?suse_version} >= 1140 +BuildRequires: systemd +%{?systemd_requires} +%endif %define pkg_home %_localstatedir/lib/%name %define pkg_logdir %_localstatedir/log/%name %define pkg_cachedir %_localstatedir/cache/%name @@ -135,18 +139,27 @@ mkdir -p "%buildroot/%pkg_logdir" %_bindir/getent passwd varnish >/dev/null || \ %_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \ -d %pkg_home varnish || : +%service_add_pre varnish.service +%service_add_pre varnishlog.service %post %fillup_and_insserv varnish %fillup_and_insserv varnishlog +%service_add_post varnish.service +%service_add_post varnishlog.service %preun %stop_on_removal varnish %stop_on_removal varnishlog +%service_del_preun varnish.service +%service_del_preun varnishlog.service %postun +# Does not this very much conflict? But rpmlint wants to have it... %restart_on_update varnish %restart_on_update varnishlog +%service_del_postun varnish.service +%service_del_postun varnishlog.service %insserv_cleanup %post -n %library_name -p /sbin/ldconfig @@ -156,7 +169,7 @@ mkdir -p "%buildroot/%pkg_logdir" %defattr(-,root,root) %_initddir/varnish %_initddir/varnishlog -/lib/systemd +%_unitdir %config(noreplace) %_sysconfdir/logrotate.d/varnish %dir %attr(0750,root,varnish) %_sysconfdir/%name/ %config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf From d23012279c20fe4d61b3c3472aca99cd5d89d546f811a015f0d1f97138e8ba0b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 28 Feb 2012 15:45:40 +0000 Subject: [PATCH 12/13] Add rc symlinks, guard systemd lines OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=55 --- varnish.spec | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/varnish.spec b/varnish.spec index 861e206..9584ffa 100644 --- a/varnish.spec +++ b/varnish.spec @@ -106,32 +106,33 @@ export CFLAGS="%optflags -fstack-protector" make %{?_smp_mflags} %install +b="%buildroot"; %makeinstall -find %buildroot -ls # There is no use for them to normal users -mv %buildroot/%_bindir/* %buildroot/%_sbindir/ -# -# remove unneeded files -# libvarnish.la has -lrt as dependency lib -#rm -fv %buildroot%_libdir/*.la +mv "$b/%_bindir"/* "$b/%_sbindir/"; # ##missing directories -install -d -m 0755 %buildroot{%pkg_logdir,%pkg_home} -install -Dpm 0644 %{S:5} %buildroot%_sysconfdir/logrotate.d/varnish +install -dm 0755 "$b"/{%pkg_logdir,%pkg_home}; +install -Dpm 0644 "%{S:5}" "$b/%_sysconfdir/logrotate.d/varnish"; # ##init scripts -install -Dpm 0644 %{S:3} %buildroot/var/adm/fillup-templates/sysconfig.%name -install -Dpm 0755 %{S:2} %buildroot/%_initddir/varnish -install -Dpm 0755 %{S:6} %buildroot/%_initddir/varnishlog -install -Dpm 0644 "%{S:7}" "%buildroot/lib/systemd/system/varnish.service"; -install -Dpm 0644 "%{S:8}" "%buildroot/lib/systemd/system/varnishlog.service"; +install -Dpm 0644 "%{S:3}" "$b/var/adm/fillup-templates/sysconfig.%name"; +install -Dpm 0755 "%{S:2}" "$b/%_initddir/varnish"; +install -Dpm 0755 "%{S:6}" "$b/%_initddir/varnishlog"; +%if 0%{?_unitdir:1} +install -Dpm 0644 "%{S:7}" "$b/%_unitdir/varnish.service"; +install -Dpm 0644 "%{S:8}" "$b/%_unitdir/varnishlog.service"; +%endif +mkdir -p "$b/%_sbindir"; +ln -s "%_initddir/varnish" "$b/%_sbindir/rcvarnish"; +ln -s "%_initddir/varnishlog" "$b/%_sbindir/rcvarnishlog"; # ##config files -install -Dpm 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf -install -Dpm 0644 %{S:4} %buildroot%_sysconfdir/%name/vcl.conf.example +install -Dpm 0644 %{S:4} "$b/%_sysconfdir/%name/vcl.conf"; +install -Dpm 0644 %{S:4} "$b/%_sysconfdir/%name/vcl.conf.example"; -find "%buildroot" -type f -name "*.la" -delete -mkdir -p "%buildroot/%pkg_logdir" +find "$b" -type f -name "*.la" -delete +mkdir -p "$b/%pkg_logdir" %pre %_bindir/getent group varnish >/dev/null || \ @@ -139,27 +140,35 @@ mkdir -p "%buildroot/%pkg_logdir" %_bindir/getent passwd varnish >/dev/null || \ %_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \ -d %pkg_home varnish || : +%if 0%{?service_add_pre:1} %service_add_pre varnish.service %service_add_pre varnishlog.service +%endif %post %fillup_and_insserv varnish %fillup_and_insserv varnishlog +%if 0%{?service_add_post:1} %service_add_post varnish.service %service_add_post varnishlog.service +%endif %preun %stop_on_removal varnish %stop_on_removal varnishlog +%if 0%{?service_del_preun:1} %service_del_preun varnish.service %service_del_preun varnishlog.service +%endif %postun # Does not this very much conflict? But rpmlint wants to have it... %restart_on_update varnish %restart_on_update varnishlog +%if 0%{?service_del_postun:1} %service_del_postun varnish.service %service_del_postun varnishlog.service +%endif %insserv_cleanup %post -n %library_name -p /sbin/ldconfig @@ -169,7 +178,9 @@ mkdir -p "%buildroot/%pkg_logdir" %defattr(-,root,root) %_initddir/varnish %_initddir/varnishlog +%if 0%{?_unitdir:1} %_unitdir +%endif %config(noreplace) %_sysconfdir/logrotate.d/varnish %dir %attr(0750,root,varnish) %_sysconfdir/%name/ %config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf @@ -177,6 +188,7 @@ mkdir -p "%buildroot/%pkg_logdir" %config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/default.vcl %_libdir/varnish %_sbindir/varnish* +%_sbindir/rcvarnish* %_mandir/man*/* %doc ChangeLog LICENSE README %dir %attr(0750,varnish,varnish) %pkg_home From 6dbb5e2ecc9ba575b732510abf2d591706356c9addb1fefc08583a2a591bd8a0 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 29 Feb 2012 07:32:57 +0000 Subject: [PATCH 13/13] systemd guards OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=56 --- varnish.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/varnish.spec b/varnish.spec index 9584ffa..e3c2fc1 100644 --- a/varnish.spec +++ b/varnish.spec @@ -41,7 +41,7 @@ Prereq(post): %_sbindir/useradd %_sbindir/groupadd %if 0%{?suse_version} >= 1010 Recommends: logrotate %endif -%if 0%{?suse_version} >= 1140 +%if 0%{?suse_version} >= 1210 BuildRequires: systemd %{?systemd_requires} %endif @@ -140,7 +140,7 @@ mkdir -p "$b/%pkg_logdir" %_bindir/getent passwd varnish >/dev/null || \ %_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \ -d %pkg_home varnish || : -%if 0%{?service_add_pre:1} +%if 0%{?_unitdir:1} %service_add_pre varnish.service %service_add_pre varnishlog.service %endif @@ -148,7 +148,7 @@ mkdir -p "$b/%pkg_logdir" %post %fillup_and_insserv varnish %fillup_and_insserv varnishlog -%if 0%{?service_add_post:1} +%if 0%{?_unitdir:1} %service_add_post varnish.service %service_add_post varnishlog.service %endif @@ -156,16 +156,16 @@ mkdir -p "$b/%pkg_logdir" %preun %stop_on_removal varnish %stop_on_removal varnishlog -%if 0%{?service_del_preun:1} +%if 0%{?_unitdir:1} %service_del_preun varnish.service %service_del_preun varnishlog.service %endif %postun -# Does not this very much conflict? But rpmlint wants to have it... +# Does not sysv+systemd very much conflict? But rpmlint wants to have it... %restart_on_update varnish %restart_on_update varnishlog -%if 0%{?service_del_postun:1} +%if 0%{?_unitdir:1} %service_del_postun varnish.service %service_del_postun varnishlog.service %endif