402c578
%global _hardened_build 1
7bcbcaf
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
402c578
efcdac2
Summary: High-performance authoritative DNS server
4539ee4
Name: knot
98f4bc1
Version: 2.3.3
e27a82d
Release: 1%{?dist}
7c235c0
License: GPLv3
4539ee4
Group: System Environment/Daemons
4539ee4
URL: http://www.knot-dns.cz
fdacee6
Source0: http://public.nic.cz/files/knot-dns/%{name}-%{version}.tar.xz
4539ee4
Source1: %{name}.service
4539ee4
Source2: %{name}.conf
5636726
Source3: %{name}.tmpfiles
4539ee4
98560d4
# Required dependencies
3bbb27f
BuildRequires: pkgconfig(liburcu) pkgconfig(gnutls) >= 3.0 pkgconfig(nettle) pkgconfig(jansson) lmdb-devel pkgconfig(libedit)
98560d4
# Optional dependencies
79ae42d
BuildRequires: pkgconfig(libcap-ng) pkgconfig(libidn) pkgconfig(libsystemd) pkgconfig(libfstrm) pkgconfig(libprotobuf-c)
4539ee4
98560d4
BuildRequires: systemd
9d3c314
Requires(post): systemd %{_sbindir}/runuser
8dd156b
Requires(preun): systemd
08134e6
Requires(postun): systemd
4539ee4
efcdac2
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
efcdac2
4539ee4
%description
5636726
Knot DNS is a high-performance authoritative DNS server implementation.
4539ee4
efcdac2
%package libs
efcdac2
Summary: Libraries used by the Knot DNS server and client applications
efcdac2
efcdac2
%description libs
efcdac2
The package contains shared libraries used by the Knot DNS server and
efcdac2
utilities.
efcdac2
efcdac2
%package devel
efcdac2
Summary: Development header files for the Knot DNS libraries
efcdac2
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
efcdac2
efcdac2
%description devel
efcdac2
The package contains development header files for the Knot DNS libraries
efcdac2
included in knot-libs package.
efcdac2
efcdac2
%package utils
efcdac2
Summary: DNS client utilities shipped with the Knot DNS server
efcdac2
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
efcdac2
efcdac2
%description utils
efcdac2
The package contains DNS client utilities shipped with the Knot DNS server.
efcdac2
0d2dc08
%package doc
0d2dc08
Summary: Documentation for the Knot DNS server
41c4143
License: GPLv3 and BSD and MIT
0d2dc08
BuildArch: noarch
0d2dc08
BuildRequires: python3-sphinx
0d2dc08
Provides: bundled(jquery)
0d2dc08
0d2dc08
%description doc
0d2dc08
The package contains documentation for the Knot DNS server.
0d2dc08
4539ee4
%prep
305a0b2
%setup -q
4539ee4
52c59a3
# make sure embedded LMDB library is not used
890e0a4
rm -vr src/contrib/lmdb
52c59a3
4539ee4
%build
5636726
# disable debug code (causes unused warnings)
5636726
CFLAGS="%{optflags} -DNDEBUG -Wno-unused"
996ed11
%configure
4539ee4
make %{?_smp_mflags}
0d2dc08
make html
4539ee4
4539ee4
%install
4539ee4
make install DESTDIR=%{buildroot}
5636726
0d2dc08
# install documentation
0d2dc08
mkdir -p %{buildroot}%{_pkgdocdir}
0d2dc08
cp -av doc/_build/html %{buildroot}%{_pkgdocdir}
457b287
[ -r %{buildroot}%{_pkgdocdir}/html/index.html ] || exit 1
457b287
rm -f %{buildroot}%{_pkgdocdir}/html/.buildinfo
0d2dc08
a7b5887
# install shell completion scripts
a7b5887
install -p -m 0644 -D samples/keymgr-completion.sh %{buildroot}%{_datadir}/bash-completion/completions/keymgr
a7b5887
install -p -m 0644 -D samples/keymgr-completion.zsh %{buildroot}%{_datadir}/zsh/site-functions/_keymgr
a7b5887
5636726
# install customized configuration file
5636726
rm %{buildroot}%{_sysconfdir}/%{name}/*
5636726
install -p -m 0644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
5636726
5636726
# install service file and create rundir
5636726
install -p -m 0644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
5636726
install -p -m 0644 -D %{SOURCE3} %{buildroot}%{_tmpfilesdir}/%{name}.conf
5636726
install -d -m 0755 %{buildroot}%{_localstatedir}/run/%{name}
5636726
996ed11
# create storage dir and key dir
996ed11
mkdir -p %{buildroot}%{_sharedstatedir}
996ed11
install -d -m 0775 %{buildroot}%{_sharedstatedir}/%{name}
4bea6d5
install -d -m 0770 %{buildroot}%{_sharedstatedir}/%{name}/keys
996ed11
5636726
# install config samples into docdir
7bcbcaf
install -d -m 0755 %{buildroot}%{_pkgdocdir}/samples
5265fd2
for sample_file in knot.sample.conf example.com.zone; do
afb8872
    install -p -m 0644 samples/${sample_file} %{buildroot}%{_pkgdocdir}/samples
5636726
done
5636726
efcdac2
# remove static libraries and libarchive files
efcdac2
rm %{buildroot}%{_libdir}/*.a
8dd156b
rm %{buildroot}%{_libdir}/*.la
8dd156b
5636726
%check
5636726
make check
4539ee4
4539ee4
%pre
4539ee4
getent group knot >/dev/null || groupadd -r knot
11641d8
getent passwd knot >/dev/null || useradd -r -g knot -d %{_sysconfdir}/knot -s /sbin/nologin -c "Knot DNS server" knot
4539ee4
exit 0
4539ee4
4539ee4
%post
08134e6
%systemd_post knot.service
9d3c314
# initialize/upgrade KASP database
4dfe897
%{_sbindir}/runuser -u knot -- %{_sbindir}/keymgr --dir %{_sharedstatedir}/%{name}/keys --legacy init
4539ee4
4539ee4
%preun
08134e6
%systemd_preun knot.service
4539ee4
4539ee4
%postun
efcdac2
%systemd_postun_with_restart knot.service
efcdac2
efcdac2
%post libs -p /sbin/ldconfig
efcdac2
efcdac2
%postun libs -p /sbin/ldconfig
4539ee4
4539ee4
%files
efcdac2
%{_pkgdocdir}/samples
5636726
%dir %attr(750,root,knot) %{_sysconfdir}/%{name}
5636726
%config(noreplace) %attr(640,root,knot) %{_sysconfdir}/%{name}/%{name}.conf
996ed11
%dir %attr(775,root,knot) %{_sharedstatedir}/%{name}
4bea6d5
%dir %attr(770,root,knot) %{_sharedstatedir}/%{name}/keys
5636726
%dir %attr(-,knot,knot) %{_localstatedir}/run/%{name}
4539ee4
%{_unitdir}/%{name}.service
5636726
%{_tmpfilesdir}/%{name}.conf
87d8a4b
%{_libexecdir}/knot1to2
98f4bc1
%{_bindir}/kjournalprint
40ddfef
%{_bindir}/kzonecheck
87d8a4b
%{_sbindir}/keymgr
efcdac2
%{_sbindir}/knotc
efcdac2
%{_sbindir}/knotd
87d8a4b
%{_mandir}/man1/knot1to2.*
98f4bc1
%{_mandir}/man1/kjournalprint.*
61186c4
%{_mandir}/man1/kzonecheck.*
efcdac2
%{_mandir}/man5/knot.conf.*
efcdac2
%{_mandir}/man8/keymgr.*
efcdac2
%{_mandir}/man8/knotc.*
efcdac2
%{_mandir}/man8/knotd.*
87d8a4b
%{_datadir}/bash-completion/completions/keymgr
a7b5887
%{_datadir}/zsh/site-functions/_keymgr
efcdac2
efcdac2
%files utils
efcdac2
%{_bindir}/kdig
efcdac2
%{_bindir}/khost
efcdac2
%{_bindir}/knsec3hash
efcdac2
%{_bindir}/knsupdate
efcdac2
%{_mandir}/man1/kdig.*
efcdac2
%{_mandir}/man1/khost.*
efcdac2
%{_mandir}/man1/knsec3hash.*
efcdac2
%{_mandir}/man1/knsupdate.*
efcdac2
efcdac2
%files libs
efcdac2
%doc COPYING AUTHORS NEWS THANKS
87d8a4b
%{_libdir}/libdnssec.so.*
87d8a4b
%{_libdir}/libknot.so.*
87d8a4b
%{_libdir}/libzscanner.so.*
efcdac2
efcdac2
%files devel
efcdac2
%{_includedir}/dnssec
efcdac2
%{_includedir}/libknot
a7b5887
%{_includedir}/zscanner
87d8a4b
%{_libdir}/libdnssec.so
efcdac2
%{_libdir}/libknot.so
efcdac2
%{_libdir}/libzscanner.so
efcdac2
%{_libdir}/pkgconfig/libdnssec.pc
87d8a4b
%{_libdir}/pkgconfig/libknot.pc
87d8a4b
%{_libdir}/pkgconfig/libzscanner.pc
4539ee4
0d2dc08
%files doc
0d2dc08
%dir %{_pkgdocdir}
0d2dc08
%{_pkgdocdir}/html
0d2dc08
4539ee4
%changelog
98f4bc1
* Fri Dec 09 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.3.3-1
98f4bc1
- new upstream release:
98f4bc1
  + fix: double free when failed to apply zone journal
98f4bc1
  + fix: zone bootstrap retry interval not preserved upon zone reload
98f4bc1
  + fix: DNSSEC related records not flushed if not signed
98f4bc1
  + fix: false semantic checks warning about incorrect type in NSEC bitmap
98f4bc1
  + fix: memory leak in kzonecheck
98f4bc1
  + improvement: all zone names are fully-qualified in log
98f4bc1
  + features: new kjournalprint utility
98f4bc1
ebd4b0f
* Thu Nov 17 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.3.2-1
e27a82d
- new upstream release:
e27a82d
  + fix: missing glue in some responses
e27a82d
  + fix: knsupdate prompt printing on non-terminal
e27a82d
  + fix: configuration policy item names in documentation
e27a82d
  + fix: segfault on OS X Sierra
e27a82d
  + fix: incorrect %s expansion for the root zone
e27a82d
  + fix: refresh not existing slave zone after restart
e27a82d
  + fix: immediate zone refresh upon restart if refresh already scheduled
e27a82d
  + fix: early zone transfer after restart if transfer already scheduled
e27a82d
  + fix: not ignoring empty non-terminal parents during delegation lookup
e27a82d
  + fix: CD bit clearing in responses
e27a82d
  + fix: compilation error on GNU/kFreeBSD
e27a82d
  + fix: server crash after double zone-commit if journal error
e27a82d
  + improvement: significant speed-up of conf-commit and conf-diff operations
e27a82d
  + improvement: new EDNS Client Subnet API
e27a82d
  + improvement: better semantic-checks error messages
e27a82d
  + improvement: speed-up of knotc if control operation and known socket
e27a82d
  + improvement: zone purge operation purges also zone timers
e27a82d
  + feature: print TLS certificate hierarchy in kdig verbose mode
e27a82d
  + feature: new +subnet alias for +client
e27a82d
  + feature: new mod-whoami and mod-noudp modules
e27a82d
  + feature: new zone-purge control command
e27a82d
  + feature: new log-queries and log-responses options for mod-dnstap
e27a82d
  + feature: simple modules don't require empty configuration section
e27a82d
  + feature: new zone journal path configuration option
e27a82d
  + feature: new timeout configuration option for module dnsproxy
e27a82d
4dfe897
* Mon Aug 29 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.3.0-3
4dfe897
- fix post-installation scriptlet (RHBZ #1370939)
4dfe897
5a64f28
* Thu Aug 11 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.3.0-2
5a64f28
- endian independent DNS cookies (fixes build on ppc64 and s390x)
5a64f28
6efbf85
* Tue Aug 09 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.3.0-1
6efbf85
- new upstream release:
6efbf85
  + fix: No wildcard expansion below empty non-terminal for NSEC signed zone
6efbf85
  + fix: Don't ignore non-existing records to be removed in IXFR
6efbf85
  + fix: Fix kdig IXFR response processing if the transfer content is empty
6efbf85
  + fix: Avoid multiple loads of the same PKCS #11 module
6efbf85
  + improvement: Refactored semantic checks and better error messages
6efbf85
  + improvement: Set TC flag in delegation only if mandatory glue doesn't fit the response
6efbf85
  + improvement: Separate EDNS(0) payload size configuration for IPv4 and IPv6
6efbf85
  + feature: Zone size limit restriction for DDNS, AXFR, and IXFR (CVE-2016-6171)
6efbf85
  + feature: DNS-over-TLS support in kdig (RFC 7858)
6efbf85
  + feature: EDNS(0) padding and alignment support in kdig (RFC 7830)
6efbf85
5086932
* Fri Jun 24 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.2.1-2
5086932
- rebuild for updated userspace-rcu
5086932
79ae42d
* Mon May 30 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.2.1-1
79ae42d
- new upstream release:
79ae42d
  + fix: Separate logging of server and zone events
79ae42d
  + fix: Concurrent zone file flushing with many zones
79ae42d
  + fix: Control timeout parsing in knotc
79ae42d
  + fix: "Environment maxreaders limit reached" error in knotc
79ae42d
  + fix: Don't apply journal changes on modified zone file
79ae42d
  + fix: Enable multiple zone names completion in interactive knotc
79ae42d
  + fix: Set the TC flag in a response if a glue doesn't fit the response
79ae42d
  + fix: Disallow server reload when there is an active configuration transaction
79ae42d
  + improvement: Distinguish unavailable zones from zones with zero serial in log messages
79ae42d
  + improvement: Log warning and error messages to standard error output in all utilities
79ae42d
  + improvement: Document tested PKCS #11 devices
79ae42d
  + improvement: Extended Python configuration interface
79ae42d
- update requirements for Fedora 25
79ae42d
65c2a71
* Sun May 29 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.2.0-3
65c2a71
- update default configuration file
65c2a71
a4a976e
* Sun May 08 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.2.0-2
a4a976e
- fix: systemd service starting
a4a976e
3bbb27f
* Tue Apr 26 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 2.2.0-1
3bbb27f
- new upstream release:
3bbb27f
  + fix: Query/response message type setting in dnstap module
3bbb27f
  + fix: Remote address retrieval from dnstap capture in kdig
3bbb27f
  + fix: Global modules execution for queries hitting existing zones
3bbb27f
  + fix: Execution of semantic checks after an IXFR transfer
3bbb27f
  + fix: kdig failure when the first AXFR message contains just the SOA record
3bbb27f
  + fix: Exclude non-authoritative types from NSEC/NSEC3 bitmap at a delegation
3bbb27f
  + fix: Mark PKCS#11 generated keys as sensitive
3bbb27f
  + fix: Error when removing the only zone from the server
3bbb27f
  + fix: Don't abort knotc transaction when some check fails
3bbb27f
  + feature: URI and CAA resource record types support
3bbb27f
  + feature: RRL client address based white list
3bbb27f
  + feature: knotc interactive mode
3bbb27f
  + improvement: Consistent IXFR error messages
3bbb27f
  + improvement: Various fixes for better compatibility with PKCS#11 devices
3bbb27f
  + improvement: Various keymgr user interface improvements
3bbb27f
  + improvement: Better zone event scheduler performance with many zones
3bbb27f
  + improvement: New server control interface
3bbb27f
  + improvement: kdig uses local resolver if resolv.conf is empty
3bbb27f
32aea1e
* Wed Feb 10 2016 Jan Vcelak <jvcelak@fedoraproject.org> 2.1.1-1
32aea1e
- new upstream release:
32aea1e
  + fix: Allow import of duplicate private key into the KASP
32aea1e
  + fix: Avoid duplicate NSEC for Wildcard No Data answer
32aea1e
  + fix: Server crash when an incomming transfer is in progress and reload is issued
32aea1e
  + fix: Socket polling when configured with many interfaces and threads
32aea1e
  + improvement: Use correct source address for UDP messages recieved on ANY address
32aea1e
  + improvement: Extend documentation of knotc commands
32aea1e
29572be
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-2
29572be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
29572be
fdacee6
* Thu Jan 14 2016 Jan Vcelak <jvcelak@fedoraproject.org> 2.1.0-1
fdacee6
- new upstream release:
fdacee6
  + improvement: Remove implementation limit for the number of network interfaces
fdacee6
  + improvement: Remove possibly insecure server control over a network socket
fdacee6
  + fix: Schedule zone bootstrap after slave zone fails to load from disk
fdacee6
890e0a4
* Sun Dec 20 2015 Jan Vcelak <jvcelak@fedoraproject.org> 2.1.0-0.1.rc1
890e0a4
- new upstream pre-release:
890e0a4
  + feature: Per-thread UDP socket binding using SO_REUSEPORT
890e0a4
  + feature: Support for dynamic configuration database
890e0a4
  + feature: DNSSEC, Support for cryptographic tokens via PKCS #11 interface
890e0a4
  + feature: DNSSEC, Experimental support for online signing
890e0a4
  + improvement: Support for zone file name patterns
890e0a4
  + improvement: Configurable location of zone timer database
890e0a4
  + improvement: Non-blocking network operations and better timeout handling
890e0a4
  + improvement: Caching of Critical configuration values for better performance
890e0a4
  + improvement: Logging of ACL failures
890e0a4
  + improvement: RRL: Add rate-limit-slip zero support to drop all responses
890e0a4
  + improvement: RRL: Document behavior for different rate-limit-slip options
890e0a4
  + improvement: kdig: Warning instead of error on TSIG validation failure
890e0a4
  + improvement: Cleanup of support libraries interfaces (libknot, libzscanner, libdnssec)
890e0a4
  + fix: synth-record module: Fix application of default configuration options
890e0a4
  + fix: TSIG: Allow compressed TSIG name when forwarding DDNS updates
890e0a4
740a2c2
* Wed Nov 25 2015 Jan Vcelak <jvcelak@fedoraproject.org> 2.0.2-1
740a2c2
- new upstream release:
740a2c2
  + security fix: out-of-bound read in packet parser for malformed NAPTR record
740a2c2
a7b5887
* Thu Sep 03 2015 Jan Vcelak <jvcelak@fedoraproject.org> 2.0.1-1
a7b5887
- new upstream release:
a7b5887
  + fix: do not reload expired zones on 'knotc reload' and server startup
a7b5887
  + fix: rare race-condition in event scheduling causing delayed event execution
a7b5887
  + fix: skipping of non-authoritative nodes in NSEC proofs
a7b5887
  + fix: TC flag setting in RRL slipped answers
a7b5887
  + fix: disable domain name compression for root label
a7b5887
  + fix: fix CNAME following when quering for NSEC RR type
a7b5887
  + fix: fix refreshing of DNSSEC signatures for zone keys
a7b5887
  + fix: fix binding an unavailable IPv6 address (IP_FREEBIND)
a7b5887
  + fix: fix infinite loop in knotc zonestatus and memstats
a7b5887
  + fix: fix memory leak in configuration on server shutdown
a7b5887
  + fix: fix broken dnsproxy module
a7b5887
  + fix: fix multi value parsing on big-endian
a7b5887
  + fix: adapt to Nettle 3 API break causing base64 decoding failures on big-endian
a7b5887
  + feature: add 'keymgr zone key ds' to show key's DS record
a7b5887
  + feature: add 'keymgr tsig generate' to generate TSIG keys
a7b5887
  + feature: add query module scoping to process either all queries or zone queries only
a7b5887
  + feature: add support for file name globbing in config file includes
a7b5887
  + feature: add 'request-edns-option' config option to add custom EDNS0 option into server initiated queries
a7b5887
  + improvement: send minimal responses (remove NS from Authority section for NOERROR)
a7b5887
  + improvement: update persistent timers only on shutdown for better performance
a7b5887
  + improvement: allow change of RR TTL over DDNS
a7b5887
  + improvement: documentation fixes, updates, and improvements in formatting
a7b5887
  + improvement: install yparser and zscanner header files
a7b5887
fad3775
* Mon Jul 20 2015 Jan Vcelak <jvcelak@fedoraproject.org> 2.0.0-1
fad3775
- new upstream release:
fad3775
  + feature: possibility to disable zone file synchronization
fad3775
  + feature: knsupdate, add input prompt in interactive mode
fad3775
  + feature: knsupdate, TSIG algorithm specification in interactive mode
fad3775
87d8a4b
* Thu Jun 18 2015 Jan Vcelak <jvcelak@fedoraproject.org> 2.0.0-0.1.rc1
87d8a4b
- new upstream pre-release:
87d8a4b
  + fix: lost NOTIFY message if received during zone transfer
87d8a4b
  + fix: kdig, record correct dnstap SocketProtocol when retrying over TCP
87d8a4b
  + fix: kdig, hide TSIG section with +noall
87d8a4b
  + fix: do not set AA flag for AXFR/IXFR queries
87d8a4b
  + feature: new configuration format in YAML, binary store im LMDB
87d8a4b
  + feature: DNSSEC, separate library, switch to GnuTLS, new utilities
87d8a4b
  + feature: DNSSEC, basic KASP support (generate initial keys, ZSK rollover)
87d8a4b
  + feature: zone parser, split long TXT/SPF strings into multiple strings
87d8a4b
  + feature: kdig, add generic dump style option (+generic)
87d8a4b
  + feature: try all master servers on failure in multi-master environment
87d8a4b
  + feature: improved remotes and ACLs (multiple addresses, multiple keys)
87d8a4b
  + feature: basic support for zone file patterns (%s to substitute zone name)
87d8a4b
  + improvement: do not write class for SOA record (unified with other RR types)
87d8a4b
  + improvement: do not write master server address into the zone file
87d8a4b
  + documentation: manual pages also in HTML and PDF format
87d8a4b
62c3287
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.99.1-4
62c3287
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
62c3287
1f7394d
* Mon May 04 2015 Kalev Lember <kalevlember@gmail.com> - 1.99.1-3
1f7394d
- Rebuilt for nettle soname bump
1f7394d
9964400
* Fri Feb 13 2015 Jan Vcelak <jvcelak@fedoraproject.org> 1.99.1-2
9964400
- fix BuildRequires for systemd integration
9964400
aa9d5fe
* Fri Feb 13 2015 Jan Vcelak <jvcelak@fedoraproject.org> 1.99.1-1
aa9d5fe
- new upstream pre-release version:
aa9d5fe
  + DNSSEC: switch from OpenSSL to GnuTLS
aa9d5fe
  + DNSSEC: initial support for KASP
aa9d5fe
- split package into subpackages
aa9d5fe
- add documentation building
aa9d5fe
- restart daemon on updated