Source0: knot-resolver_%{version}.orig.tar.xz
# LuaJIT only on these arches
-%if 0%{?rhel}
+%if 0%{?rhel} == 7
# RHEL 7 does not have aarch64 LuaJIT
ExclusiveArch: %{ix86} x86_64
%else
Requires(post): systemd
# Distro-dependent dependencies
-%if 0%{?rhel}
+%if 0%{?rhel} == 7
BuildRequires: lmdb-devel
# Lua 5.1 version of the libraries have different package names
Requires: lua-basexx
Requires: lua-http
Requires(pre): shadow-utils
%endif
-%if 0%{?fedora}
+%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: pkgconfig(lmdb)
BuildRequires: python3-sphinx
Requires: lua5.1-basexx
%if "x%{?rhel}" == "x"
# dependencies for doc package
-# NOTE: doc isn't possible to build on CentOS 7
-# python2-sphinx is too old and python36-breathe is broken
+# NOTE: doc isn't possible to build on CentOS 7, 8
+# python2-sphinx is too old and python36-breathe is broken on CentOS 7
+# python3-breathe isn't available for CentOS 8 (yet? rhbz#1808766)
BuildRequires: doxygen
BuildRequires: python3-breathe
BuildRequires: python3-sphinx_rtd_theme
%package module-http
Summary: HTTP/2 module for Knot Resolver
Requires: %{name} = %{version}-%{release}
-%if 0%{?fedora}
+%if 0%{?fedora} || 0%{?rhel} > 7
Requires: lua5.1-http
Requires: lua5.1-mmdb
%else
rm %{buildroot}%{_libdir}/knot-resolver/kres_modules/prometheus.lua
%endif
-# rename doc directory for centos, opensuse
-%if "x%{?fedora}" == "x"
+# rename doc directory for centos 7, opensuse
+%if 0%{?suse_version} || 0%{?rhel} == 7
install -m 755 -d %{buildroot}/%{_pkgdocdir}
mv %{buildroot}/%{_datadir}/doc/%{name}/* %{buildroot}/%{_pkgdocdir}/
%endif