Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/varnish.git#cbc6e0615f50cb678b8face5b67a25a01f241b20
This commit is contained in:
DistroBaker 2021-01-25 14:04:54 +00:00
parent 86d904c69b
commit 999549e3c8

View File

@ -2,7 +2,7 @@
# https://github.com/varnishcache/varnish-cache/issues/2269 # https://github.com/varnishcache/varnish-cache/issues/2269
%global debug_package %{nil} %global debug_package %{nil}
%if 0%{?rhel} == 6 || 0%{?rhel} == 7 %if 0%{?rhel} == 7
%global _use_internal_dependency_generator 0 %global _use_internal_dependency_generator 0
%global __find_provides %{_builddir}/%{name}-%{version}/find-provides %__find_provides %global __find_provides %{_builddir}/%{name}-%{version}/find-provides %__find_provides
%global __python /usr/bin/python3.4 %global __python /usr/bin/python3.4
@ -23,7 +23,7 @@
Summary: High-performance HTTP accelerator Summary: High-performance HTTP accelerator
Name: varnish Name: varnish
Version: 6.5.1 Version: 6.5.1
Release: 1%{?dist} Release: 2%{?dist}
License: BSD License: BSD
URL: https://www.varnish-cache.org/ URL: https://www.varnish-cache.org/
Source0: http://varnish-cache.org/_downloads/%{name}-%{version}.tgz Source0: http://varnish-cache.org/_downloads/%{name}-%{version}.tgz
@ -36,7 +36,7 @@ Source1: https://github.com/varnishcache/pkg-varnish-cache/archive/%{commit1}.ta
#Patch1: varnish-6.1.1_fix_ld_library_path_in_doc_build.patch #Patch1: varnish-6.1.1_fix_ld_library_path_in_doc_build.patch
# Patch 004: varnish selinux support for el6 # Patch 004: varnish selinux support for el6
Patch4: varnish-4.0.3_fix_varnish4_selinux.el6.patch #Patch4: varnish-4.0.3_fix_varnish4_selinux.el6.patch
# Patch 009: Hard code older python support in configure for older el releases # Patch 009: Hard code older python support in configure for older el releases
#Patch9: varnish-5.1.1.fix_python_version.patch #Patch9: varnish-5.1.1.fix_python_version.patch
@ -56,7 +56,7 @@ Patch4: varnish-4.0.3_fix_varnish4_selinux.el6.patch
# Patch 016: Fix some warnings that prohibited clean -Werror compilation # Patch 016: Fix some warnings that prohibited clean -Werror compilation
# on el6. Will not be fixed upstream. Patch grows more stupid # on el6. Will not be fixed upstream. Patch grows more stupid
# for each iteration :-( # for each iteration :-(
Patch16: varnish-6.5.0_el6_fix_warning_from_old_gcc.patch #Patch16: varnish-6.5.0_el6_fix_warning_from_old_gcc.patch
# Patch 017: Fix stack size on ppc64 in test c_00057, upstream commit 88948d9 # Patch 017: Fix stack size on ppc64 in test c_00057, upstream commit 88948d9
#Patch17: varnish-6.2.0_fix_ppc64_for_test_c00057.patch #Patch17: varnish-6.2.0_fix_ppc64_for_test_c00057.patch
@ -80,8 +80,8 @@ Provides: vmod(vtc)%{_isa} = %{version}-%{release}
Obsoletes: varnish-libs < %{version}-%{release} Obsoletes: varnish-libs < %{version}-%{release}
%if 0%{?rhel} == 6 || 0%{?rhel} == 7 %if 0%{?rhel} == 7
BuildRequires: python34 python-sphinx python34-docutils BuildRequires: python34 python34-sphinx python34-docutils
%else %else
BuildRequires: python3, python3-sphinx, python3-docutils BuildRequires: python3, python3-sphinx, python3-docutils
%endif %endif
@ -101,9 +101,6 @@ BuildRequires: nghttp2
#BuildRequires: haproxy #BuildRequires: haproxy
#endif #endif
%if 0%{?rhel} == 6
BuildRequires: selinux-policy
%endif
Requires: logrotate Requires: logrotate
Requires: ncurses Requires: ncurses
Requires: pcre Requires: pcre
@ -114,22 +111,11 @@ Requires(post): /usr/bin/uuidgen
# Varnish actually needs gcc installed to work. It uses the C compiler # Varnish actually needs gcc installed to work. It uses the C compiler
# at runtime to compile the VCL configuration files. This is by design. # at runtime to compile the VCL configuration files. This is by design.
Requires: gcc Requires: gcc
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
Requires(post): systemd-units Requires(post): systemd-units
Requires(post): systemd-sysv Requires(post): systemd-sysv
Requires(preun): systemd-units Requires(preun): systemd-units
Requires(postun): systemd-units Requires(postun): systemd-units
BuildRequires: systemd-units BuildRequires: systemd-units
%endif
%if 0%{?rhel} == 6
Requires: %{name}-selinux
Requires(post): policycoreutils,
Requires(preun): policycoreutils
Requires(postun): policycoreutils
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
%endif
%description %description
This is Varnish Cache, a high-performance HTTP accelerator. This is Varnish Cache, a high-performance HTTP accelerator.
@ -154,11 +140,7 @@ Development files for %{name}
Varnish Cache is a high-performance HTTP accelerator Varnish Cache is a high-performance HTTP accelerator
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
%if 0%{?rhel} == 6
Requires: python34
%else
Requires: python3 Requires: python3
%endif
%package docs %package docs
Summary: Documentation files for %name Summary: Documentation files for %name
@ -166,44 +148,20 @@ Summary: Documentation files for %name
%description docs %description docs
Documentation files for %name Documentation files for %name
%if 0%{?rhel} == 6
%package selinux
Summary: Minimal selinux policy for running varnish
%description selinux
Minimal selinux policy for running varnish4
%endif
%prep %prep
%setup -q %setup -q
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 . cp redhat/find-provides .
%if 0%{?rhel} == 6 sed -i 's,rst2man-3.6,rst2man-3.4,g; s,rst2html-3.6,rst2html-3.4,g; s,phinx-build-3.6,phinx-build-3.4,g' configure
cp pkg-varnish-cache-%{commit1}/sysv/redhat/* redhat/
sed -i '8 i\RPM_BUILD_ROOT=%{buildroot}' find-provides
%endif
%if 0%{?rhel} == 6
%patch4 -p0
%patch16 -p1
%endif
%build %build
%if 0%{?rhel} == 6
export CFLAGS="%{optflags} -fPIC"
export LDFLAGS=" -pie"
%endif
# https://gcc.gnu.org/wiki/FAQ#PR323 # https://gcc.gnu.org/wiki/FAQ#PR323
%ifarch %ix86 %ifarch %ix86
%if 0%{?fedora} > 21 %if 0%{?fedora} > 21
export CFLAGS="%{optflags} -ffloat-store -fexcess-precision=standard" export CFLAGS="%{optflags} -ffloat-store -fexcess-precision=standard"
%endif %endif
%if 0%{?rhel} >= 6
export CFLAGS="%{optflags} -fno-exceptions -fPIC -ffloat-store"
%endif
%endif %endif
%ifarch s390x %ifarch s390x
@ -223,14 +181,6 @@ export PYTHON=%{__python}
%configure LT_SYS_LIBRARY_PATH=%_libdir \ %configure LT_SYS_LIBRARY_PATH=%_libdir \
--disable-static \ --disable-static \
%ifarch aarch64
%if 0%{?rhel} > 0
--with-jemalloc=no \
%endif
%endif
%if 0%{?rhel} != 6
--with-sphinx-build=sphinx-build-3.4 \
%endif
--localstatedir=/var/lib \ --localstatedir=/var/lib \
--docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} \ --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} \
# --disable-pcre-jit \ # --disable-pcre-jit \
@ -245,15 +195,8 @@ rm -rf doc/html/_sources
%check %check
# rhbz #1690796
%if 0%{?rhel} == 6
%ifarch ppc64 ppc64le aarch64
rm bin/varnishtest/tests/c00057.vtc
%endif
%endif
# Remove this for now. Hard to get the size and timing right # Remove this for now. Hard to get the size and timing right
%ifarch s390 s390x %ifarch s390 s390x aarch64
rm bin/varnishtest/tests/o00005.vtc rm bin/varnishtest/tests/o00005.vtc
%endif %endif
@ -263,8 +206,8 @@ make %{?_smp_mflags} check VERBOSE=1
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
# mock el6 and el7 defaults to LANG=C, which makes python3 fail when parsing utf8 text # mock el7 defaults to LANG=C, which makes python3 fail when parsing utf8 text
%if 0%{?rhel} == 6 || 0%{?rhel} == 7 %if 0%{?rhel} == 7
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
%endif %endif
@ -282,18 +225,9 @@ install -D -m 0644 redhat/varnish.logrotate %{buildroot}%{_sysconfdir}/logrotate
install -D -m 0644 include/vcs_version.h %{buildroot}%{_includedir}/varnish install -D -m 0644 include/vcs_version.h %{buildroot}%{_includedir}/varnish
install -D -m 0644 include/vrt.h %{buildroot}%{_includedir}/varnish install -D -m 0644 include/vrt.h %{buildroot}%{_includedir}/varnish
# systemd support
%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/varnishncsa.service %{buildroot}%{_unitdir}/varnishncsa.service install -D -m 0644 redhat/varnishncsa.service %{buildroot}%{_unitdir}/varnishncsa.service
# 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/varnishncsa.initrc %{buildroot}%{_initrddir}/varnishncsa
%endif
install -D -m 0755 redhat/varnishreload %{buildroot}%{_sbindir}/varnishreload 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
@ -302,12 +236,6 @@ echo %{_libdir}/varnish > %{buildroot}%{_sysconfdir}/ld.so.conf.d/varnish-%{_arc
chmod 644 lib/libvmod_*/*.c chmod 644 lib/libvmod_*/*.c
chmod 644 lib/libvmod_*/*.h chmod 644 lib/libvmod_*/*.h
# selinux module for el6
%if 0%{?rhel} == 6
cd selinux
make -f %{_datadir}/selinux/devel/Makefile
install -p -m 644 -D varnish4.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/varnish4.pp
%endif
%files %files
%{_sbindir}/* %{_sbindir}/*
@ -328,18 +256,9 @@ install -p -m 644 -D varnish4.pp %{buildroot}%{_datadir}/selinux/packages/%{name
%config %{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf %config %{_sysconfdir}/ld.so.conf.d/varnish-%{_arch}.conf
# systemd from fedora 17 and rhel 7
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%{_unitdir}/varnish.service %{_unitdir}/varnish.service
%{_unitdir}/varnishncsa.service %{_unitdir}/varnishncsa.service
# default is standard sysvinit
%else
%config(noreplace) %{_sysconfdir}/sysconfig/varnish
%{_initrddir}/varnish
%{_initrddir}/varnishncsa
%endif
%files devel %files devel
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
@ -354,10 +273,6 @@ install -p -m 644 -D varnish4.pp %{buildroot}%{_datadir}/selinux/packages/%{name
%doc doc/html %doc doc/html
%doc doc/changes*.html %doc doc/changes*.html
%if 0%{?rhel} == 6
%files selinux
%{_datadir}/selinux/packages/%{name}/varnish4.pp
%endif
%pre %pre
getent group varnish >/dev/null || groupadd -r varnish getent group varnish >/dev/null || groupadd -r varnish
@ -366,72 +281,27 @@ getent passwd varnish >/dev/null || \
-c "Varnish Cache" varnish -c "Varnish Cache" varnish
exit 0 exit 0
%post %post
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%systemd_post varnish varnishncsa %systemd_post varnish varnishncsa
# Other distros: Use chkconfig
%else
/sbin/chkconfig --add varnish
/sbin/chkconfig --add varnishncsa
%endif
/sbin/ldconfig /sbin/ldconfig
# Previous versions had varnishlog and varnishncsa running as root
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)
# selinux module for el6
%if 0%{?rhel} == 6
%post selinux
if [ "$1" -le "1" ] ; then # First install
semodule -i %{_datadir}/selinux/packages/%{name}/varnish4.pp 2>/dev/null || :
fi
%preun selinux
if [ "$1" -lt "1" ] ; then # Final removal
semodule -r varnish4 2>/dev/null || :
fi
%postun %postun
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%systemd_postun_with_restart varnish varnishncsa %systemd_postun_with_restart varnish varnishncsa
%endif
/sbin/ldconfig /sbin/ldconfig
%postun selinux
if [ "$1" -ge "1" ] ; then # Upgrade
semodule -i %{_datadir}/selinux/packages/%{name}/varnish4.pp 2>/dev/null || :
fi
%endif
%preun %preun
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%systemd_preun varnish varnishncsa %systemd_preun varnish varnishncsa
%else
if [ $1 -lt 1 ]; then
# Package removal, not upgrade
%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 varnishncsa.service > /dev/null 2>&1 || :
%else
/sbin/service varnish stop > /dev/null 2>&1
/sbin/service varnishncsa stop > /dev/null 2>%1
/sbin/chkconfig --del varnish
/sbin/chkconfig --del varnishncsa
%endif
fi
%endif
%changelog %changelog
* Thu Jan 21 2021 Ingvar Hagelund <ingvar@redpill-linpro.com> 6.5.1-2
- Pulled support for el6
- Pulled support for sysvinit
- aarch64 builds now with jemalloc again on el7
* Fri Sep 25 2020 Ingvar Hagelund <ingvar@redpill-linpro.com> 6.5.1-1 * Fri Sep 25 2020 Ingvar Hagelund <ingvar@redpill-linpro.com> 6.5.1-1
- New upstream release varnish-6.5.1 - New upstream release varnish-6.5.1