Switched from bcond to bcond_with for compatibility with el8 and el9

haproxy builddep on systems with haproxy2
Disable pcre2-jit only for fedora <= 37 on 32bit x86
This commit is contained in:
Ingvar Hagelund 2023-03-20 19:05:05 +01:00
parent 1951aa387e
commit c37e152be9

View File

@ -22,9 +22,9 @@
# Default: Use jemalloc, as adviced by upstream project # Default: Use jemalloc, as adviced by upstream project
# Change to 1 to use system allocator (ie. glibc) # Change to 1 to use system allocator (ie. glibc)
%bcond system_allocator 0 %bcond_with system_allocator
%if 0%{with system_allocator} %if %{with system_allocator}
# use _lto_cflags if present # use _lto_cflags if present
%else %else
%global _lto_cflags %{nil} %global _lto_cflags %{nil}
@ -33,7 +33,7 @@
Summary: High-performance HTTP accelerator Summary: High-performance HTTP accelerator
Name: varnish Name: varnish
Version: 7.3.0 Version: 7.3.0
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
@ -68,15 +68,18 @@ BuildRequires: ncurses-devel
BuildRequires: pcre2-devel BuildRequires: pcre2-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: systemd-units BuildRequires: systemd-units
%if 0%{with system_allocator} %if %{with system_allocator}
# use glibc # use glibc
%else %else
BuildRequires: jemalloc-devel BuildRequires: jemalloc-devel
%endif %endif
# Extra requirements for the build suite # Extra requirements for the build suite
BuildRequires: nghttp2 # needs haproxy2
%if 0%{?fedora} > 30 || 0%{?rhel} > 8
BuildRequires: haproxy BuildRequires: haproxy
%endif
BuildRequires: nghttp2
Requires: logrotate Requires: logrotate
Requires: ncurses Requires: ncurses
@ -91,7 +94,7 @@ 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
%if 0%{with system_allocator} %if %{with system_allocator}
# use glibc # use glibc
%else %else
Requires: jemalloc Requires: jemalloc
@ -136,7 +139,7 @@ cp redhat/find-provides .
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 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
%build %build
%if 0%{with system_allocator} %if %{with system_allocator}
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
%else %else
# nilled _lto_cflags above because they remove the deps on jemalloc. # nilled _lto_cflags above because they remove the deps on jemalloc.
@ -173,9 +176,11 @@ export PYTHON=%{__python}
--with-contrib \ --with-contrib \
--docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} \ --docdir=%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}} \
%ifarch %ix86 %ifarch %ix86
%if 0%{?fedora} <= 37
--enable-pcre2-jit=no \ --enable-pcre2-jit=no \
%endif %endif
%if 0%{with system_allocator} %endif
%if %{with system_allocator}
--with-jemalloc=no \ --with-jemalloc=no \
%endif %endif
@ -294,6 +299,11 @@ test -f /etc/varnish/secret || (uuidgen > /etc/varnish/secret && chmod 0600 /etc
%changelog %changelog
* Mon Mar 20 2023 Ingvar Hagelund <ingvar@redpill-linpro.com> - 7.3.0-2
- Switched from bcond to bcond_with for compatibility with el8 and el9
- haproxy builddep on systems with haproxy2
- Disable pcre2-jit only for fedora <= 37 on 32bit x86
* Thu Mar 16 2023 Ingvar Hagelund <ingvar@redpill-linpro.com> - 7.3.0-1 * Thu Mar 16 2023 Ingvar Hagelund <ingvar@redpill-linpro.com> - 7.3.0-1
- New upstream release - New upstream release
- Added a bcond system_allocator for skipping jemalloc, bz#1917697 - Added a bcond system_allocator for skipping jemalloc, bz#1917697