mirror of
https://abf.rosa.ru/djam/dnscrypt-proxy.git
synced 2025-02-23 16:42:55 +00:00
75 lines
No EOL
2.3 KiB
RPMSpec
75 lines
No EOL
2.3 KiB
RPMSpec
%define debug %nil
|
||
%define debug_package %nil
|
||
|
||
Summary: Tool for securing communications between a client and a DNS resolver
|
||
Name: dnscrypt-proxy
|
||
Version: 2.1.7
|
||
Release: 1
|
||
License: BSD
|
||
Group: Networking/Other
|
||
URL: https://dnscrypt.info
|
||
Source0: https://github.com/DNSCrypt/dnscrypt-proxy/archive/%{version}/%{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
|
||
BuildRequires: pkgconfig(systemd)
|
||
Requires: systemd
|
||
|
||
Requires(post): rpm-helper
|
||
Requires(preun): rpm-helper
|
||
|
||
%description
|
||
A tool for securing communications between a client and a DNS resolver.
|
||
|
||
%prep
|
||
%setup -q
|
||
|
||
%build
|
||
export GOPROXY=direct
|
||
go build -ldflags="-s -w" -o bin/dnscrypt-proxy ./%{name}/
|
||
|
||
upx bin/%{name}
|
||
|
||
%install
|
||
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 -Dm0644 %{name}/example-dnscrypt-proxy.toml %{buildroot}%{_sysconfdir}/dnscrypt/dnscrypt-proxy.toml
|
||
|
||
%files
|
||
%doc README.md LICENSE dnscrypt-proxy/example*
|
||
%{_systemunitdir}/%{name}-resolvconf.service
|
||
%{_systemunitdir}/%{name}.service
|
||
%{_systemunitdir}/%{name}.socket
|
||
%{_sysconfdir}/default/%{name}
|
||
%{_bindir}/%{name}
|
||
%{_sysconfdir}/dnscrypt/dnscrypt-proxy.toml
|
||
|
||
%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 dnscrypt-proxy service
|
||
/bin/systemctl start dnscrypt-proxy.service
|
||
fi
|
||
|
||
# настроим сервис systemd-resolver и перезапустим его
|
||
sed -i 's/^#DNS=/DNS=127.0.0.1/' /etc/systemd/resolved.conf
|
||
/bin/systemctl restart systemd-resolved.service
|
||
|
||
|
||
%preun
|
||
%systemd_preun dnscrypt-proxy
|
||
|
||
# вернем настройки резолвера в дефолтное состояние
|
||
sed -i 's/DNS=127.0.0.1/#DNS=/' /etc/systemd/resolved.conf |