commit f036a2a0c0b5adafcd70ee4ab138299aa8453ab8 Author: Toshaan Bharvani Date: Thu May 23 17:10:14 2024 +0200 initial package creation Signed-off-by: Toshaan Bharvani diff --git a/SOURCES/blocky.service b/SOURCES/blocky.service new file mode 100644 index 0000000..160e90f --- /dev/null +++ b/SOURCES/blocky.service @@ -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 diff --git a/SPECS/blocky.spec b/SPECS/blocky.spec new file mode 100644 index 0000000..c31a210 --- /dev/null +++ b/SPECS/blocky.spec @@ -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