dnscrypt-proxy/dnscrypt-proxy.spec
2022-08-02 14:44:54 +03:00

68 lines
1.9 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.2
Release: 1
License: BSD
Group: Networking/Other
URL: http://dnscrypt.info
#Source0: https://github.com/jedisct1/dnscrypt-proxy/archive/%{version}/%{name}-%{version}.tar.gz
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
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
pushd %{name}
go build -ldflags="-s -w" -o ../bin/dnscrypt-proxy
popd
pushd bin
upx %{name}
popd
%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}
%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 dnscrypt-proxy service
/bin/systemctl start dnscrypt-proxy.service
fi
%preun
%systemd_preun dnscrypt-proxy