public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:master commit in: net-dns/AdGuardHome/, net-dns/AdGuardHome/files/
@ 2024-01-01 14:31 Florian Schmaus
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Schmaus @ 2024-01-01 14:31 UTC (permalink / raw
  To: gentoo-commits

commit:     455aae69ed201dcef931219a5b17cf3a82d5c01b
Author:     Rahil Bhimjiani <me <AT> rahil <DOT> rocks>
AuthorDate: Mon Jan  1 05:20:55 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Mon Jan  1 05:20:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=455aae69

net-dns/AdGuardHome: Pi-Hole alternative written in Go

offers following features which lack in Pi-hole
* Encrypted DNS upstream servers (DNS-over-HTTPS, DNS-over-TLS,
DNSCrypt)
* Running as a DNS-over-HTTPS or DNS-over-TLS server

Signed-off-by: Rahil Bhimjiani <me <AT> rahil.rocks>

 net-dns/AdGuardHome/AdGuardHome-0.107.43.ebuild    | 106 +++++++++++++++++++++
 net-dns/AdGuardHome/Manifest                       |   3 +
 .../AdGuardHome/files/AdGuardHome-0.107.43.service |  22 +++++
 net-dns/AdGuardHome/metadata.xml                   |  13 +++
 4 files changed, 144 insertions(+)

diff --git a/net-dns/AdGuardHome/AdGuardHome-0.107.43.ebuild b/net-dns/AdGuardHome/AdGuardHome-0.107.43.ebuild
new file mode 100644
index 0000000000..c1a9f54336
--- /dev/null
+++ b/net-dns/AdGuardHome/AdGuardHome-0.107.43.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit fcaps go-module systemd
+
+DESCRIPTION="Network-wide ads & trackers blocking DNS server like Pi-Hole with web ui"
+HOMEPAGE="https://github.com/AdguardTeam/AdGuardHome/"
+
+SRC_URI="
+	https://github.com/AdguardTeam/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+	https://github.com/AdguardTeam/${PN}/releases/download/v${PV}/AdGuardHome_frontend.tar.gz -> ${P}-frontend.tar.gz
+	https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz
+"
+
+# main
+LICENSE="GPL-3"
+# deps
+LICENSE+=" Apache-2.0 BSD BSD-2 MIT ZLIB"
+
+SLOT="0"
+KEYWORDS="~amd64"
+
+FILECAPS=(
+	-m 755 'cap_net_bind_service=+eip cap_net_raw=+eip' usr/bin/${PN}
+)
+
+src_prepare() {
+	default
+	# move frontend to project directory
+	rm build/gitkeep && mv ../build ./ || die
+}
+
+src_compile() {
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-build.sh
+
+	local MY_LDFLAGS="-s -w"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.version=${PV}"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.channel=release"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.committime=$(date +%s)"
+	if [ "$(go env GOARM)" != '' ]
+	then
+		MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.goarm=$(go env GOARM)"
+	elif [ "$(go env GOMIPS)" != '' ]
+	then
+		MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.gomips=$(go env GOMIPS)"
+	fi
+
+	ego build -ldflags "${MY_LDFLAGS}" -trimpath
+}
+
+src_test() {
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-test.sh
+	count_flags='--count=1'
+	cover_flags='--coverprofile=./coverage.txt'
+	shuffle_flags='--shuffle=on'
+	timeout_flags="--timeout=30s"
+	fuzztime_flags="--fuzztime=20s"
+	readonly count_flags cover_flags shuffle_flags timeout_flags fuzztime_flags
+
+	# race only works when pie is disabled
+	export GOFLAGS="${GOFLAGS/-buildmode=pie/}"
+
+	# following test is failing without giving any reason. Tried disabling internal/updater internal/whois tests toggling race, but still failing.
+	# ego test\
+	# 	  "$count_flags"\
+	# 	  "$cover_flags"\
+	# 	  "$shuffle_flags"\
+	# 	  --race=1\
+	# 	  "$timeout_flags"\
+	# 	  ./...
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-bench.sh
+	ego test\
+		  "$count_flags"\
+		  "$shuffle_flags"\
+		  --race=0\
+		  "$timeout_flags"\
+		  --bench='.'\
+		  --benchmem\
+		  --benchtime=1s\
+		  --run='^$'\
+		  ./...
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-fuzz.sh
+	ego test\
+		  "$count_flags"\
+		  "$shuffle_flags"\
+		  --race=0\
+		  "$timeout_flags"\
+		  "$fuzztime_flags"\
+		  --fuzz='.'\
+		  --run='^$'\
+		  ./internal/filtering/rulelist/\
+		;
+
+}
+
+src_install() {
+	dobin "${PN}"
+	einstalldocs
+
+	systemd_newunit "${FILESDIR}"/AdGuardHome-0.107.43.service "${PN}".service
+}

diff --git a/net-dns/AdGuardHome/Manifest b/net-dns/AdGuardHome/Manifest
new file mode 100644
index 0000000000..ced137539c
--- /dev/null
+++ b/net-dns/AdGuardHome/Manifest
@@ -0,0 +1,3 @@
+DIST AdGuardHome-0.107.43-deps.tar.xz 104529544 BLAKE2B 4fde3b1e2f85cf85209eb2149c40a5478e4d55cbae90847fafdb5f056b7af2a8234a5880fac6bbed1b62e64d7e849162abbc9e5fef3b262ecea8760fcb21c21c SHA512 44458c3d1d46c7ccf50308227ff765927e1b6d4876065af13004bd0ec2c82c7727e76a81bfc52cf920ea2dee361e5c761db73ed610d04b23568c6e7611301348
+DIST AdGuardHome-0.107.43-frontend.tar.gz 2781809 BLAKE2B 72d42f40a5f671f5dab72a7fcbd77fdfbd58126b67c73fd6e1dbec5f956c017ff64c01cb8c89ec5c72ef2058640e7cea5b93fe1b3c2c7b76edc6de32ab7f4801 SHA512 1c1fd527638c3e35fa21b5738868dae04b41a0bbb04942c94cc36d1dc7f6961bd202c7862fdfffe3ed52039c75b3f358e399c17ccd121e78432ec58fa837f4a0
+DIST AdGuardHome-0.107.43.tar.gz 2227903 BLAKE2B a4811969b2e156a33d6267edeca4be3535e095e8133c6c8d761e132e5f95d21403df37f8ac5567d85994b89ff8912f1799f21f648d6a26a6bf7971d02bd11ffd SHA512 cc9f7602ada6e40ff7c8449bfc1c40fb184c848019ff95b1db46a974f4a72606c587015d440e25094c51cc0b6d01eb68686765d0a92f01752615db63e4527803

diff --git a/net-dns/AdGuardHome/files/AdGuardHome-0.107.43.service b/net-dns/AdGuardHome/files/AdGuardHome-0.107.43.service
new file mode 100644
index 0000000000..2311ee1497
--- /dev/null
+++ b/net-dns/AdGuardHome/files/AdGuardHome-0.107.43.service
@@ -0,0 +1,22 @@
+# This unit is inspired from
+# `AdGuardHome -s install` on systemd machine and
+# https://aur.archlinux.org/cgit/aur.git/tree/adguardhome.service?h=adguardhome
+
+[Unit]
+Description=Network-wide ads & trackers blocking DNS server with WebUI
+After=network-online.target
+ConditionFileIsExecutable=/usr/bin/AdGuardHome
+
+[Service]
+StartLimitInterval=5
+StartLimitBurst=10
+DynamicUser=true
+StateDirectory=AdGuardHome
+WorkingDirectory=/var/lib/AdGuardHome
+AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_RAW
+ExecStart=/usr/bin/AdGuardHome --no-check-update --work-dir /var/lib/AdGuardHome
+ExecReload=/usr/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target

diff --git a/net-dns/AdGuardHome/metadata.xml b/net-dns/AdGuardHome/metadata.xml
new file mode 100644
index 0000000000..2aeba77180
--- /dev/null
+++ b/net-dns/AdGuardHome/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>me@rahil.rocks</email>
+    <name>Rahil Bhimjiani</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">AdguardTeam/AdGuardHome</remote-id>
+    <bugs-to>https://github.com/AdguardTeam/AdGuardHome/issues</bugs-to>
+    <doc>https://github.com/AdguardTeam/AdGuardHome/</doc>
+  </upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/proj/guru:master commit in: net-dns/AdGuardHome/, net-dns/AdGuardHome/files/
@ 2024-02-07 10:10 David Roman
  0 siblings, 0 replies; 3+ messages in thread
From: David Roman @ 2024-02-07 10:10 UTC (permalink / raw
  To: gentoo-commits

commit:     e9edd0a0cbb9103f0197359ee81a37a5b7ab6071
Author:     Rahil Bhimjiani <me <AT> rahil <DOT> rocks>
AuthorDate: Wed Feb  7 01:41:13 2024 +0000
Commit:     David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Wed Feb  7 01:43:01 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e9edd0a0

net-dns/AdGuardHome: add 0.107.44

New opt-out USE flag, 'web' which toggles web UI.

Signed-off-by: Rahil Bhimjiani <me <AT> rahil.rocks>

 net-dns/AdGuardHome/AdGuardHome-0.107.44.ebuild    | 119 +++++++++++++++++++++
 net-dns/AdGuardHome/Manifest                       |   3 +
 .../AdGuardHome/files/fix-go.mod-0.107.44.patch    |  10 ++
 net-dns/AdGuardHome/metadata.xml                   |   3 +
 4 files changed, 135 insertions(+)

diff --git a/net-dns/AdGuardHome/AdGuardHome-0.107.44.ebuild b/net-dns/AdGuardHome/AdGuardHome-0.107.44.ebuild
new file mode 100644
index 0000000000..f1d2096380
--- /dev/null
+++ b/net-dns/AdGuardHome/AdGuardHome-0.107.44.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit fcaps go-module systemd
+
+DESCRIPTION="Network-wide ads & trackers blocking DNS server like Pi-Hole with web ui"
+HOMEPAGE="https://github.com/AdguardTeam/AdGuardHome/"
+
+SRC_URI="
+	https://github.com/AdguardTeam/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+	https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz
+	web? ( https://github.com/AdguardTeam/${PN}/releases/download/v${PV}/AdGuardHome_frontend.tar.gz -> ${P}-frontend.tar.gz )
+"
+
+# main
+LICENSE="GPL-3"
+# deps
+LICENSE+=" Apache-2.0 BSD BSD-2 MIT ZLIB"
+
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+IUSE="+web"
+# RESTRICT="test"
+
+# see the patch below
+BDEPEND=">=dev-lang/go-1.21:="
+BDEPEND+=" app-arch/unzip"
+
+FILECAPS=(
+	-m 755 'cap_net_bind_service=+eip cap_net_raw=+eip' usr/bin/${PN}
+)
+
+# otherwise it'll error out saying "update go.mod file"
+# Since dev-lang/go-1.21 is stable i think it's safe to update
+PATCHES=(
+	"${FILESDIR}"/fix-go.mod-0.107.44.patch
+)
+
+src_prepare() {
+	default
+	# move frontend to project directory
+	use web && { rm -v build/gitkeep && mv -v ../build ./ || die ; }
+}
+
+src_compile() {
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-build.sh
+
+	local MY_LDFLAGS="-s -w"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.version=${PV}"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.channel=release"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.committime=$(date +%s)"
+	if [ "$(go env GOARM)" != '' ]
+	then
+		MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.goarm=$(go env GOARM)"
+	elif [ "$(go env GOMIPS)" != '' ]
+	then
+		MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.gomips=$(go env GOMIPS)"
+	fi
+
+	ego build -ldflags "${MY_LDFLAGS}" -trimpath -v=1 -x=1
+}
+
+src_test() {
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-test.sh
+	count_flags='--count=1'
+	cover_flags='--coverprofile=./coverage.txt'
+	shuffle_flags='--shuffle=on'
+	timeout_flags="--timeout=30s"
+	fuzztime_flags="--fuzztime=20s"
+	readonly count_flags cover_flags shuffle_flags timeout_flags fuzztime_flags
+
+	# race only works when pie is disabled
+	export GOFLAGS="${GOFLAGS/-buildmode=pie/}"
+
+	# following test is failing without giving any reason. Tried disabling internal/updater internal/whois tests toggling race, but still failing.
+	# ego test\
+	# 	  "$count_flags"\
+	# 	  "$cover_flags"\
+	# 	  "$shuffle_flags"\
+	# 	  --race=1\
+	# 	  "$timeout_flags"\
+	# 	  ./...
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-bench.sh
+	ego test\
+		  "$count_flags"\
+		  "$shuffle_flags"\
+		  --race=0\
+		  "$timeout_flags"\
+		  --bench='.'\
+		  --benchmem\
+		  --benchtime=1s\
+		  --run='^$'\
+		  ./...
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-fuzz.sh
+	ego test\
+		  "$count_flags"\
+		  "$shuffle_flags"\
+		  --race=0\
+		  "$timeout_flags"\
+		  "$fuzztime_flags"\
+		  --fuzz='.'\
+		  --run='^$'\
+		  ./internal/filtering/rulelist/\
+		;
+
+}
+
+src_install() {
+	dobin "${PN}"
+	einstalldocs
+
+	systemd_newunit "${FILESDIR}"/AdGuardHome-0.107.43.service "${PN}".service
+}

diff --git a/net-dns/AdGuardHome/Manifest b/net-dns/AdGuardHome/Manifest
index ced137539c..3485842436 100644
--- a/net-dns/AdGuardHome/Manifest
+++ b/net-dns/AdGuardHome/Manifest
@@ -1,3 +1,6 @@
 DIST AdGuardHome-0.107.43-deps.tar.xz 104529544 BLAKE2B 4fde3b1e2f85cf85209eb2149c40a5478e4d55cbae90847fafdb5f056b7af2a8234a5880fac6bbed1b62e64d7e849162abbc9e5fef3b262ecea8760fcb21c21c SHA512 44458c3d1d46c7ccf50308227ff765927e1b6d4876065af13004bd0ec2c82c7727e76a81bfc52cf920ea2dee361e5c761db73ed610d04b23568c6e7611301348
 DIST AdGuardHome-0.107.43-frontend.tar.gz 2781809 BLAKE2B 72d42f40a5f671f5dab72a7fcbd77fdfbd58126b67c73fd6e1dbec5f956c017ff64c01cb8c89ec5c72ef2058640e7cea5b93fe1b3c2c7b76edc6de32ab7f4801 SHA512 1c1fd527638c3e35fa21b5738868dae04b41a0bbb04942c94cc36d1dc7f6961bd202c7862fdfffe3ed52039c75b3f358e399c17ccd121e78432ec58fa837f4a0
 DIST AdGuardHome-0.107.43.tar.gz 2227903 BLAKE2B a4811969b2e156a33d6267edeca4be3535e095e8133c6c8d761e132e5f95d21403df37f8ac5567d85994b89ff8912f1799f21f648d6a26a6bf7971d02bd11ffd SHA512 cc9f7602ada6e40ff7c8449bfc1c40fb184c848019ff95b1db46a974f4a72606c587015d440e25094c51cc0b6d01eb68686765d0a92f01752615db63e4527803
+DIST AdGuardHome-0.107.44-deps.tar.xz 115115688 BLAKE2B 198d1f86f24d5d7857eb0bb992ba7be34ee58fa9edd110c2434a59d4dd7cb936acb56175733a86ca847bcf48e99e8960d1a2b38bef072a0151d6b8875b9e13e4 SHA512 a8e77ce8b112f1c1dd6d993fcc8a52c802bf51ce9edc2383137360745f40b95a29c0e913920b17fc9f203286d18bd3ec5813eca0640bff0eb1655e9165c30763
+DIST AdGuardHome-0.107.44-frontend.tar.gz 2784087 BLAKE2B 9c9d1a165bb885d120780f8f35cc38c11d9a0865ee706a33932feba98c13f0b181dbc7fcab10fa16d6654846fe2acf16ccc3aff7aec8b78f44e0092e623f1380 SHA512 0beae751490fb5095e2459b222781d177c4c206d86dc7fcc8a048b03ffcab1896d82cf2b741b9cb94dc817e2c53393ee001a4a182a795f9546d57a8988cebc4d
+DIST AdGuardHome-0.107.44.tar.gz 2243237 BLAKE2B f7a7299304f915de2c5e1a673170d480578d68b2b05a15edf7302e3499b55f74dd786b145c5d97a9834c79bf1f7c8e89b5db7ced57b8cea3871cb1415efef51e SHA512 3db00251b9e6567ebe8404c12be2fddaf9d6a924b3d12980a1ab4f7c314089cea68bf1ddbce98702c9f94e1997a717afcb723a9214b3d9a34edcff390b73cb88

diff --git a/net-dns/AdGuardHome/files/fix-go.mod-0.107.44.patch b/net-dns/AdGuardHome/files/fix-go.mod-0.107.44.patch
new file mode 100644
index 0000000000..1e2d06602d
--- /dev/null
+++ b/net-dns/AdGuardHome/files/fix-go.mod-0.107.44.patch
@@ -0,0 +1,10 @@
+--- a/go.mod
++++ b/go.mod
+@@ -1,6 +1,6 @@
+ module github.com/AdguardTeam/AdGuardHome
+ 
+-go 1.20
++go 1.21
+ 
+ require (
+ 	github.com/AdguardTeam/dnsproxy v0.63.1

diff --git a/net-dns/AdGuardHome/metadata.xml b/net-dns/AdGuardHome/metadata.xml
index 2aeba77180..4176d1743b 100644
--- a/net-dns/AdGuardHome/metadata.xml
+++ b/net-dns/AdGuardHome/metadata.xml
@@ -5,6 +5,9 @@
     <email>me@rahil.rocks</email>
     <name>Rahil Bhimjiani</name>
   </maintainer>
+  <use>
+    <flag name="web">Enables web user interface (UI)</flag>
+  </use>
   <upstream>
     <remote-id type="github">AdguardTeam/AdGuardHome</remote-id>
     <bugs-to>https://github.com/AdguardTeam/AdGuardHome/issues</bugs-to>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/proj/guru:master commit in: net-dns/AdGuardHome/, net-dns/AdGuardHome/files/
@ 2025-03-15 10:36 Haelwenn Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Haelwenn Monnier @ 2025-03-15 10:36 UTC (permalink / raw
  To: gentoo-commits

commit:     dca1248aa2095ca8d8e251690a478f1d41377e96
Author:     Rahil Bhimjiani <me <AT> rahil <DOT> rocks>
AuthorDate: Thu Mar 13 19:07:25 2025 +0000
Commit:     Haelwenn Monnier <contact <AT> hacktivis <DOT> me>
CommitDate: Thu Mar 13 19:16:12 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=dca1248a

net-dns/AdGuardHome: update to 0.107.57

1. Use upstream provided prebuilt frontend instead of building on our own.
   Reasons:
* one less dependency of nodejs/npm
* reduced size of distfile from 30MiB to 3MiB
* easier and faster packaging
* performance is not impacted as build output is just js/css files
* no more breakage due to changes in nodejs versions

2. updated systemd service unit to latest changes

Signed-off-by: Rahil Bhimjiani <me <AT> rahil.rocks>

 net-dns/AdGuardHome/AdGuardHome-0.107.57.ebuild    | 141 +++++++++++++++++++++
 net-dns/AdGuardHome/Manifest                       |   4 +
 .../AdGuardHome/files/AdGuardHome-0.107.57.service |  24 ++++
 3 files changed, 169 insertions(+)

diff --git a/net-dns/AdGuardHome/AdGuardHome-0.107.57.ebuild b/net-dns/AdGuardHome/AdGuardHome-0.107.57.ebuild
new file mode 100644
index 000000000..7eb5d6bd9
--- /dev/null
+++ b/net-dns/AdGuardHome/AdGuardHome-0.107.57.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit fcaps go-module readme.gentoo-r1 systemd
+
+DESCRIPTION="Network-wide ads & trackers blocking DNS server like Pi-Hole with web ui"
+HOMEPAGE="https://github.com/AdguardTeam/AdGuardHome/"
+
+WIKI_COMMIT="5657b4b"
+SRC_URI="
+	https://github.com/AdguardTeam/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+	https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz
+	https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/wiki.tar.xz -> ${PN}-wiki-${WIKI_COMMIT}.tar.xz
+	web? ( https://github.com/AdguardTeam/AdGuardHome/releases/download/v${PV}/AdGuardHome_frontend.tar.gz -> ${P}-web.tar.gz )
+"
+
+# main
+LICENSE="GPL-3"
+# deps
+LICENSE+=" Apache-2.0 BSD BSD-2 MIT ZLIB"
+
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+IUSE="+web"
+# RESTRICT="test"
+
+FILECAPS=(
+	-m 755 'cap_net_bind_service=+eip cap_net_raw=+eip' usr/bin/${PN}
+)
+
+PATCHES=(
+	"${FILESDIR}"/disable-update-cmd-opt.patch
+)
+
+DOCS="
+	../${PN}.wiki/*
+"
+
+DOC_CONTENTS="\n
+User is advised to not run binary directly instead use systemd service\n\n
+Defaults for systemd service:\n
+Web UI: 0.0.0.0:3000\n
+Data directory: /var/lib/${PN}\n
+Default config: /var/lib/${PN}/${PN}.yaml
+"
+src_unpack() {
+	# because we're using  vendor/ so we don't need go-module_src_unpack
+	default
+}
+
+src_prepare() {
+	ln -sv ../vendor ./ || die
+
+	default
+
+	# symlinking doesn't work for some reason so MUST `mv`
+	use web && { rm -v build/gitkeep && rmdir build && mv ../build ./ || die ; }
+}
+
+src_compile() {
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-build.sh
+
+	local MY_LDFLAGS="-s -w"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.version=${PV}"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.channel=release"
+	MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.committime=$(date +%s)"
+	if [ "$(go env GOARM)" != '' ]
+	then
+		MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.goarm=$(go env GOARM)"
+	elif [ "$(go env GOMIPS)" != '' ]
+	then
+		MY_LDFLAGS+=" -X github.com/AdguardTeam/AdGuardHome/internal/version.gomips=$(go env GOMIPS)"
+	fi
+
+	ego build -ldflags "${MY_LDFLAGS}" -trimpath -v=1 -x=1
+}
+
+src_test() {
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-test.sh
+	count_flags='--count=1'
+	cover_flags='--coverprofile=./coverage.txt'
+	shuffle_flags='--shuffle=on'
+	timeout_flags="--timeout=30s"
+	fuzztime_flags="--fuzztime=20s"
+	readonly count_flags cover_flags shuffle_flags timeout_flags fuzztime_flags
+
+	# race only works when pie is disabled
+	export GOFLAGS="${GOFLAGS/-buildmode=pie/}"
+
+	# following test is failing without giving any reason. Tried disabling internal/updater internal/whois tests toggling race, but still failing.
+	# ego test\
+	# 	  "$count_flags"\
+	# 	  "$cover_flags"\
+	# 	  "$shuffle_flags"\
+	# 	  --race=1\
+	# 	  "$timeout_flags"\
+	# 	  ./...
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-bench.sh
+	ego test\
+		  "$count_flags"\
+		  "$shuffle_flags"\
+		  --race=0\
+		  "$timeout_flags"\
+		  --bench='.'\
+		  --benchmem\
+		  --benchtime=1s\
+		  --run='^$'\
+		  ./...
+
+	# mimicking https://github.com/AdguardTeam/AdGuardHome/blob/master/scripts/make/go-fuzz.sh
+	ego test\
+		  "$count_flags"\
+		  "$shuffle_flags"\
+		  --race=0\
+		  "$timeout_flags"\
+		  "$fuzztime_flags"\
+		  --fuzz='.'\
+		  --run='^$'\
+		  ./internal/filtering/rulelist/\
+		;
+
+}
+
+src_install() {
+	dobin "${PN}"
+	dosym -r /usr/bin/"${PN}" /usr/bin/adguardhome
+
+	einstalldocs
+	readme.gentoo_create_doc
+
+	systemd_newunit "${FILESDIR}"/AdGuardHome-0.107.57.service "${PN}".service
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+}

diff --git a/net-dns/AdGuardHome/Manifest b/net-dns/AdGuardHome/Manifest
index 94ebc218b..a4665f2f1 100644
--- a/net-dns/AdGuardHome/Manifest
+++ b/net-dns/AdGuardHome/Manifest
@@ -5,4 +5,8 @@ DIST AdGuardHome-0.107.50-deps.tar.xz 2674988 BLAKE2B 72747c4eebd33a3e453c9062ca
 DIST AdGuardHome-0.107.50.tar.gz 2269495 BLAKE2B 49b4811c118a938d6191e856588d262a9645309e43d40d70be646d6ba831f722da069f1d07b7192e663f23992994a3d1328e52d4923f58cbc0a70d0495476ce4 SHA512 d2744328d03945c6d8851e3d49d5244f5e85fceb769e901209381d79af4bcc9996d19eb29bff7e20d6e51d2e52285813ebe649d93a94eaa143c0315422dcb5a8
 DIST AdGuardHome-0.107.51-deps.tar.xz 2675048 BLAKE2B a68d9690c3b0499ac230ac8cc714de0b438a350888e060ae30273c3616f16325a73c2cc744f80ba336820a3285ce67eda53204ebdc80fc2b7f733fe90cc040b2 SHA512 dc86548910e4a44f9f984d4db6df7e9739fd3f0ca8ff43e3d57dba5680be58262df0d4c9002f9d9c1e8f61755a7ad0c45fd9678f36798f6dea2c8905cde3464e
 DIST AdGuardHome-0.107.51.tar.gz 2270014 BLAKE2B cadbb18d527768a85f19c29b1f17fad2072ff96565774c48e2b7907578a931c99d51eedd8baab551d62ab5769f363f9bbf877a9f6b9d3429aa78a262a18c94f8 SHA512 148db24905a50945d95381370b28a1acf03ef6747ac9b56267b91b3a0a25c48649c2107ae58a44a6a816c1a9eebf50594e68465ce6620553745f1689aa606992
+DIST AdGuardHome-0.107.57-deps.tar.xz 2732084 BLAKE2B 918d46dd3cdbfa663f155b7e97cfafb9fb9ab0c35c629e386b4dc83733660c1d403509dca0de469d3e0fa2cf9e9d9e36ad583719c2f9348c426f553a92d16572 SHA512 4d3b8947911cf18bb64ef4d8c2fa0608f6a37a3f5edc1a7c48e89573b1aac62f65d0a077abd1b429b54911f0b5cff72ac367f04b2986b98c6f915fe1c88022b9
+DIST AdGuardHome-0.107.57-web.tar.gz 2461334 BLAKE2B 8ab1fad83d66a5f330593e783a09263bf72e10d5c64d5e7cd0eaa7a2e2ce59e9004ad113ed1339e22ced5d5a3e552485b84a06db839c2982ded49a80f06d228f SHA512 3a6372a4e3d8aad2b1b96da859b738f9425584f24ede188742fed2a29097748c6d3bf10933cc2b1542126bd25c8ea4673685135d15f7784b19b6a765ab66814c
+DIST AdGuardHome-0.107.57.tar.gz 2301234 BLAKE2B 054b981658aed9d275559d056d686ea9be62a96a9aa822761004242277ddeca7a6e23637b9a024576e9f12500ec9a8b259713f5a2dc21f36f7ab327dbfed40d7 SHA512 10d76bb4fd8b7f57c72272ae18077e12c5096a29ee8700920dd258b17ad6495310ea8ce47e0e7287b2fda9ef741e12afdfb0ee446e0058d964dc4d6cb56abbc3
 DIST AdGuardHome-wiki-3b27176.tar.xz 44232 BLAKE2B a4333f99ab7860734b41677265fe3565aea82db1ef6306920f302a3ed2ec69cf9a17523465ffeceefa04ffdd0d916d61adb2c8fc5d01b40a1a80c4d99d76ab72 SHA512 d702373ede62589f079fb86474ade02a9520b7008b8b9b89867c48629cca1816df1560738a575e26813f43bfbc3c77ba2d89b6a1dc8f0625af8cef3fac11a287
+DIST AdGuardHome-wiki-5657b4b.tar.xz 181172 BLAKE2B 604484e8ecad6a1af61af5b3f5f46a20779951936e55eb51884081c161dd6a97b3a1ec08ad0fec2511ec5173944cacfbe8ca2d4b56c44b375b281671a2280068 SHA512 1a555490b6145a611c456e0443bcd07504c51c2cf1afa20ca74850479762297451c9096a0f0d03aa2f1fe95ae9fa500beb16d4d080d2525c71c987b52f0eb861

diff --git a/net-dns/AdGuardHome/files/AdGuardHome-0.107.57.service b/net-dns/AdGuardHome/files/AdGuardHome-0.107.57.service
new file mode 100644
index 000000000..6627619cb
--- /dev/null
+++ b/net-dns/AdGuardHome/files/AdGuardHome-0.107.57.service
@@ -0,0 +1,24 @@
+# This unit is inspired from
+# `AdGuardHome -s install` on systemd machine and
+# https://aur.archlinux.org/cgit/aur.git/tree/adguardhome.service?h=adguardhome
+
+[Unit]
+Description=Network-wide ads & trackers blocking DNS server with WebUI
+After=network-online.target
+ConditionFileIsExecutable=/usr/bin/AdGuardHome
+
+[Service]
+StartLimitInterval=5
+StartLimitBurst=10
+DynamicUser=true
+StateDirectory=AdGuardHome
+WorkingDirectory=/var/lib/AdGuardHome
+AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_RAW
+ExecStart=/usr/bin/AdGuardHome --no-check-update --work-dir /var/lib/AdGuardHome -s run
+ExecReload=/usr/bin/AdGuardHome -s reload
+StandardOutput=journal
+StandardError=journal
+
+[Install]
+WantedBy=multi-user.target


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-15 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 10:10 [gentoo-commits] repo/proj/guru:master commit in: net-dns/AdGuardHome/, net-dns/AdGuardHome/files/ David Roman
  -- strict thread matches above, loose matches on Subject: below --
2025-03-15 10:36 Haelwenn Monnier
2024-01-01 14:31 Florian Schmaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox