You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

59 lines
1.5 KiB

%global _hardened_build 1
Name : blocky
Version : 0.23
Release : 1%{dist}
License : Apache 2.0
URL : https://0xerr0r.github.io/blocky/
Summary : DNS Proxy with Ad blocker
Source0 : blocky.service
Source1 : config.yaml
BuildRequires: golang
BuildRequires: git
Requires : git
%description
Fast and lightweight DNS proxy as ad-blocker for local network with many features
%prep
%setup -T -q -c %{name}-%{version}
export GOPATH=`pwd`
mkdir -p src/github.com/0xERR0R/
cd src/github.com/0xERR0R/
git clone https://github.com/0xERR0R/blocky
%build
export GOPATH=`pwd`
cd src/github.com/0xERR0R/blocky
git checkout tags/v%{version}
GO111MODULE=on go build -v -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'github.com/0xERR0R/blocky/util.Version="%{version}"."%{release}"' -X 'github.com/0xERR0R/blocky/util.BuildTime="$(date "+%Y%m%d-%H%M%s")"' -X 'github.com/0xERR0R/blocky/util.Architecture="%{_arch}"'"
%install
install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/blocky.service
install -p -D -m 0555 %{SOURCE1} %{buildroot}%{_sysconfdir}/blocky/config.yaml
install -p -D -m 0655 src/github.com/0xERR0R/blocky/blocky %{buildroot}%{_bindir}/blocky
%post
%systemd_post blocky.service
%preun
%systemd_preun blocky.service
%postun
%systemd_postun blocky.service
%files
%config(noreplace) %{_sysconfdir}/blocky/config.yaml
%{_bindir}/blocky
%{_unitdir}/blocky.service
%changelog