mirror of
https://abf.rosa.ru/djam/dnscrypt-proxy.git
synced 2025-02-23 08:32:56 +00:00
Update to 2.0.27
This commit is contained in:
parent
12213ff8b6
commit
94fdd0a856
5 changed files with 155 additions and 61 deletions
2
.abf.yml
2
.abf.yml
|
@ -1,2 +1,2 @@
|
|||
sources:
|
||||
dnscrypt-proxy-1.9.5.tar.bz2: 0a60f08fa40e57c77ea04380c4f30173485a4d9e
|
||||
dnscrypt-proxy-2.0.27.tar.gz: 2bcb0374aa3bb8c4665ecf9a1c98d2aa8998b06b
|
||||
|
|
93
dnscrypt-proxy
Normal file
93
dnscrypt-proxy
Normal file
|
@ -0,0 +1,93 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: dnscrypt-proxy
|
||||
# Required-Start: $remote_fs
|
||||
# Required-Stop: $remote_fs
|
||||
# Should-Start: $network $syslog
|
||||
# Should-Stop: $network $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start and stop dnscrypt-proxy
|
||||
# Description: dnscrypt-proxy is Domain Name resolver with extra security
|
||||
# features and enhanced privacy.
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DNSCRYPT_PROXY_BIN=/usr/sbin/dnscrypt-proxy
|
||||
DNSCRYPT_PROXY_USER=_dnscrypt-proxy
|
||||
DNSCRYPT_PROXY_PIDFILE=/run/dnscrypt-proxy.pid
|
||||
DNSCRYPT_PROXY_CONF=/etc/default/dnscrypt-proxy
|
||||
DNSCRYPT_PROXY_HOME=/run/dnscrypt-proxy
|
||||
DNSCRYPT_PROXY_OPTIONS=""
|
||||
DNSCRYPT_PROXY_LOCAL_ADDRESS="127.0.2.1:53"
|
||||
DNSCRYPT_PROXY_RESOLVER_NAME=cisco
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "${DNSCRYPT_PROXY_BIN}" ] || exit 0
|
||||
|
||||
[ -r "${DNSCRYPT_PROXY_CONF}" ] && . "${DNSCRYPT_PROXY_CONF}"
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting dnscrypt proxy service..." "dnscrypt-proxy"
|
||||
|
||||
[ -d "${DNSCRYPT_PROXY_HOME}" ] || \
|
||||
mkdir -m 0555 "${DNSCRYPT_PROXY_HOME}"
|
||||
|
||||
if start_daemon -p "${DNSCRYPT_PROXY_PIDFILE}" ${DNSCRYPT_PROXY_BIN} \
|
||||
--pidfile "${DNSCRYPT_PROXY_PIDFILE}" \
|
||||
--daemonize \
|
||||
--user="${DNSCRYPT_PROXY_USER}" \
|
||||
--local-address="${DNSCRYPT_PROXY_LOCAL_ADDRESS}" \
|
||||
--resolver-name="${DNSCRYPT_PROXY_RESOLVER_NAME}" \
|
||||
$DNSCRYPT_PROXY_OPTIONS; then
|
||||
if [ -x /sbin/resolvconf ]; then
|
||||
echo "nameserver ${DNSCRYPT_PROXY_LOCAL_ADDRESS}" \
|
||||
| cut -d ':' -f 1 \
|
||||
| /sbin/resolvconf -a lo.dnscrypt-proxy
|
||||
fi
|
||||
log_success_msg
|
||||
else
|
||||
log_failure_msg
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
log_daemon_msg "Stopping dnscrypt proxy service..." "dnscrypt-proxy"
|
||||
|
||||
if [ -x /sbin/resolvconf ]; then
|
||||
/sbin/resolvconf -d lo.dnscrypt-proxy
|
||||
fi
|
||||
|
||||
if killproc -p "${DNSCRYPT_PROXY_PID}" ${DNSCRYPT_PROXY_BIN}
|
||||
then
|
||||
log_success_msg
|
||||
else
|
||||
log_failure_msg
|
||||
fi
|
||||
;;
|
||||
|
||||
restart|force-reload)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
|
||||
status)
|
||||
ret=0
|
||||
status_of_proc -p "${DNSCRYPT_PROXY_PIDFILE}" ${DNSCRYPT_PROXY_BIN} \
|
||||
dnscrypt-proxy 2>/dev/null || ret=$?
|
||||
exit $ret
|
||||
;;
|
||||
|
||||
*)
|
||||
log_action_msg "Usage: /etc/init.d/dnscrypt-proxy {start|stop|restart|force-reload|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
20
dnscrypt-proxy-resolvconf.service
Normal file
20
dnscrypt-proxy-resolvconf.service
Normal file
|
@ -0,0 +1,20 @@
|
|||
[Unit]
|
||||
Description=DNSCrypt proxy resolvconf support
|
||||
Documentation=man:dnscrypt-proxy(8)
|
||||
After=dnscrypt-proxy.socket
|
||||
Requires=dnscrypt-proxy.socket
|
||||
ConditionFileIsExecutable=/sbin/resolvconf
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
Environment="DNSCRYPT_PROXY_LOCAL_ADDRESS=127.0.2.1:53"
|
||||
EnvironmentFile=-/etc/default/dnscrypt-proxy
|
||||
ExecStart=/bin/sh -c 'echo "nameserver ${DNSCRYPT_PROXY_LOCAL_ADDRESS}" \
|
||||
| cut -d ":" -f 1 \
|
||||
| /sbin/resolvconf -a lo.dnscrypt-proxy'
|
||||
ExecStop=/sbin/resolvconf -d lo.dnscrypt-proxy
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Also=dnscrypt-proxy.socket
|
|
@ -2,6 +2,7 @@
|
|||
Description=dnscrypt-proxy listening socket
|
||||
Documentation=man:dnscrypt-proxy(8)
|
||||
After=network.target
|
||||
Wants=dnscrypt-proxy-resolvconf.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=127.0.2.1:53
|
||||
|
|
|
@ -1,86 +1,66 @@
|
|||
%define debug %nil
|
||||
%define debug_package %nil
|
||||
|
||||
Summary: Tool for securing communications between a client and a DNS resolver
|
||||
Name: dnscrypt-proxy
|
||||
Version: 1.9.5
|
||||
Release: 2
|
||||
Version: 2.0.27
|
||||
Release: 1
|
||||
License: BSD
|
||||
Group: Networking/Other
|
||||
Url: http://dnscrypt.org
|
||||
Source0: http://download.dnscrypt.org/dnscrypt-proxy/%{name}-%{version}.tar.bz2
|
||||
Source1: %{name}.service
|
||||
Source2: %{name}.socket
|
||||
Source3: %{name}-default
|
||||
BuildRequires: gawk
|
||||
BuildRequires: grep
|
||||
BuildRequires: sed
|
||||
BuildRequires: pkgconfig(libsodium)
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
URL: http://dnscrypt.info
|
||||
Source0: https://github.com/jedisct1/dnscrypt-proxy/archive/%{name}-%{version}.tar.gz
|
||||
Source1: %{name}-resolvconf.service
|
||||
Source2: %{name}.service
|
||||
Source3: %{name}.socket
|
||||
Source4: %{name}-default
|
||||
Source5: %{name}
|
||||
BuildRequires: go
|
||||
BuildRequires: upx
|
||||
BuildRequires: git-core
|
||||
Requires: systemd
|
||||
|
||||
Requires(post): rpm-helper
|
||||
Requires(preun): rpm-helper
|
||||
Requires(post): rpm-helper
|
||||
Requires(preun): rpm-helper
|
||||
|
||||
%description
|
||||
A tool for securing communications between a client and a DNS resolver.
|
||||
|
||||
%files
|
||||
%{_systemunitdir}/%{name}.service
|
||||
%{_systemunitdir}/%{name}.socket
|
||||
%{_sysconfdir}/default/%{name}
|
||||
%{_sbindir}/%{name}
|
||||
%{_bindir}/hostip
|
||||
%{_mandir}/man8/%{name}.8*
|
||||
%{_mandir}/man8/hostip.8*
|
||||
%{_datadir}/%{name}/dnscrypt-resolvers.csv
|
||||
%{_datadir}/%{name}/minisign.pub
|
||||
%{_datadir}/doc/%{name}/*
|
||||
%{_libdir}/dnscrypt-proxy/libdcplugin_example.so
|
||||
%{_libdir}/dnscrypt-proxy/libdcplugin_example_logging.so
|
||||
%{_libdir}/dnscrypt-proxy/libdcplugin_example_cache.so
|
||||
%{_sysconfdir}/dnscrypt-proxy.conf
|
||||
|
||||
#----------------------------------------------------------------
|
||||
|
||||
%package devel
|
||||
Group: Development/C
|
||||
Summary: Development libraries from %{name}
|
||||
Requires: %{name} = %{EVRD}
|
||||
|
||||
%description devel
|
||||
Development libraries from %{name}.
|
||||
|
||||
%files devel
|
||||
%doc AUTHORS COPYING
|
||||
%{_includedir}/dnscrypt/*.h
|
||||
|
||||
#----------------------------------------------------------------
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%configure2_5x \
|
||||
--enable-static=no \
|
||||
--with-systemd
|
||||
pushd %{name}
|
||||
go build -ldflags="-s -w" -o ../bin/dnscrypt-proxy
|
||||
popd
|
||||
|
||||
%make
|
||||
pushd bin
|
||||
upx %{name}
|
||||
popd
|
||||
|
||||
%install
|
||||
%makeinstall
|
||||
install -D -p -m 0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
|
||||
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_systemunitdir}/%{name}-resolvconf.service
|
||||
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_systemunitdir}/%{name}.service
|
||||
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_systemunitdir}/%{name}.socket
|
||||
install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/default/%{name}
|
||||
|
||||
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_systemunitdir}/%{name}.service
|
||||
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_systemunitdir}/%{name}.socket
|
||||
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/default/%{name}
|
||||
|
||||
sed 's|# LocalAddress 127.0.0.1:53|LocalAddress 127.0.2.1:53|' -i %{buildroot}%{_sysconfdir}/dnscrypt-proxy.conf
|
||||
%files
|
||||
%doc README.md LICENSE
|
||||
%{_systemunitdir}/%{name}-resolvconf.service
|
||||
%{_systemunitdir}/%{name}.service
|
||||
%{_systemunitdir}/%{name}.socket
|
||||
%{_sysconfdir}/default/%{name}
|
||||
%{_bindir}/%{name}
|
||||
|
||||
%post
|
||||
%systemd_post dnscrypt-proxy
|
||||
# Simple: still needs this since in release 3 services were not set
|
||||
# enabled and seams that still isnt properly handeled in %%_post_service
|
||||
if [ "$1" -ge "1" ]; then
|
||||
# Enable (but don't start) the unit by default
|
||||
/bin/systemctl enable dnscrypt-proxy.service
|
||||
# Start bluetooth service
|
||||
/bin/systemctl start dnscrypt-proxy.service
|
||||
# Enable (but don't start) the unit by default
|
||||
/bin/systemctl enable dnscrypt-proxy.service
|
||||
# Start dnscrypt-proxy service
|
||||
/bin/systemctl start dnscrypt-proxy.service
|
||||
fi
|
||||
|
||||
%preun
|
||||
|
|
Loading…
Add table
Reference in a new issue