2021-01-30 02:38:56 +01:00
|
|
|
#
|
|
|
|
# spec file for package knot
|
|
|
|
#
|
2022-02-08 14:13:57 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2021-01-30 02:38:56 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2021-03-25 20:35:12 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2021-01-30 02:38:56 +01:00
|
|
|
#
|
|
|
|
|
2021-03-25 20:35:12 +01:00
|
|
|
|
2021-09-17 22:20:10 +02:00
|
|
|
%define libdnssec libdnssec8
|
|
|
|
%define libknot libknot12
|
|
|
|
%define libzscanner libzscanner4
|
|
|
|
%define pkg_name knot
|
2021-01-30 02:38:56 +01:00
|
|
|
%bcond_without dnstap
|
|
|
|
%bcond_without lto
|
|
|
|
%bcond_without systemd
|
|
|
|
%if 0%{?is_opensuse}
|
|
|
|
%bcond_without maxminddb
|
|
|
|
%else
|
|
|
|
%bcond_with maxminddb
|
|
|
|
%endif
|
|
|
|
%bcond_without docs
|
2021-09-17 22:20:10 +02:00
|
|
|
%if %{with systemd}
|
|
|
|
%define has_systemd 1
|
|
|
|
BuildRequires: systemd-devel
|
|
|
|
%{?systemd_requires}
|
|
|
|
%endif
|
2021-01-30 02:38:56 +01:00
|
|
|
Name: knot
|
2022-03-30 10:31:32 +02:00
|
|
|
Version: 3.1.7
|
2021-03-25 20:35:12 +01:00
|
|
|
Release: 0
|
2021-01-30 02:38:56 +01:00
|
|
|
Summary: An authoritative DNS daemon
|
2021-03-25 20:35:12 +01:00
|
|
|
License: GPL-3.0-or-later
|
2021-01-30 02:38:56 +01:00
|
|
|
Group: Productivity/Networking/DNS/Servers
|
2021-09-17 22:20:10 +02:00
|
|
|
URL: https://www.knot-dns.cz/
|
2021-01-30 02:38:56 +01:00
|
|
|
Source0: https://secure.nic.cz/files/knot-dns/%{pkg_name}-%{version}.tar.xz
|
|
|
|
Source1: knot.service
|
|
|
|
Source2: knot-tmp.conf
|
|
|
|
Source3: https://secure.nic.cz/files/knot-dns/%{pkg_name}-%{version}.tar.xz.asc
|
2021-09-17 22:20:10 +02:00
|
|
|
Source4: system-user-knot.conf
|
|
|
|
BuildRequires: libcap-ng-devel
|
2021-01-30 02:38:56 +01:00
|
|
|
BuildRequires: libedit-devel
|
2021-09-17 22:20:10 +02:00
|
|
|
BuildRequires: liburcu-devel
|
|
|
|
BuildRequires: lmdb-devel >= 0.9.15
|
|
|
|
BuildRequires: openssl-devel
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: sysuser-tools
|
|
|
|
BuildRequires: xz
|
|
|
|
BuildRequires: pkgconfig(gnutls) >= 3.3
|
|
|
|
BuildRequires: pkgconfig(nettle)
|
|
|
|
Obsoletes: knot2 < %{version}
|
|
|
|
%sysusers_requires
|
2021-01-30 02:38:56 +01:00
|
|
|
%if 0%{?suse_version} > 1320 || 0%{?leap_version} == 420300
|
|
|
|
BuildRequires: libidn2-devel
|
|
|
|
%else
|
|
|
|
BuildRequires: libidn-devel
|
|
|
|
%endif
|
|
|
|
%if %{with maxminddb}
|
|
|
|
BuildRequires: pkgconfig(libmaxminddb)
|
|
|
|
%endif
|
|
|
|
%if %{with docs}
|
|
|
|
BuildRequires: makeinfo
|
|
|
|
BuildRequires: python3-Sphinx
|
|
|
|
%endif
|
|
|
|
%if %{with dnstap}
|
|
|
|
BuildRequires: libfstrm-devel
|
2021-03-25 20:35:12 +01:00
|
|
|
BuildRequires: libprotobuf-c-devel >= 1.0.0
|
|
|
|
BuildRequires: protobuf-c >= 1.0.0
|
2021-01-30 02:38:56 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%description
|
2021-04-20 10:16:03 +02:00
|
|
|
Knot DNS is a DNS server. It implements only the authoritative domain
|
|
|
|
name service. It uses a multi-threaded and mostly lock-free
|
|
|
|
implementation and can operate non-stop during zone addition or
|
|
|
|
removal.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
|
|
|
%package devel
|
|
|
|
#
|
|
|
|
Summary: Development files for the knot libraries
|
2021-09-17 22:20:10 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2021-12-20 21:03:43 +01:00
|
|
|
Requires: %{libdnssec} = %{version}
|
|
|
|
Requires: %{libknot} = %{version}
|
|
|
|
Requires: %{libzscanner} = %{version}
|
2021-09-17 22:20:10 +02:00
|
|
|
Requires: knot = %{version}
|
2021-03-25 20:35:12 +01:00
|
|
|
|
2021-01-30 02:38:56 +01:00
|
|
|
%description devel
|
2021-04-20 10:16:03 +02:00
|
|
|
Knot DNS is a DNS server. It implements only the authoritative domain
|
|
|
|
name service. It uses a multi-threaded and mostly lock-free
|
|
|
|
implementation and can operate non-stop during zone addition or
|
|
|
|
removal.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
2021-04-20 10:16:03 +02:00
|
|
|
This package contains headers for knot.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
|
|
|
%package -n %{libdnssec}
|
|
|
|
#
|
2021-04-20 10:16:03 +02:00
|
|
|
Summary: DNSSEC support functions for Knot DNS
|
2021-09-17 22:20:10 +02:00
|
|
|
Group: System/Libraries
|
2021-03-25 20:35:12 +01:00
|
|
|
|
2021-01-30 02:38:56 +01:00
|
|
|
%description -n %{libdnssec}
|
2021-04-20 10:16:03 +02:00
|
|
|
Knot DNS is a DNS server. It implements only the authoritative domain
|
|
|
|
name service. It uses a multi-threaded and mostly lock-free
|
|
|
|
implementation and can operate non-stop during zone addition or
|
|
|
|
removal.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
2021-04-20 10:16:03 +02:00
|
|
|
This package contains a library for DNSSEC support functions.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
|
|
|
%package -n %{libknot}
|
|
|
|
#
|
2021-04-20 10:16:03 +02:00
|
|
|
Summary: Knot DNS support library
|
2021-09-17 22:20:10 +02:00
|
|
|
Group: System/Libraries
|
2021-03-25 20:35:12 +01:00
|
|
|
|
2021-01-30 02:38:56 +01:00
|
|
|
%description -n %{libknot}
|
2021-04-20 10:16:03 +02:00
|
|
|
Knot DNS is a DNS server. It implements only the authoritative domain
|
|
|
|
name service. It uses a multi-threaded and mostly lock-free
|
|
|
|
implementation and can operate non-stop during zone addition or
|
|
|
|
removal.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
2021-04-20 10:16:03 +02:00
|
|
|
This package contains the essential core library for Knot services.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
|
|
|
%package -n %{libzscanner}
|
|
|
|
#
|
2021-04-20 10:16:03 +02:00
|
|
|
Summary: Zone record parsing functions for Knot DNS
|
2021-09-17 22:20:10 +02:00
|
|
|
Group: System/Libraries
|
2021-03-25 20:35:12 +01:00
|
|
|
|
2021-01-30 02:38:56 +01:00
|
|
|
%description -n %{libzscanner}
|
2021-04-20 10:16:03 +02:00
|
|
|
Knot DNS is a DNS server. It implements only the authoritative domain
|
|
|
|
name service. It uses a multi-threaded and mostly lock-free
|
|
|
|
implementation and can operate non-stop during zone addition or
|
|
|
|
removal.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
2021-04-20 10:16:03 +02:00
|
|
|
This package contains a library for a zone record scanner.
|
2021-01-30 02:38:56 +01:00
|
|
|
|
|
|
|
%prep
|
2021-02-08 17:33:49 +01:00
|
|
|
%autosetup -n %{pkg_name}-%{version}
|
2021-01-30 02:38:56 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
%configure \
|
|
|
|
--libexecdir=%{_libexecdir}/%{pkg_name} \
|
|
|
|
--includedir=%{_includedir}/knot/ \
|
|
|
|
--disable-static \
|
|
|
|
--enable-recvmmsg=yes \
|
|
|
|
%if %{with lto}
|
|
|
|
--enable-lto=yes \
|
|
|
|
%endif
|
|
|
|
%if %{with dnstap}
|
|
|
|
--enable-dnstap=yes \
|
|
|
|
--with-module-dnstap=shared \
|
|
|
|
%endif
|
|
|
|
--enable-rosedb \
|
|
|
|
--with-module-rosedb=shared \
|
|
|
|
%if %{with systemd}
|
|
|
|
--with-rundir=/run/knot/ \
|
|
|
|
--enable-systemd=yes \
|
|
|
|
%endif
|
|
|
|
--with-module-cookies=shared \
|
|
|
|
--with-module-dnsproxy=yes \
|
|
|
|
%if %{with maxminddb}
|
|
|
|
--with-module-geoip=shared \
|
|
|
|
%endif
|
|
|
|
--with-module-noudp=shared \
|
|
|
|
--with-module-onlinesign=yes \
|
|
|
|
--with-module-queryacl=shared \
|
|
|
|
--with-module-rrl=shared \
|
|
|
|
--with-module-stats=shared \
|
|
|
|
--with-module-synthrecord=shared \
|
|
|
|
--with-module-whoami=shared \
|
2021-09-17 22:20:10 +02:00
|
|
|
--with-bash-completions=%{_sysconfdir}/bash_completion.d \
|
2021-01-30 02:38:56 +01:00
|
|
|
--disable-silent-rules
|
2021-02-08 17:33:49 +01:00
|
|
|
%make_build STRIP="/bin/true"
|
2021-09-17 22:20:10 +02:00
|
|
|
%sysusers_generate_pre %{SOURCE4} knot system-user-knot.conf
|
2021-01-30 02:38:56 +01:00
|
|
|
|
|
|
|
%install
|
2021-04-20 10:16:03 +02:00
|
|
|
%make_install STRIP="/bin/true"
|
2021-01-30 02:38:56 +01:00
|
|
|
install -d %{buildroot}%{_docdir}/%{pkg_name}
|
|
|
|
install -d %{buildroot}%{_docdir}/%{pkg_name}/samples/
|
|
|
|
rm %{buildroot}%{_sysconfdir}/%{pkg_name}/*
|
|
|
|
install -p -m644 samples/knot.sample.conf %{buildroot}%{_sysconfdir}/%{pkg_name}/%{pkg_name}.conf
|
|
|
|
%if %{with systemd}
|
|
|
|
install -d %{buildroot}%{_unitdir} %{buildroot}%{_tmpfilesdir}
|
|
|
|
install -p -m644 %{SOURCE1} %{buildroot}%{_unitdir}/%{pkg_name}.service
|
|
|
|
install -p -m644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/knot.conf
|
|
|
|
ln -s service %{buildroot}%{_sbindir}/rcknot
|
|
|
|
%endif
|
|
|
|
install -p -m644 COPYING NEWS README.md %{buildroot}%{_docdir}/%{pkg_name}
|
|
|
|
install -p -m644 samples/*.conf samples/*.zone* %{buildroot}%{_docdir}/%{pkg_name}/samples/
|
|
|
|
find %{buildroot} -type f -name "*.la" -delete -print
|
2021-09-17 22:20:10 +02:00
|
|
|
install -d -m 0750 %{buildroot}%{_localstatedir}/lib/knot/
|
|
|
|
mkdir -p %{buildroot}%{_sysusersdir}
|
|
|
|
install -m 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/
|
2021-01-30 02:38:56 +01:00
|
|
|
|
2021-09-17 22:20:10 +02:00
|
|
|
%pre -f knot.pre
|
2021-01-30 02:38:56 +01:00
|
|
|
%if %{with systemd}
|
|
|
|
%service_add_pre %{pkg_name}.service
|
2021-09-17 22:20:10 +02:00
|
|
|
|
2021-01-30 02:38:56 +01:00
|
|
|
%preun
|
|
|
|
%service_del_preun %{pkg_name}.service
|
|
|
|
|
|
|
|
%post
|
|
|
|
systemd-tmpfiles --create %{_tmpfilesdir}/knot.conf || :
|
|
|
|
%service_add_post %{pkg_name}.service
|
|
|
|
# Incompatibility warning
|
|
|
|
if grep -q '{' %{_sysconfdir}/%{pkg_name}/%{pkg_name}.conf; then
|
|
|
|
cat > %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release} << EOF
|
|
|
|
WARNING: You are upgrading from incompatible version of Knot DNS
|
|
|
|
|
|
|
|
Your configuration file looks like you are upgrading from ancient version of Knot DNS.
|
|
|
|
Knot 1.6.x was deprecated quite some time ago:
|
|
|
|
|
|
|
|
https://lists.nic.cz/pipermail/knot-dns-users/2017-April/001099.html
|
|
|
|
|
|
|
|
Unfortunately, it used completely different format of configuration file and
|
|
|
|
you have to migrate your configuration manually.
|
|
|
|
|
|
|
|
Please, see examples in %{_docdir}/%{pkg_name}/samples/ directory.
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun %{pkg_name}.service
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%post -n %{libdnssec} -p /sbin/ldconfig
|
|
|
|
%post -n %{libknot} -p /sbin/ldconfig
|
|
|
|
%post -n %{libzscanner} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libdnssec} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libknot} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libzscanner} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files
|
2021-05-11 11:28:26 +02:00
|
|
|
%dir %attr(750,knot,knot) %{_sysconfdir}/%{pkg_name}
|
2021-12-20 21:03:43 +01:00
|
|
|
%config(noreplace) %attr(640,knot,knot) %{_sysconfdir}/%{pkg_name}/%{pkg_name}.conf
|
2021-01-30 02:38:56 +01:00
|
|
|
%{_sbindir}/*
|
|
|
|
%{_bindir}/*
|
|
|
|
%{_mandir}/man?/*
|
|
|
|
%doc %{_docdir}/%{pkg_name}
|
|
|
|
%if %{with systemd}
|
|
|
|
%{_unitdir}/%{pkg_name}.service
|
|
|
|
%{_tmpfilesdir}/knot.conf
|
2021-09-17 22:20:10 +02:00
|
|
|
%{_sysusersdir}/system-user-knot.conf
|
2021-01-30 02:38:56 +01:00
|
|
|
%endif
|
|
|
|
%{_libdir}/knot/
|
2021-09-17 22:20:10 +02:00
|
|
|
%dir %attr(-,knot,knot) %{_localstatedir}/lib/knot/
|
2021-01-30 02:38:56 +01:00
|
|
|
%ghost %dir %(751,knot,knot) /run/knot
|
|
|
|
|
|
|
|
%files -n %{libdnssec}
|
|
|
|
%{_libdir}/libdnssec.so.*
|
|
|
|
|
|
|
|
%files -n %{libknot}
|
|
|
|
%{_libdir}/libknot.so.*
|
|
|
|
|
|
|
|
%files -n %{libzscanner}
|
|
|
|
%{_libdir}/libzscanner.so.*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%{_includedir}/knot/
|
|
|
|
%{_libdir}/libdnssec.so
|
|
|
|
%{_libdir}/libknot.so
|
|
|
|
%{_libdir}/libzscanner.so
|
|
|
|
%{_libdir}/pkgconfig/knotd.pc
|
|
|
|
%{_libdir}/pkgconfig/libdnssec.pc
|
|
|
|
%{_libdir}/pkgconfig/libknot.pc
|
|
|
|
%{_libdir}/pkgconfig/libzscanner.pc
|
|
|
|
|
|
|
|
%changelog
|