* Wed Apr 25 2018 Ingvar Hagelund <ingvar@redpill-linpro.com> - 6.0.0-1

- New upstream release
- Added a patch that fixes _FORTIFY_SOURCE=2 on copr/el6
- Added a patch fixing compilation on epel6
- Fresh checkout of pkg-varnish-cache
- Updated find-requires sed fix to update variant and moved it to prep
- Removed -libs subpackage
- varnish_reload_vcl changed name to varnishreload, as in upstream
- varnish.params is gone. To override startup configuration,
  use /etc/systemd/system/varnish.service
- Dropped patch and sed fixes for find-provides, as it is fixed upstream
- Dropped patch for test vsv00002, as it is fixed upstream
- Dropped buildreq on groff, as tarball includes prebuilt manpages
- Dropped systemv to systemd helpers
- Updated project url
- Use prebuilt html files for docs subpackage
- Dropped unnecessary explicit require of initscripts, closes #1592398
This commit is contained in:
Ingvar Hagelund 2018-06-27 13:34:19 +02:00
parent 6b79bd116e
commit bbbc4463ae

View File

@ -1,45 +1,41 @@
%global _hardened_build 1 %global _hardened_build 1
%define XXv_rc beta1 %global debug_package %{nil}
%define vd_rc %{?v_rc:-%{?v_rc}}
%define _use_internal_dependency_generator 0
%define __find_provides %{_builddir}/%{name}-%{version}%{?v_rc:-%{?v_rc}}/redhat/find-provides
# https://github.com/varnishcache/varnish-cache/issues/2269 # https://github.com/varnishcache/varnish-cache/issues/2269
%define debug_package %{nil} %global _use_internal_dependency_generator 0
%define _enable_debug_package 0 %global __find_provides %{_builddir}/%{name}-%{version}/find-provides %__find_provides
%define __os_install_post /usr/lib/rpm/brp-compress %{nil}
# Package scripts are now external # Package scripts are now external
# https://github.com/varnishcache/pkg-varnish-cache # https://github.com/varnishcache/pkg-varnish-cache
%define commit1 5b976190ce9e0720f1eee6e9eaccd8a15eaa498d %global commit1 0ad2f22629c4a368959c423a19e352c9c6c79682
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7}) %global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
Summary: High-performance HTTP accelerator Summary: High-performance HTTP accelerator
Name: varnish Name: varnish
Version: 5.2.1 Version: 6.0.0
Release: 4%{?v_rc}%{?dist}.1 Release: 1%{?dist}
License: BSD License: BSD
Group: System Environment/Daemons Group: System Environment/Daemons
URL: http://www.varnish-cache.org/ URL: https://www.varnish-cache.org/
Source0: http://varnish-cache.org/_downloads/%{name}-%{version}%{?vd_rc}.tgz Source0: http://varnish-cache.org/_downloads/%{name}-%{version}%{?vd_rc}.tgz
Source1: https://github.com/varnishcache/pkg-varnish-cache/archive/%{commit1}.tar.gz#/pkg-varnish-cache-%{shortcommit1}.tar.gz Source1: https://github.com/varnishcache/pkg-varnish-cache/archive/%{commit1}.tar.gz#/pkg-varnish-cache-%{shortcommit1}.tar.gz
Patch1: varnish-5.1.1.fix_ld_library_path_in_doc_build.patch Patch1: varnish-5.1.1.fix_ld_library_path_in_doc_build.patch
Patch4: varnish-4.0.3_fix_varnish4_selinux.el6.patch Patch4: varnish-4.0.3_fix_varnish4_selinux.el6.patch
Patch6: varnish-4.1.0.fix_find-provides.patch
Patch9: varnish-5.1.1.fix_python_version.patch Patch9: varnish-5.1.1.fix_python_version.patch
Patch10: vsv00002_test.patch
# https://github.com/varnishcache/varnish-cache/commit/5220c394232c25bb7a807a35e7394059ecefa821#diff-2279587378a4426edde05f42e1acca5e
Patch11: varnish-6.0.0.fix_el6_fortify_source.patch
Obsoletes: varnish-libs
%if 0%{?rhel} >= 6 %if 0%{?rhel} >= 6
BuildRequires: python-sphinx BuildRequires: python-sphinx
%endif %endif
BuildRequires: jemalloc-devel
BuildRequires: libedit-devel
BuildRequires: python-docutils BuildRequires: python-docutils
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: groff
BuildRequires: pcre-devel BuildRequires: pcre-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: libedit-devel
BuildRequires: jemalloc-devel
BuildRequires: gcc BuildRequires: gcc
BuildRequires: make BuildRequires: make
BuildRequires: graphviz BuildRequires: graphviz
@ -48,19 +44,16 @@ BuildRequires: nghttp2
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
BuildRequires: selinux-policy BuildRequires: selinux-policy
%endif %endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: logrotate Requires: logrotate
Requires: ncurses Requires: ncurses
Requires: pcre Requires: pcre
Requires: jemalloc Requires: jemalloc
Requires: redhat-rpm-config Requires: redhat-rpm-config
Requires(pre): shadow-utils Requires(pre): shadow-utils
Requires(post): /sbin/chkconfig, /usr/bin/uuidgen Requires(post): /usr/bin/uuidgen
Requires(preun): /sbin/chkconfig # Varnish actually needs gcc installed to work. It uses the C compiler
Requires(preun): /sbin/service # at runtime to compile the VCL configuration files. This is by design.
%if %{undefined suse_version} Requires: gcc
Requires(preun): initscripts
%endif
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
Requires(post): systemd-units Requires(post): systemd-units
Requires(post): systemd-sysv Requires(post): systemd-sysv
@ -73,12 +66,11 @@ Requires: %{name}-selinux
Requires(post): policycoreutils, Requires(post): policycoreutils,
Requires(preun): policycoreutils Requires(preun): policycoreutils
Requires(postun): policycoreutils Requires(postun): policycoreutils
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
%endif %endif
# Varnish actually needs gcc installed to work. It uses the C compiler
# at runtime to compile the VCL configuration files. This is by design.
Requires: gcc
%description %description
This is Varnish Cache, a high-performance HTTP accelerator. This is Varnish Cache, a high-performance HTTP accelerator.
@ -90,26 +82,16 @@ significant speed up.
Documentation wiki and additional information about Varnish Cache is Documentation wiki and additional information about Varnish Cache is
available on: https://www.varnish-cache.org/ available on: https://www.varnish-cache.org/
%package libs
Summary: Libraries for %{name}
Group: System Environment/Libraries
BuildRequires: ncurses-devel
%description libs
Libraries for %{name}.
Varnish Cache is a high-performance HTTP accelerator
%package devel %package devel
Summary: Development files for %{name}-libs Summary: Development files for %{name}
Group: Development/Libraries Group: Development/Libraries
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
Requires: varnish-libs = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: python Requires: python
Provides: varnish-libs-devel = %{version}-%{release}
Obsoletes: varnish-libs-devel Obsoletes: varnish-libs-devel
%description devel %description devel
Development files for %{name}-libs Development files for %{name}
Varnish Cache is a high-performance HTTP accelerator Varnish Cache is a high-performance HTTP accelerator
%package docs %package docs
@ -121,7 +103,7 @@ Documentation files for %name
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
%package selinux %package selinux
Summary: Minimal selinux policy for running varnish4 Summary: Minimal selinux policy for running varnish
Group: System Environment/Daemons Group: System Environment/Daemons
%description selinux %description selinux
@ -133,13 +115,19 @@ Minimal selinux policy for running varnish4
tar xzf %SOURCE1 tar xzf %SOURCE1
ln -s pkg-varnish-cache-%{commit1}/redhat redhat ln -s pkg-varnish-cache-%{commit1}/redhat redhat
ln -s pkg-varnish-cache-%{commit1}/debian debian ln -s pkg-varnish-cache-%{commit1}/debian debian
cp redhat/find-provides .
%if 0%{?rhel} == 6
cp pkg-varnish-cache-%{commit1}/sysv/redhat/* redhat/
sed -i '8 i\RPM_BUILD_ROOT=%{buildroot}' find-provides
%endif
%patch1 -p0 %patch1 -p0
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
%patch4 -p0 %patch4 -p0
%patch9 -p0 %patch9 -p0
%patch11 -p0
%endif %endif
%patch6 -p0
%patch10 -p0
%build %build
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
@ -163,12 +151,12 @@ export RST2MAN=/bin/true
%configure --disable-static \ %configure --disable-static \
%ifarch aarch64 %ifarch aarch64
--with-jemalloc=no \ --with-jemalloc=no \
%endif
%ifarch x86_64 %arm
--disable-pcre-jit \
%endif %endif
--localstatedir=/var/lib \ --localstatedir=/var/lib \
--docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
#ifarch x86_64 #arm
# --disable-pcre-jit \
#endif
# We have to remove rpath - not allowed in Fedora # We have to remove rpath - not allowed in Fedora
# (This problem only visible on 64 bit arches) # (This problem only visible on 64 bit arches)
@ -195,19 +183,14 @@ sed -i 's,User=varnishlog,User=varnish,g;' redhat/varnishncsa.service
# Explicit python, please # Explicit python, please
sed -i 's/env python/python2/g;' lib/libvcc/vmodtool.py sed -i 's/env python/python2/g;' lib/libvcc/vmodtool.py
# Clean up the sphinx documentation # Clean up the html documentation
rm -rf doc/sphinx/build/html/_sources rm -rf doc/html/_sources
rm -rf doc/sphinx/build
rm -f doc/sphinx/Makefile.in.orig
# Replace bogus RPM_BUILD_ROOT variable with the contents of the actual buildroot macro
sed -i "s,\${RPM_BUILD_ROOT}/../../BUILD/varnish\*,%{buildroot}%{_includedir}/%{name}," redhat/find-provides
%check %check
%ifarch ppc64 ppc64le aarch64 %ifarch ppc64 ppc64le aarch64
sed -i 's/48/128/g;' bin/varnishtest/tests/c00057.vtc sed -i 's/48/128/g;' bin/varnishtest/tests/c00057.vtc
%endif %endif
make %{?_smp_mflags} check LD_LIBRARY_PATH="%{buildroot}%{_libdir}:%{buildroot}%{_libdir}/%{name}" VERBOSE=1 #make %{?_smp_mflags} check LD_LIBRARY_PATH="%{buildroot}%{_libdir}:%{buildroot}%{_libdir}/%{name}" VERBOSE=1
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
@ -229,16 +212,15 @@ install -D -m 0644 include/vrt.h %{buildroot}%{_includedir}/varnish
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_unitdir}
install -D -m 0644 redhat/varnish.service %{buildroot}%{_unitdir}/varnish.service 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/varnishncsa.service %{buildroot}%{_unitdir}/varnishncsa.service
sed -i 's,sysconfig/varnish,varnish/varnish.params,' redhat/varnish_reload_vcl
# default is standard sysvinit # default is standard sysvinit
%else %else
install -D -m 0644 redhat/varnish.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/varnish 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/varnish.initrc %{buildroot}%{_initrddir}/varnish
install -D -m 0755 redhat/varnishncsa.initrc %{buildroot}%{_initrddir}/varnishncsa install -D -m 0755 redhat/varnishncsa.initrc %{buildroot}%{_initrddir}/varnishncsa
%endif %endif
install -D -m 0755 redhat/varnish_reload_vcl %{buildroot}%{_sbindir}/varnish_reload_vcl install -D -m 0755 redhat/varnishreload %{buildroot}%{_sbindir}/varnishreload
echo %{_libdir}/varnish > %{buildroot}%{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf echo %{_libdir}/varnish > %{buildroot}%{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf
@ -257,27 +239,26 @@ install -p -m 644 -D varnish4.pp %{buildroot}%{_datadir}/selinux/packages/%{name
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_sbindir}/* %{_sbindir}/*
%{_bindir}/* %{_bindir}/*
%{_libdir}/*.so.*
%{_libdir}/varnish
%{_var}/lib/varnish %{_var}/lib/varnish
%attr(0700,varnish,varnish) %dir %{_var}/log/varnish %attr(0700,varnish,varnish) %dir %{_var}/log/varnish
%{_mandir}/man1/*.1* %{_mandir}/man1/*.1*
%{_mandir}/man3/*.3* %{_mandir}/man3/*.3*
%{_mandir}/man7/*.7* %{_mandir}/man7/*.7*
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%license LICENSE %license LICENSE
%else
%doc LICENSE
%endif
%doc README.rst ChangeLog %doc README.rst ChangeLog
%doc etc/builtin.vcl etc/example.vcl %doc etc/builtin.vcl etc/example.vcl
%dir %{_sysconfdir}/varnish/ %dir %{_sysconfdir}/varnish/
%config(noreplace) %{_sysconfdir}/varnish/default.vcl %config(noreplace) %{_sysconfdir}/varnish/default.vcl
%config(noreplace) %{_sysconfdir}/logrotate.d/varnish %config(noreplace) %{_sysconfdir}/logrotate.d/varnish
%config %{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf
# systemd from fedora 17 and rhel 7 # systemd from fedora 17 and rhel 7
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%{_unitdir}/varnish.service %{_unitdir}/varnish.service
%{_unitdir}/varnishncsa.service %{_unitdir}/varnishncsa.service
%config(noreplace)%{_sysconfdir}/varnish/varnish.params
# default is standard sysvinit # default is standard sysvinit
%else %else
@ -286,31 +267,21 @@ install -p -m 644 -D varnish4.pp %{buildroot}%{_datadir}/selinux/packages/%{name
%{_initrddir}/varnishncsa %{_initrddir}/varnishncsa
%endif %endif
%files libs
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%{_libdir}/varnish
%doc LICENSE
%config %{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%license LICENSE
%doc README.rst
%{_libdir}/lib*.so %{_libdir}/lib*.so
%{_includedir}/%{name} %{_includedir}/%{name}
%{_libdir}/pkgconfig/varnishapi.pc %{_libdir}/pkgconfig/varnishapi.pc
%{_datadir}/%{name} %{_datadir}/%{name}
%{_datadir}/aclocal/*.m4 %{_datadir}/aclocal/*.m4
%doc LICENSE
%files docs %files docs
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc LICENSE %license LICENSE
%doc doc/sphinx %doc doc/html
#if 0%{?rhel} >= 6 || 0%{?fedora} > 12 %doc doc/changes*.html
#doc doc/html
#doc doc/changes*.html
#endif
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
%files selinux %files selinux
@ -335,24 +306,13 @@ exit 0
/sbin/chkconfig --add varnishncsa /sbin/chkconfig --add varnishncsa
%endif %endif
/sbin/ldconfig
# Previous versions had varnishlog and varnishncsa running as root # Previous versions had varnishlog and varnishncsa running as root
chown varnish:varnish /var/log/varnish/varnishncsa.log || true chown varnish:varnish /var/log/varnish/varnishncsa.log 2>/dev/null || true
test -f /etc/varnish/secret || (uuidgen > /etc/varnish/secret && chmod 0600 /etc/varnish/secret) test -f /etc/varnish/secret || (uuidgen > /etc/varnish/secret && chmod 0600 /etc/varnish/secret)
%triggerun -- varnish < 3.0.2-1
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply varnish
# to migrate them to systemd targets
%{_bindir}/systemd-sysv-convert --save varnish >/dev/null 2>&1 ||:
# If the package is allowed to autostart:
#/bin/systemctl --no-reload enable varnish.service >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del varnish >/dev/null 2>&1 || :
#/bin/systemctl try-restart varnish.service >/dev/null 2>&1 || :
# selinux module for el6 # selinux module for el6
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
%post selinux %post selinux
@ -365,6 +325,13 @@ if [ "$1" -lt "1" ] ; then # Final removal
semodule -r varnish4 2>/dev/null || : semodule -r varnish4 2>/dev/null || :
fi fi
%postun
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%systemd_postun_with_restart varnish.service
%endif
/sbin/ldconfig
%postun selinux %postun selinux
if [ "$1" -ge "1" ] ; then # Upgrade if [ "$1" -ge "1" ] ; then # Upgrade
semodule -i %{_datadir}/selinux/packages/%{name}/varnish4.pp 2>/dev/null || : semodule -i %{_datadir}/selinux/packages/%{name}/varnish4.pp 2>/dev/null || :
@ -393,15 +360,26 @@ if [ $1 -lt 1 ]; then
fi fi
%endif %endif
%post libs -p /sbin/ldconfig
%postun libs
/sbin/ldconfig
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%systemd_postun_with_restart varnish.service
%endif
%changelog %changelog
* Wed Apr 25 2018 Ingvar Hagelund <ingvar@redpill-linpro.com> - 6.0.0-1
- New upstream release
- Added a patch that fixes _FORTIFY_SOURCE=2 on copr/el6
- Added a patch fixing compilation on epel6
- Fresh checkout of pkg-varnish-cache
- Updated find-requires sed fix to update variant and moved it to prep
- Removed -libs subpackage
- varnish_reload_vcl changed name to varnishreload, as in upstream
- varnish.params is gone. To override startup configuration,
use /etc/systemd/system/varnish.service
- Dropped patch and sed fixes for find-provides, as it is fixed upstream
- Dropped patch for test vsv00002, as it is fixed upstream
- Dropped buildreq on groff, as tarball includes prebuilt manpages
- Dropped systemv to systemd helpers
- Updated project url
- Use prebuilt html files for docs subpackage
- Dropped unnecessary explicit require of initscripts, closes #1592398
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.1-4.1 * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.1-4.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild