Toshaan Bharvani
6 months ago
commit
f036a2a0c0
2 changed files with 72 additions and 0 deletions
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
[Unit] |
||||
Description=Blocky |
||||
After=syslog.target |
||||
After=network.target |
||||
|
||||
[Service] |
||||
### |
||||
#LimitMEMLOCK=infinity |
||||
#LimitNOFILE=65535 |
||||
Type=simple |
||||
User=root |
||||
Group=root |
||||
ExecStart=/usr/bin/blocky --config /etc/blocky/config.yaml |
||||
Restart=always |
||||
|
||||
[Install] |
||||
WantedBy=multi-user.target |
@ -0,0 +1,55 @@
@@ -0,0 +1,55 @@
|
||||
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 |
||||
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/0xERROR/ |
||||
cd src/github.com/0xERROR/ |
||||
git clone https://github.com/0xERROR/blocky |
||||
|
||||
|
||||
%build |
||||
export GOPATH=`pwd` |
||||
cd src/github.com/0xERROR/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 src/github.com/0xERROR/blocky/blocky %{buildroot}%{_bindir}/blocky |
||||
|
||||
|
||||
%post |
||||
%systemd_post gitea.service |
||||
|
||||
|
||||
%preun |
||||
%systemd_preun gitea.service |
||||
|
||||
|
||||
%postun |
||||
%systemd_postun gitea.service |
||||
|
||||
|
||||
%files |
||||
%config(noreplace) %{_sysconfdir}/blocky/config.yaml |
||||
%{_bindir}/blocky |
||||
%{_unitdir}/blocky.service |
||||
|
||||
|
||||
%changelog |
Loading…
Reference in new issue