dnscrypt-proxy/dnscrypt-proxy.spec

144 lines
4.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package dnscrypt-proxy
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: dnscrypt-proxy
Version: 1.7.0
Release: 0
Summary: A tool for securing communications between a client and a DNS resolver
License: BSD-3-Clause
Group: Productivity/Networking/DNS/Utilities
#Git-Url: https://github.com/jedisct1/dnscrypt-proxy
Url: https://dnscrypt.org
Source: https://download.dnscrypt.org/dnscrypt-proxy/%{name}-%{version}.tar.bz2
Source1: %{name}.service
Source2: dnscrypt
Source3: sysconfig.dnscrypt
Source4: https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv
BuildRequires: libsodium-devel
BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: shadow
Requires(pre): fillup coreutils grep diffutils
Provides: dnscrypt = %{version}-%{release}
Obsoletes: dnscrypt < %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} >= 1210
BuildRequires: systemd-devel
%{?systemd_requires}
%endif
%description
dnscrypt-proxy provides local service which can be used directly as your local resolver or as a DNS forwarder,
encrypting and authenticating requests using the DNSCrypt protocol and passing them to an upstream server,
by default Cisco who run this on their resolvers. (It used to be OpenDNS.)
The DNSCrypt protocol uses high-speed high-security elliptic-curve cryptography and is very similar to
DNSCurve, but focuses on securing communications between a client and its first-level resolver.
While not providing end-to-end security, it protects the local network, which is often the weakest point
of the chain, against man-in-the-middle attacks. It also provides some confidentiality to DNS queries.
%package devel
Summary: Header files for developent of DNSCrypt plugins
Group: Development/Languages/C and C++
Requires: %{name} = %{version}
%description devel
Header files for developent of DNSCrypt plugins.
%prep
%setup -q
%build
%configure \
%if 0%{?suse_version} >= 1210
--with-systemd \
%endif
--enable-plugins
make %{?_smp_mflags}
%install
%make_install
install -d -m 755 %{buildroot}%{_unitdir}
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
install -m 644 dnscrypt-proxy.socket %{buildroot}%{_unitdir}
install -d -m 755 %{buildroot}%{_sbindir}
install -m 755 %{SOURCE2} %{buildroot}%{_sbindir}
install -m 755 -d %{buildroot}%{_localstatedir}/adm/fillup-templates
install -m 644 -D %{SOURCE3} %{buildroot}%{_localstatedir}/adm/fillup-templates
install -m 644 %{SOURCE4} %{buildroot}/%{_datadir}/%{name}/dnscrypt-resolvers.csv
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
find %{buildroot} -name "*.la" -delete -print
%pre
if ! %{_bindir}/getent group dnscrypt >/dev/null; then
%{_sbindir}/groupadd -r dnscrypt 2>/dev/null || :
fi
if ! %{_bindir}/getent passwd dnscrypt >/dev/null; then
%{_sbindir}/useradd -c "DNSCrypt daemon" -d %{_localstatedir}/lib/empty -g dnscrypt \
-r -s /bin/false dnscrypt 2>/dev/null || :
fi
%if 0%{?suse_version} >= 1210
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%{fillup_only -n dnscrypt}
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%else
# non-systemd
%post
%{fillup_only -n dnscrypt}
%endif
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog README COPYING NEWS DNSCRYPT-V2-PROTOCOL.txt THANKS
%{_bindir}/hostip
%{_sbindir}/dnscrypt
%{_sbindir}/%{name}
%{_sbindir}/rc%{name}
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%{_mandir}/man8/hostip.8%{ext_man}
%{_mandir}/man8/%{name}.8%{ext_man}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/dnscrypt-resolvers.csv
%{_datadir}/%{name}/minisign.pub
%{_localstatedir}/adm/fillup-templates/sysconfig.dnscrypt
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/libdcplugin_example.so
%{_libdir}/%{name}/libdcplugin_example_logging.so
%files devel
%defattr(-,root,root)
%dir %{_includedir}/dnscrypt/
%{_includedir}/dnscrypt/*
%changelog