%global _hardened_build 1 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}} %define GPG_CHECK 1 %if 0%{?fedora} >= 40 || 0%{?rhel} >= 9 # use modern pyproject_* macros on distros which support them %define PYPROJECT 1 %else # use older py3_* macros on older/other distros %define PYPROJECT 0 %endif %define BASE_VERSION %(echo "%{version}" | sed 's/^\\([^.]\\+\\.[^.]\\+\\).*/\\1/') %define repodir %{_builddir}/%{name}-%{version} Summary: High-performance authoritative DNS server Name: knot Version: 3.6.0 Release: 1%{?dist} License: GPL-2.0-or-later URL: https://www.knot-dns.cz Source0: https://secure.nic.cz/files/knot-dns/%{name}-%{version}.tar.xz %if 0%{?GPG_CHECK} Source1: https://secure.nic.cz/files/knot-dns/%{name}-%{version}.tar.xz.asc # PGP keys used to sign upstream releases # Export with --armor using command from https://fedoraproject.org/wiki/PackagingDrafts:GPGSignatures # Don't forget to update %%prep section when adding/removing keys Source100: gpgkey-742FA4E95829B6C5EAC6B85710BB7AF6FEBBD6AB.gpg.asc BuildRequires: gnupg2 %endif # Required dependencies BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: make BuildRequires: gcc BuildRequires: pkgconfig(liburcu) BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(libedit) # Optional dependencies BuildRequires: pkgconfig(libcap-ng) BuildRequires: pkgconfig(libidn2) BuildRequires: pkgconfig(libmnl) BuildRequires: pkgconfig(libnghttp2) BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(hiredis) %if 0%{?fedora} || 0%{?rhel} BuildRequires: softhsm %endif # dnstap dependencies BuildRequires: pkgconfig(libfstrm) BuildRequires: pkgconfig(libprotobuf-c) # geoip dependencies BuildRequires: pkgconfig(libmaxminddb) # XDP dependencies BuildRequires: pkgconfig(libbpf) # Python modules (python3-libknot, knot-exporter) dependencies BuildRequires: python3-devel %if 0%{?PYPROJECT} BuildRequires: pyproject-rpm-macros BuildRequires: python3-pip BuildRequires: python3-hatchling %else BuildRequires: python3-setuptools %endif # Distro-dependent dependencies %if 0%{?suse_version} BuildRequires: python3-Sphinx BuildRequires: lmdb-devel BuildRequires: protobuf-c Requires(pre): pwdutils %if 0%{?sle_version} != 150400 BuildRequires: pkgconfig(libxdp) %endif %endif %if 0%{?fedora} || 0%{?rhel} BuildRequires: python3-sphinx BuildRequires: pkgconfig(lmdb) %if 0%{?fedora} || 0%{?rhel} >= 9 BuildRequires: pkgconfig(libxdp) %endif %endif %if 0%{?rhel} >= 9 || 0%{?suse_version} || 0%{?fedora} %define configure_quic --enable-quic=yes %endif Requires(post): systemd %{_sbindir}/runuser Requires(preun): systemd Requires(postun): systemd Requires: %{name}-libs%{?_isa} = %{version}-%{release} Recommends: %{name}-keymgr %if 0%{?suse_version} Provides: group(knot) %endif # LMDB 1.0 makes incompatible changes to the binary database format. If LMDB # is updated in Fedora, we can switch to the embedded version. Conflicts: lmdb >= 1.0 %description Knot DNS is a high-performance authoritative DNS server implementation. %package libs Summary: Libraries used by the Knot DNS server and client applications # Knot DNS 3.5+ isn't compatible with earlier knot-resolver Conflicts: knot-resolver < 5.7.6-3 %description libs The package contains shared libraries used by the Knot DNS server and utilities. %package devel Summary: Development header files for the Knot DNS libraries Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description devel The package contains development header files for the Knot DNS libraries included in knot-libs package. %package utils Summary: DNS client utilities shipped with the Knot DNS server Requires: %{name}-libs%{?_isa} = %{version}-%{release} # Debian package compat Provides: %{name}-dnsutils = %{version}-%{release} %description utils The package contains DNS client utilities shipped with the Knot DNS server. %package dnssecutils Summary: DNSSEC tools shipped with the Knot DNS server Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description dnssecutils The package contains DNSSEC tools shipped with the Knot DNS server. %package keymgr Summary: Knot DNS key management utility Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description keymgr The package contains keymgr program for Knot DNS key management. %package module-dnstap Summary: Knot DNS dnstap module Requires: %{name} = %{version}-%{release} %description module-dnstap The package contains Knot DNS module for logging DNS traffic in dnstap format. %package module-geoip Summary: Knot DNS geoip module Requires: %{name} = %{version}-%{release} %description module-geoip The package contains Knot DNS module for geography-based responses. %package exporter Summary: Prometheus exporter for Knot DNS BuildArch: noarch Requires: %{name}-libs = %{version}-%{release} %description exporter The package provides Python Prometheus exporter for Knot DNS. %package -n python3-libknot Summary: Python bindings for libknot BuildArch: noarch Requires: %{name}-libs = %{version}-%{release} %{?python_provide:%python_provide python3-libknot} %description -n python3-libknot The package provides Python bindings for the libknot shared library. %package -n valkey-module-knot Summary: Knot DNS module for Valkey support Requires: %{name}-libs = %{version}-%{release} %description -n valkey-module-knot The package provides Knot DNS module to support storing zone data in Valkey (Redis). %package doc Summary: Documentation for the Knot DNS server BuildArch: noarch Provides: bundled(jquery) %description doc The package contains documentation for the Knot DNS server. On-line version is available on https://www.knot-dns.cz/documentation/ %prep %if 0%{?GPG_CHECK} export GNUPGHOME=./gpg-keyring [ -d ${GNUPGHOME} ] && rm -r ${GNUPGHOME} mkdir --mode=700 ${GNUPGHOME} gpg2 --import %{SOURCE100} gpg2 --verify %{SOURCE1} %{SOURCE0} %endif %autosetup -p1 # Create a sysusers.d config file cat >knot.sysusers.conf < 7 install -p -m 0644 -D %{repodir}/distro/common/cz.nic.knotd.conf %{buildroot}%{_datadir}/dbus-1/system.d/cz.nic.knotd.conf %endif # install systemd files install -p -m 0644 -D %{repodir}/distro/common/%{name}.service %{buildroot}%{_unitdir}/%{name}.service %if 0%{?suse_version} ln -s service %{buildroot}/%{_sbindir}/rcknot %endif # create storage dir install -d %{buildroot}%{_sharedstatedir} install -d -m 0770 -D %{buildroot}%{_sharedstatedir}/knot # remove libarchive files find %{buildroot} -type f -name "*.la" -delete -print install -m0644 -D knot.sysusers.conf %{buildroot}%{_sysusersdir}/knot.conf %check V=1 make check %pre %if 0%{?suse_version} %service_add_pre knot.service %endif %post %if 0%{?suse_version} %service_add_post knot.service %else %systemd_post knot.service %endif %preun %if 0%{?suse_version} %service_del_preun knot.service %else %systemd_preun knot.service %endif %postun %if 0%{?suse_version} %service_del_postun knot.service %else %systemd_postun_with_restart knot.service %endif %if 0%{?fedora} || 0%{?rhel} > 7 # https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets %else %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %endif %files %license COPYING %doc %{_pkgdocdir} %exclude %{_pkgdocdir}/html %attr(750,root,knot) %dir %{_sysconfdir}/knot %config(noreplace) %attr(640,root,knot) %{_sysconfdir}/knot/knot.conf %if 0%{?fedora} || 0%{?rhel} > 7 %attr(644,root,root) %{_datadir}/dbus-1/system.d/cz.nic.knotd.conf %endif %attr(770,root,knot) %dir %{_sharedstatedir}/knot %dir %{_libdir}/knot %dir %{_libdir}/knot/modules-* %{_unitdir}/knot.service %{_sbindir}/kcatalogprint %{_sbindir}/kjournalprint %{_sbindir}/knotc %{_sbindir}/knotd %if 0%{?suse_version} %{_sbindir}/rcknot %endif %{_mandir}/man5/knot.conf.* %{_mandir}/man8/kcatalogprint.* %{_mandir}/man8/kjournalprint.* %{_mandir}/man8/knotc.* %{_mandir}/man8/knotd.* %ghost %attr(770,root,knot) %dir %{_rundir}/knot %{_sysusersdir}/knot.conf %files utils %{_bindir}/kdig %{_bindir}/khost %{_bindir}/knsupdate %{_sbindir}/kxdpgun %{_mandir}/man8/kxdpgun.* %{_mandir}/man1/kdig.* %{_mandir}/man1/khost.* %{_mandir}/man1/knsupdate.* %files dnssecutils %{_bindir}/knsec3hash %{_bindir}/kzonecheck %{_bindir}/kzonesign %{_mandir}/man1/knsec3hash.* %{_mandir}/man1/kzonecheck.* %{_mandir}/man1/kzonesign.* %files keymgr %{_sbindir}/keymgr %{_mandir}/man8/keymgr.* %files module-dnstap %{_libdir}/knot/modules-*/dnstap.so %files module-geoip %{_libdir}/knot/modules-*/geoip.so %files exporter %{_bindir}/knot-exporter %{python3_sitelib}/knot_exporter %{python3_sitelib}/knot_exporter-*-info %files -n python3-libknot %{python3_sitelib}/libknot %{python3_sitelib}/libknot-*-info %files -n valkey-module-knot %attr(0755, root, root) %{_libdir}/valkey/modules/knot.so %files libs %license COPYING %doc NEWS %doc README.md %{_libdir}/libknot.so.* %{_libdir}/libzscanner.so.* %files devel %{_includedir}/knot %{_includedir}/libknot %{_includedir}/libzscanner %{_libdir}/libknot.so %{_libdir}/libzscanner.so %{_libdir}/pkgconfig/knotd.pc %{_libdir}/pkgconfig/libknot.pc %{_libdir}/pkgconfig/libzscanner.pc %files doc %dir %{_pkgdocdir} %doc %{_pkgdocdir}/html %changelog * Tue Sep 08 2026 Jan Včelák - 3.6.0-1 - Update to 3.6.0 * Mon Sep 07 2026 Jan Včelák - 3.5.8-1 - Update to 3.5.8 (security fixes in XDP, DDNS, and TSIG) * Tue Aug 18 2026 Jan Včelák - 3.5.7-1 - Update to 3.5.7 (security fixes) * Sun Aug 02 2026 Jan Včelák - 3.5.6-1 - Update to 3.5.6 (security fix for ACL evaluation) * Thu Jul 16 2026 Fedora Release Engineering - 3.5.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild * Mon Jun 22 2026 Jan Včelák - 3.5.5-1 - Update to 3.5.5 * Wed Jun 03 2026 Python Maint - 3.5.4-2 - Rebuilt for Python 3.15 * Tue Apr 07 2026 Jan Včelák - 3.5.4-1 - Update to 3.5.4 * Sat Mar 28 2026 Jan Včelák - 3.5.3-1 - Update to 3.5.3 * Fri Jan 16 2026 Fedora Release Engineering - 3.5.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild * Fri Dec 19 2025 Jakub Ružička - 3.5.2-1 - Update to 3.5.2 * Thu Oct 16 2025 Jakub Ružička - 3.5.1-1 - Update to 3.5.1 - Add new valkey-module-knot package - Split keymgr into knot-keymgr package