File stubby.spec of Package stubby

# spec file for package stubby
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2021/22 Florian "sp1rit" <>
# 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.

# Please submit bugfixes or comments via

Name:           stubby
Version:        0.4.3
Release:        0
Summary:        DNS Privacy stub resolver
License:        BSD-3-Clause
# Willem Toorop <>
# DC34EE5DB2417BCC151E5100E5F8F8212F77A498
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  pkgconfig
BuildRequires:  systemd-rpm-macros
BuildRequires:  pkgconfig(getdns)
BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(yaml-0.1)

Stubby is an application that acts as a local DNS Privacy stub
resolver (using DNS-over-TLS). Stubby encrypts DNS queries sent
from a client machine (desktop or laptop) to a DNS Privacy resolver
increasing end user privacy. Stubby is in the early stages of
development but is suitable for technical/advanced users. A more
generally user-friendly version is on the way!

Stubby provides DNS Privacy by:
- Running as a daemon
- Listening on the loopback address to send all outgoing DNS queries
  received on that address out over TLS
- Using a default configuration which provides Strict Privacy and
  uses a subset of the available DNS Privacy servers

Stubby is developed by the getdns team.

%autosetup -p1



mkdir -p %{buildroot}%{_unitdir}
install -pm 0644 systemd/stubby.service %{buildroot}%{_unitdir}/stubby.service
mkdir -p %{buildroot}%{_sbindir}/
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}

rm -rf %{buildroot}%{_datadir}/doc/%{name}

%service_add_pre %{name}.service

# systemd would replace it with symlink
if [ ! -L "%{_localstatedir}/cache/stubby" -a -d "%{_localstatedir}/cache/stubby" ]; then
       mv "%{_localstatedir}/cache/stubby"{,.rpmsave}
%service_add_post %{name}.service

%service_del_preun %{name}.service

%service_del_postun_with_restart %{name}.service

%license COPYING
%doc AUTHORS ChangeLog
%config(noreplace) %{_sysconfdir}/%{name}
%ghost %{_localstatedir}/cache/stubby

openSUSE Build Service is sponsored by