From 2eda606935c11c5ff1d1a7d4f59aa3cd00d64b8b Mon Sep 17 00:00:00 2001 From: Ingvar Hagelund Date: Wed, 21 Sep 2016 14:11:02 +0200 Subject: [PATCH] New upstream release: 5.0.0 - Rebased patches for 5.0.0 - Added patch from upstream fixing a h/2 bug visible on secondary arches - New snapshot of pkg-varnish - Some cosmetic changes to reduce the diff to the upstream specfile - Renamed subpackage varnish-libs-devel to just varnish-devel (as in upstream) - Removed varnishlog initrc and systemd start scripts, as in upstream (Nobody should run varnishlog as a daemon continously) --- .gitignore | 2 + sources | 4 +- varnish-5.0.0.fix_Werror_el6.patch | 11 ++ ...0.0.fix_ld_library_path_in_doc_build.patch | 100 ++++++++++++++++++ varnish-5.0.0.fix_python24.el5.patch | 68 ++++++++++++ ...0.fix_test_suite_on_secondary_arches.patch | 63 +++++++++++ varnish.spec | 62 +++++++---- 7 files changed, 285 insertions(+), 25 deletions(-) create mode 100644 varnish-5.0.0.fix_Werror_el6.patch create mode 100644 varnish-5.0.0.fix_ld_library_path_in_doc_build.patch create mode 100644 varnish-5.0.0.fix_python24.el5.patch create mode 100644 varnish-5.0.0.fix_test_suite_on_secondary_arches.patch diff --git a/.gitignore b/.gitignore index 2b2ee45..dcf88d1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ varnish-2.1.3.tar.gz /pkg-varnish-cache-eff850c.tar.gz /varnish-4.1.3.tar.gz /pkg-varnish-cache-4e27994.tar.gz +/varnish-5.0.0.tar.gz +/pkg-varnish-cache-502fcc0.tar.gz diff --git a/sources b/sources index 4a3e06d..6d62f12 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -f9c761a54324ad02c4fe44ce1d291d70 varnish-4.1.3.tar.gz -007fc6cb2adbdff44a4cb22f813b4ea1 pkg-varnish-cache-4e27994.tar.gz +6c76ff181d21be595a18ae969a692ae7 varnish-5.0.0.tar.gz +5b12768ac45aa55b74370c71235a323c pkg-varnish-cache-502fcc0.tar.gz diff --git a/varnish-5.0.0.fix_Werror_el6.patch b/varnish-5.0.0.fix_Werror_el6.patch new file mode 100644 index 0000000..093bda7 --- /dev/null +++ b/varnish-5.0.0.fix_Werror_el6.patch @@ -0,0 +1,11 @@ +--- configure.orig 2016-08-24 22:21:08.524949225 +0200 ++++ configure 2016-08-24 22:30:04.047845691 +0200 +@@ -18108,7 +18108,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror" >&5 + $as_echo "$ax_cv_check_cflags___Werror" >&6; } + if test x"$ax_cv_check_cflags___Werror" = xyes; then : +- CFLAGS="${CFLAGS} -Werror" ++# CFLAGS="${CFLAGS} -Werror" + OCFLAGS="${OCFLAGS} -Werror" + else + as_CACHEVAR=`$as_echo "ax_cv_check_cflags__${SUNCC_CFLAGS}" | $as_tr_sh` diff --git a/varnish-5.0.0.fix_ld_library_path_in_doc_build.patch b/varnish-5.0.0.fix_ld_library_path_in_doc_build.patch new file mode 100644 index 0000000..6d1e83a --- /dev/null +++ b/varnish-5.0.0.fix_ld_library_path_in_doc_build.patch @@ -0,0 +1,100 @@ +diff -Naur ../varnish-5.0.0-beta1.orig/bin/varnishd/Makefile.in ./bin/varnishd/Makefile.in +--- ../varnish-5.0.0-beta1.orig/bin/varnishd/Makefile.in 2016-09-09 10:43:06.000000000 +0200 ++++ ./bin/varnishd/Makefile.in 2016-09-14 14:59:53.302301003 +0200 +@@ -2934,6 +2934,8 @@ + -e 's/^/ "/' $(srcdir)/builtin.vcl >> $@ + + vhp_hufdec.h: vhp_gen_hufdec ++ LD_LIBRARY_PATH=\ ++ $(top_builddir)/lib/libvarnish/.libs:\ + $(AM_V_GEN) ./vhp_gen_hufdec > vhp_hufdec.h_ + mv vhp_hufdec.h_ vhp_hufdec.h + +diff -Naur ../varnish-5.0.0-beta1.orig/doc/sphinx/Makefile.in ./doc/sphinx/Makefile.in +--- ../varnish-5.0.0-beta1.orig/doc/sphinx/Makefile.in 2016-09-09 10:43:07.000000000 +0200 ++++ ./doc/sphinx/Makefile.in 2016-09-14 14:55:51.898109072 +0200 +@@ -614,39 +614,84 @@ + rm -rf $(BUILDDIR) + + include/cli.rst: $(top_builddir)/bin/varnishd/varnishd ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnish/.libs:\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvcc/.libs:\ ++$(top_builddir)/lib/libvgz/.libs \ + $(top_builddir)/bin/varnishd/varnishd -x dumprstcli > $@ + + include/params.rst: $(top_builddir)/bin/varnishd/varnishd ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnish/.libs:\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvcc/.libs:\ ++$(top_builddir)/lib/libvgz/.libs \ + $(top_builddir)/bin/varnishd/varnishd -x dumprstparam > $@ + + include/counters.rst: $(top_builddir)/bin/varnishstat/vsc2rst ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishstat/vsc2rst > $@ + + # XXX add varnishstat here when it's been _opt2rst'ed + + include/varnishncsa_options.rst: $(top_builddir)/bin/varnishncsa/varnishncsa ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishncsa/varnishncsa --options > $@ + include/varnishncsa_synopsis.rst: $(top_builddir)/bin/varnishncsa/varnishncsa ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishncsa/varnishncsa --synopsis > $@ + + include/varnishlog_options.rst: $(top_builddir)/bin/varnishlog/varnishlog ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishlog/varnishlog --options > $@ + include/varnishlog_synopsis.rst: $(top_builddir)/bin/varnishlog/varnishlog ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishlog/varnishlog --synopsis > $@ + + include/varnishtop_options.rst: $(top_builddir)/bin/varnishtop/varnishtop ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishtop/varnishtop --options > $@ + include/varnishtop_synopsis.rst: $(top_builddir)/bin/varnishtop/varnishtop ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishtop/varnishtop --synopsis > $@ + + include/varnishhist_options.rst: $(top_builddir)/bin/varnishhist/varnishhist ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs:\ ++$(top_builddir)/lib/libvarnish/.libs \ + $(top_builddir)/bin/varnishhist/varnishhist --options > $@ + include/varnishhist_synopsis.rst: $(top_builddir)/bin/varnishhist/varnishhist ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs:\ ++$(top_builddir)/lib/libvarnish/.libs \ + $(top_builddir)/bin/varnishhist/varnishhist --synopsis > $@ + + include/varnishstat_options.rst: $(top_builddir)/bin/varnishstat/varnishstat ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishstat/varnishstat --options > $@ + include/varnishstat_synopsis.rst: $(top_builddir)/bin/varnishstat/varnishstat ++ LD_LIBRARY_PATH=\ ++$(top_builddir)/lib/libvarnishcompat/.libs:\ ++$(top_builddir)/lib/libvarnishapi/.libs \ + $(top_builddir)/bin/varnishstat/varnishstat --synopsis > $@ + + include/vsl-tags.rst: $(top_builddir)/lib/libvarnishapi/vsl2rst diff --git a/varnish-5.0.0.fix_python24.el5.patch b/varnish-5.0.0.fix_python24.el5.patch new file mode 100644 index 0000000..eb8141a --- /dev/null +++ b/varnish-5.0.0.fix_python24.el5.patch @@ -0,0 +1,68 @@ +--- lib/libvcc/vmodtool.py.orig 2016-09-14 14:39:29.159447283 +0200 ++++ lib/libvcc/vmodtool.py 2016-09-14 14:46:33.446283000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python2.4 + #- + # Copyright (c) 2010-2016 Varnish Software + # All rights reserved. +@@ -33,8 +33,8 @@ + vmod_${name}.rst -- Extracted documentation + """ + +-# This script should work with both Python 2 and Python 3. +-from __future__ import print_function ++## This script should work with both Python 2 and Python 3. ++#from __future__ import print_function + + import os + import sys +@@ -47,6 +47,16 @@ + from pprint import pprint, pformat + from tempfile import mkstemp + ++# __future__ print_function is not available on python2.4 in rhel5, so ++# make a local simple variant _print ++ ++def _print(*objects, **kwargs): ++ sep = kwargs.get('sep', ' ') ++ end = kwargs.get('end', '\n') ++ out = kwargs.get('file', sys.stdout) ++ out.write(sep.join(objects) + end) ++ ++ + rstfmt=False + + ctypes = { +@@ -150,11 +160,11 @@ + + def err(str, warn=True): + if opts.strict or not warn: +- print("ERROR: " + str, file = sys.stderr) ++ _print("ERROR: " + str, file = sys.stderr) + exit(1) + raise FormatError(str, "") + else: +- print("WARNING: " + str, file = sys.stderr) ++ _print("WARNING: " + str, file = sys.stderr) + + def fmt_cstruct(fo, mn, x): + a = "\ttd_" + mn + "_" + x +@@ -359,7 +369,7 @@ + self.parse() + + def dump(self): +- print(type(self), self.line) ++ _print(type(self), self.line) + + def rstfile(self, fo, man): + if self.rstlbl != None: +@@ -866,7 +876,7 @@ + if not i_vcc: + i_vcc = "vmod.vcc" + else: +- print("ERROR: No vmod.vcc file supplied or found.", ++ _print("ERROR: No vmod.vcc file supplied or found.", + file=sys.stderr) + oparser.print_help() + exit(-1) diff --git a/varnish-5.0.0.fix_test_suite_on_secondary_arches.patch b/varnish-5.0.0.fix_test_suite_on_secondary_arches.patch new file mode 100644 index 0000000..fc394c1 --- /dev/null +++ b/varnish-5.0.0.fix_test_suite_on_secondary_arches.patch @@ -0,0 +1,63 @@ +Patch from upstream + +commit dbcbae227b757043651ee1e7d1cc729727f94c8d +Author: Poul-Henning Kamp +Date: Wed Sep 21 06:22:55 2016 +0000 + + Do not insist the H2 connection preface arrives in a single packet. + + Fixes: #2094 + Fixes: #2096 + +diff --git a/bin/varnishd/http1/cache_http1_proto.c b/bin/varnishd/http1/cache_http1_proto.c +index b5273c6..e788ed6 100644 +--- a/bin/varnishd/http1/cache_http1_proto.c ++++ b/bin/varnishd/http1/cache_http1_proto.c +@@ -46,6 +46,8 @@ + #include "config.h" + + #include "cache/cache.h" ++#include "cache/cache_transport.h" ++ + #include "cache_http1.h" + + #include "vct.h" +@@ -66,6 +68,7 @@ enum htc_status_e __match_proto__(htc_complete_f) + HTTP1_Complete(struct http_conn *htc) + { + char *p; ++ enum htc_status_e retval; + + CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC); + +@@ -78,6 +81,11 @@ HTTP1_Complete(struct http_conn *htc) + if (p == htc->rxbuf_e) + return (HTC_S_EMPTY); + ++ /* Do not return a partial H2 connection preface */ ++ retval = H2_prism_complete(htc); ++ if (retval != HTC_S_JUNK) ++ return (retval); ++ + /* + * Here we just look for NL[CR]NL to see that reception + * is completed. More stringent validation happens later. +diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c +index 73d0c95..54b8a2e 100644 +--- a/bin/varnishd/http2/cache_http2_proto.c ++++ b/bin/varnishd/http2/cache_http2_proto.c +@@ -474,10 +474,11 @@ H2_prism_complete(struct http_conn *htc) + + CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC); + l = htc->rxbuf_e - htc->rxbuf_b; +- if (l < strlen(H2_prism)) +- return (HTC_S_MORE); +- if (!memcmp(htc->rxbuf_b, H2_prism, sizeof(H2_prism))) ++ if (l >= sizeof(H2_prism) && ++ !memcmp(htc->rxbuf_b, H2_prism, sizeof(H2_prism))) + return (HTC_S_COMPLETE); ++ if (l < sizeof(H2_prism) && !memcmp(htc->rxbuf_b, H2_prism, l)) ++ return (HTC_S_MORE); + return (HTC_S_JUNK); + } + diff --git a/varnish.spec b/varnish.spec index c65871f..757bde0 100644 --- a/varnish.spec +++ b/varnish.spec @@ -6,23 +6,25 @@ # Package scripts are now external # https://github.com/varnishcache/pkg-varnish-cache -%define commit1 4e2799451f49ad88fd90437ca9fc0df05d3f9e4c +%define commit1 502fcc0b19794b98458111b99f77cdc03227dcfc %global shortcommit1 %(c=%{commit1}; echo ${c:0:7}) Summary: High-performance HTTP accelerator Name: varnish -Version: 4.1.3 -Release: 5%{?v_rc}%{?dist} +Version: 5.0.0 +Release: 1%{?v_rc}%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.varnish-cache.org/ Source0: http://repo.varnish-cache.org/source/%{name}-%{version}%{?vd_rc}.tar.gz Source1: https://github.com/varnishcache/pkg-varnish-cache/archive/%{commit1}.tar.gz#/pkg-varnish-cache-%{shortcommit1}.tar.gz -Patch1: varnish-4.1.1.fix_ld_library_path_in_sphinx_build.patch -Patch2: varnish-4.1.3_fix_Werror_el6.patch -Patch3: varnish-4.1.2_fix_python24.el5.patch +Patch1: varnish-5.0.0.fix_ld_library_path_in_doc_build.patch +Patch2: varnish-5.0.0.fix_Werror_el6.patch +Patch3: varnish-5.0.0.fix_python24.el5.patch Patch4: varnish-4.0.3_fix_varnish4_selinux.el6.patch Patch6: varnish-4.1.0.fix_find-provides.patch +Patch7: varnish-5.0.0.fix_test_suite_on_secondary_arches.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if 0%{?rhel} > 5 @@ -41,10 +43,10 @@ BuildRequires: make %if 0%{?rhel} == 6 BuildRequires: selinux-policy %endif +Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: logrotate Requires: ncurses Requires: pcre -Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: jemalloc Requires: redhat-rpm-config Requires(pre): shadow-utils @@ -81,7 +83,7 @@ pages much faster than any application server; giving the website a significant speed up. Documentation wiki and additional information about Varnish Cache is -available on the following web site: https://www.varnish-cache.org/ +available on: https://www.varnish-cache.org/ %package libs Summary: Libraries for %{name} @@ -92,14 +94,17 @@ BuildRequires: ncurses-devel Libraries for %{name}. Varnish Cache is a high-performance HTTP accelerator -%package libs-devel +%package devel Summary: Development files for %{name}-libs Group: Development/Libraries BuildRequires: ncurses-devel Requires: varnish-libs = %{version}-%{release} Requires: python +Provides: varnish-libs-devel +Obsoletes: varnish-libs-devel +Conflicts: varnish-libs-devel -%description libs-devel +%description devel Development files for %{name}-libs Varnish Cache is a high-performance HTTP accelerator @@ -135,6 +140,7 @@ ln -s pkg-varnish-cache-%{commit1}/debian debian %patch4 -p0 %endif %patch6 -p0 +%patch7 -p1 %build %if 0%{?rhel} == 6 @@ -151,6 +157,9 @@ export CFLAGS="%{optflags} -fPIC -ffloat-store" %endif %endif +# Man pages are prebuilt. No need to regenerate them. +export RST2MAN=/bin/true + %configure --disable-static \ %if 0%{?rhel} <= 5 && 0%{?fedora} <= 12 --with-rst2man=/bin/true \ @@ -163,6 +172,12 @@ export CFLAGS="%{optflags} -fPIC -ffloat-store" sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g; s|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +# I'll never understand libtool +mkdir lib/libvarnishapi/.libs +pushd lib/libvarnishapi/.libs +ln -s libvarnishapi.so libvarnishapi.so.1 +popd + make %{?_smp_mflags} V=1 %if 0%{?fedora}%{?rhel} != 0 && 0%{?rhel} <= 4 && 0%{?fedora} <= 8 @@ -170,11 +185,10 @@ make %{?_smp_mflags} V=1 sed -i 's,--pidfile \$pidfile,,g; s,status -p \$pidfile,status,g; s,killproc -p \$pidfile,killproc,g' \ - redhat/varnish.initrc redhat/varnishlog.initrc redhat/varnishncsa.initrc + redhat/varnish.initrc redhat/varnishncsa.initrc %endif # One varnish user is enough -sed -i 's,User=varnishlog,User=varnish,g;' redhat/varnishlog.service sed -i 's,User=varnishlog,User=varnish,g;' redhat/varnishncsa.service # Explicit python, please @@ -216,13 +230,11 @@ mkdir -p %{buildroot}%{_unitdir} install -D -m 0644 redhat/varnish.service %{buildroot}%{_unitdir}/varnish.service install -D -m 0644 redhat/varnish.params %{buildroot}%{_sysconfdir}/varnish/varnish.params install -D -m 0644 redhat/varnishncsa.service %{buildroot}%{_unitdir}/varnishncsa.service -install -D -m 0644 redhat/varnishlog.service %{buildroot}%{_unitdir}/varnishlog.service sed -i 's,sysconfig/varnish,varnish/varnish.params,' redhat/varnish_reload_vcl # default is standard sysvinit %else install -D -m 0644 redhat/varnish.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/varnish install -D -m 0755 redhat/varnish.initrc %{buildroot}%{_initrddir}/varnish -install -D -m 0755 redhat/varnishlog.initrc %{buildroot}%{_initrddir}/varnishlog install -D -m 0755 redhat/varnishncsa.initrc %{buildroot}%{_initrddir}/varnishncsa %endif install -D -m 0755 redhat/varnish_reload_vcl %{buildroot}%{_sbindir}/varnish_reload_vcl @@ -267,14 +279,12 @@ rm -rf %{buildroot} %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 %{_unitdir}/varnish.service %{_unitdir}/varnishncsa.service -%{_unitdir}/varnishlog.service %config(noreplace)%{_sysconfdir}/varnish/varnish.params # default is standard sysvinit %else %config(noreplace) %{_sysconfdir}/sysconfig/varnish %{_initrddir}/varnish -%{_initrddir}/varnishlog %{_initrddir}/varnishncsa %endif @@ -285,13 +295,13 @@ rm -rf %{buildroot} %doc LICENSE %config %{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf -%files libs-devel +%files devel %defattr(-,root,root,-) %{_libdir}/lib*.so %{_includedir}/%{name} %{_libdir}/pkgconfig/varnishapi.pc %{_datadir}/%{name} -%{_datadir}/aclocal/%{name}.m4 +%{_datadir}/aclocal/*.m4 %doc LICENSE @@ -324,12 +334,10 @@ exit 0 # Other distros: Use chkconfig %else /sbin/chkconfig --add varnish -/sbin/chkconfig --add varnishlog /sbin/chkconfig --add varnishncsa %endif # Previous versions had varnishlog and varnishncsa running as root -chown varnish:varnish /var/log/varnish/varnish.log || true chown varnish:varnish /var/log/varnish/varnishncsa.log || true test -f /etc/varnish/secret || (uuidgen > /etc/varnish/secret && chmod 0600 /etc/varnish/secret) @@ -377,14 +385,11 @@ if [ $1 -lt 1 ]; then %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 /bin/systemctl --no-reload disable varnish.service > /dev/null 2>&1 || : /bin/systemctl stop varnish.service > /dev/null 2>&1 || : - /bin/systemctl stop varnishlog.service > /dev/null 2>&1 || : /bin/systemctl stop varnishncsa.service > /dev/null 2>&1 || : %else /sbin/service varnish stop > /dev/null 2>&1 - /sbin/service varnishlog stop > /dev/null 2>&1 /sbin/service varnishncsa stop > /dev/null 2>%1 /sbin/chkconfig --del varnish - /sbin/chkconfig --del varnishlog /sbin/chkconfig --del varnishncsa %endif fi @@ -399,6 +404,17 @@ fi %endif %changelog +* Wed Sep 14 2016 Ingvar Hagelund 5.0.0-1 +- New upstream release: 5.0.0 +- Rebased patches for 5.0.0 +- Added patch from upstream fixing a h/2 bug visible on secondary arches +- New snapshot of pkg-varnish +- Some cosmetic changes to reduce the diff to the upstream specfile +- Renamed subpackage varnish-libs-devel to just varnish-devel + (as in upstream) +- Removed varnishlog initrc and systemd start scripts, as in upstream + (Nobody should run varnishlog as a daemon continously) + * Thu Sep 01 2016 Ingvar Hagelund 4.1.3-5 - Changed ownership of varnishlog and varnishncsa logs, as previous versions have had them run as root