2016-07-11 17:35:17 +02:00
|
|
|
#
|
|
|
|
# spec file for package dnsdist
|
|
|
|
#
|
2019-11-21 10:22:10 +01:00
|
|
|
# Copyright (c) 2019 SUSE LLC
|
2016-07-11 17:35:17 +02: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.
|
|
|
|
|
2019-11-21 10:22:10 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-07-11 17:35:17 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
%bcond_without apparmor
|
|
|
|
%else
|
|
|
|
%bcond_with apparmor
|
|
|
|
%endif
|
|
|
|
#
|
|
|
|
# this should only be needed if we have to patch the ragel files
|
|
|
|
# in which case it might be faster to just run it locally and put the regenerated file into the tarball
|
|
|
|
%bcond_with dnsdist_ragel
|
|
|
|
|
2020-04-05 22:51:19 +02:00
|
|
|
%if 0%{?suse_version} >= 1550
|
|
|
|
%bcond_without dnsdist_lmdb
|
|
|
|
%else
|
|
|
|
%bcond_with dnsdist_lmdb
|
|
|
|
%endif
|
2016-07-11 17:35:17 +02:00
|
|
|
|
2020-04-06 00:06:21 +02:00
|
|
|
%if 0%{?suse_version} >= 1510
|
|
|
|
%bcond_without dnsdist_luajit
|
|
|
|
%else
|
|
|
|
%bcond_with dnsdist_luajit
|
|
|
|
%endif
|
|
|
|
|
2016-07-11 17:35:17 +02:00
|
|
|
%if 0%{?suse_version} && ! ( 0%{?suse_version} == 1315 && ! 0%{?is_opensuse} )
|
|
|
|
%bcond_without dnsdist_protobuf
|
|
|
|
%else
|
|
|
|
%bcond_with dnsdist_protobuf
|
|
|
|
%endif
|
|
|
|
|
2019-10-04 18:12:48 +02:00
|
|
|
# requires libh2o
|
2020-04-06 00:37:57 +02:00
|
|
|
%if 0%{?is_opensuse} && 0%{?suse_version} >= 1500
|
2020-04-05 23:29:31 +02:00
|
|
|
%bcond_without dnsdist_doh
|
|
|
|
%else
|
2019-10-04 18:12:48 +02:00
|
|
|
%bcond_with dnsdist_doh
|
2020-04-05 23:29:31 +02:00
|
|
|
%endif
|
2019-10-04 18:12:48 +02:00
|
|
|
|
2016-07-11 17:35:17 +02:00
|
|
|
Name: dnsdist
|
2022-01-17 17:27:22 +01:00
|
|
|
Version: 1.7.0
|
2016-07-11 17:35:17 +02:00
|
|
|
Release: 0
|
|
|
|
License: GPL-2.0
|
|
|
|
Summary: A highly DNS-, DoS- and abuse-aware loadbalancer
|
|
|
|
Url: http://www.powerdns.com/
|
|
|
|
Group: Productivity/Networking/DNS/Servers
|
2020-07-30 14:55:49 +02:00
|
|
|
Source0: https://downloads.powerdns.com/releases/dnsdist-%{version}.tar.bz2
|
|
|
|
Source1: https://downloads.powerdns.com/releases/dnsdist-%{version}.tar.bz2.sig
|
2019-08-14 10:32:24 +02:00
|
|
|
Source2: https://dnsdist.org/_static/dnsdist-keyblock.asc#/dnsdist.keyring
|
|
|
|
Source11: dnsdist.lua
|
|
|
|
Source12: usr.sbin.dnsdist
|
|
|
|
Source13: local.usr.sbin.dnsdist
|
2016-07-11 17:35:17 +02:00
|
|
|
%if %{with apparmor}
|
|
|
|
BuildRequires: apparmor-profiles
|
|
|
|
%endif
|
|
|
|
BuildRequires: boost-devel >= 1.35.0
|
|
|
|
BuildRequires: gcc-c++ >= 4.8
|
2018-04-02 01:58:01 +02:00
|
|
|
BuildRequires: libfstrm-devel
|
|
|
|
BuildRequires: gnutls-devel
|
2019-11-01 07:41:27 +01:00
|
|
|
BuildRequires: pkgconfig(libcap)
|
2022-01-17 17:27:22 +01:00
|
|
|
BuildRequires: pkgconfig(libnghttp2)
|
2019-11-01 07:41:27 +01:00
|
|
|
%if %{with dnsdist_doh}
|
|
|
|
BuildRequires: pkgconfig(libh2o-evloop)
|
|
|
|
%endif
|
|
|
|
%if %{with dnsdist_lmdb}
|
|
|
|
BuildRequires: lmdb-devel
|
|
|
|
%endif
|
2016-07-11 17:35:17 +02:00
|
|
|
BuildRequires: libsodium-devel
|
|
|
|
%if %{with dnsdist_protobuf}
|
|
|
|
BuildRequires: protobuf-devel
|
|
|
|
%endif
|
|
|
|
%if %{with dnsdist_luajit}
|
|
|
|
BuildRequires: luajit-devel
|
|
|
|
%else
|
|
|
|
BuildRequires: lua-devel
|
|
|
|
%endif
|
2017-08-21 18:30:36 +02:00
|
|
|
BuildRequires: net-snmp-devel
|
2016-07-11 17:35:17 +02:00
|
|
|
BuildRequires: pkgconfig
|
|
|
|
%if %{with dnsdist_ragel}
|
|
|
|
BuildRequires: ragel
|
|
|
|
%endif
|
2017-02-19 19:41:16 +01:00
|
|
|
BuildRequires: re2-devel
|
2016-07-11 17:35:17 +02:00
|
|
|
BuildRequires: libedit-devel
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
Requires(post): %fillup_prereq
|
|
|
|
%endif
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
2017-02-19 19:41:16 +01:00
|
|
|
BuildRequires: pkgconfig(libsystemd)
|
2022-01-17 17:27:22 +01:00
|
|
|
%{?systemd_ordering}
|
2018-04-02 02:06:52 +02:00
|
|
|
Requires(pre): shadow
|
2016-07-11 17:35:17 +02:00
|
|
|
%define home %{_var}/lib/%{name}
|
|
|
|
|
2022-01-17 17:27:22 +01:00
|
|
|
# dnsdist doesn't to run on archs with time_t size 4
|
|
|
|
ExcludeArch: %arm %ix86 ppc s390
|
|
|
|
|
2016-07-11 17:35:17 +02:00
|
|
|
%description
|
|
|
|
dnsdist is a highly DNS-, DoS- and abuse-aware loadbalancer. Its goal in life
|
|
|
|
is to route traffic to the best server, delivering top performance to
|
|
|
|
legitimate users while shunting or blocking abusive traffic.
|
|
|
|
|
|
|
|
dnsdist is dynamic, in the sense that its configuration can be changed at
|
|
|
|
runtime, and that its statistics can be queried from a console-like interface.
|
|
|
|
|
|
|
|
%prep
|
2019-11-21 10:22:10 +01:00
|
|
|
%autosetup -p1
|
2016-07-11 17:35:17 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
%configure \
|
2019-11-01 07:41:27 +01:00
|
|
|
--enable-dnstap \
|
2018-04-02 01:58:01 +02:00
|
|
|
--enable-dns-over-tls \
|
2019-11-01 07:41:27 +01:00
|
|
|
%if %{with dnsdist_doh}
|
2019-10-04 18:00:34 +02:00
|
|
|
--enable-dns-over-https \
|
2019-11-01 07:41:27 +01:00
|
|
|
%endif
|
2019-10-04 18:00:34 +02:00
|
|
|
--enable-dnscrypt \
|
2020-04-05 22:51:19 +02:00
|
|
|
--with-re2 \
|
2019-11-01 07:41:27 +01:00
|
|
|
--with-ebpf \
|
2020-04-05 23:32:15 +02:00
|
|
|
--with-net-snmp \
|
2019-11-01 07:41:27 +01:00
|
|
|
--with-libcap \
|
|
|
|
%if %{with dnsdist_luajit}
|
|
|
|
--with-lua=luajit \
|
|
|
|
%endif
|
|
|
|
%if %{with dnsdist_lmdb}
|
|
|
|
--with-lmdb \
|
|
|
|
%endif
|
2019-10-04 18:00:34 +02:00
|
|
|
--disable-silent-rules \
|
|
|
|
--bindir=%{_sbindir} \
|
|
|
|
--sysconfdir=%{_sysconfdir}/%{name}/
|
|
|
|
|
2016-07-11 17:35:17 +02:00
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
%install
|
|
|
|
make install DESTDIR=%{buildroot} %{?_smp_mflags}
|
|
|
|
#
|
2022-01-17 17:27:22 +01:00
|
|
|
%if 0%{?suse_version}
|
2016-07-11 17:35:17 +02:00
|
|
|
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
|
|
|
%endif
|
|
|
|
%if %{with apparmor}
|
2019-08-14 10:32:24 +02:00
|
|
|
install -D -m 0644 %{S:12} %{buildroot}%{_sysconfdir}/apparmor.d/usr.sbin.dnsdist
|
|
|
|
install -D -m 0644 %{S:13} %{buildroot}%{_sysconfdir}/apparmor.d/local/usr.sbin.dnsdist
|
2016-07-11 17:35:17 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
install -Dd -m 0750 %{buildroot}%{_sysconfdir}/%{name}/ %{buildroot}%{home}/
|
2019-08-14 10:32:24 +02:00
|
|
|
install -m 0640 %{S:11} %{buildroot}%{_sysconfdir}/%{name}/dnsdist.conf
|
2016-07-11 17:35:17 +02:00
|
|
|
|
|
|
|
%pre
|
2018-02-16 13:34:26 +01:00
|
|
|
getent group %{name} >/dev/null || /usr/sbin/groupadd -r %{name}
|
|
|
|
getent passwd %{name} >/dev/null || \
|
|
|
|
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "%{name}" -d %{home} %{name}
|
2016-07-11 17:35:17 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
%service_add_pre %{name}.service
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%if 0%{?suse_version}
|
2020-04-05 23:32:15 +02:00
|
|
|
%service_del_preun %{name}.service %{name}@.service
|
2016-07-11 17:35:17 +02:00
|
|
|
%else
|
2020-04-05 23:32:15 +02:00
|
|
|
%systemd_preun %{name}.service %{name}@.service
|
2016-07-11 17:35:17 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%post
|
|
|
|
%if 0%{?suse_version}
|
2020-04-05 23:32:15 +02:00
|
|
|
%service_add_post %{name}.service %{name}@.service
|
2016-07-11 17:35:17 +02:00
|
|
|
%else
|
2020-04-05 23:32:15 +02:00
|
|
|
%systemd_post %{name}.service %{name}@.service
|
2016-07-11 17:35:17 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%if 0%{?suse_version}
|
2020-04-05 23:32:15 +02:00
|
|
|
%service_del_postun %{name}.service %{name}@.service
|
2016-07-11 17:35:17 +02:00
|
|
|
%else
|
2020-04-05 23:32:15 +02:00
|
|
|
%systemd_postun_with_restart %{name}.service %{name}@.service
|
2016-07-11 17:35:17 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc README.md
|
|
|
|
%{_sbindir}/dnsdist
|
|
|
|
%{_mandir}/man1/dnsdist.1*
|
2018-04-02 01:58:01 +02:00
|
|
|
%{_unitdir}/%{name}*.service
|
2016-07-11 17:35:17 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
%{_sbindir}/rc%{name}
|
|
|
|
%endif
|
|
|
|
%if %{with apparmor}
|
|
|
|
%config(noreplace) %{_sysconfdir}/apparmor.d/usr.sbin.dnsdist
|
|
|
|
%config(noreplace) %{_sysconfdir}/apparmor.d/local/usr.sbin.dnsdist
|
|
|
|
%endif
|
|
|
|
%config(noreplace) %attr(-,root,%{name}) %{_sysconfdir}/%{name}/
|
|
|
|
%dir %attr(700,%{name},%{name}) %{home}
|
|
|
|
|
|
|
|
%changelog
|