mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-22 13:33:32 -04:00
net-dns/AdGuardHome: update to 0.107.78
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
This commit is contained in:
133
net-dns/AdGuardHome/AdGuardHome-0.107.78.ebuild
Normal file
133
net-dns/AdGuardHome/AdGuardHome-0.107.78.ebuild
Normal file
@@ -0,0 +1,133 @@
|
||||
# Copyright 1999-2026 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/"
|
||||
|
||||
SRC_URI="
|
||||
https://github.com/AdguardTeam/${PN}/archive/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/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"
|
||||
|
||||
BDEPEND=">=dev-lang/go-1.26.5"
|
||||
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_prepare() {
|
||||
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="-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.63.service "${PN}".service
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
readme.gentoo_print_elog
|
||||
}
|
||||
@@ -4,3 +4,6 @@ DIST AdGuardHome-0.107.76.tar.gz 2351664 BLAKE2B 5c1f2ca6f10ea1dfea8d9b0b9c79910
|
||||
DIST AdGuardHome-0.107.77-deps.tar.xz 5760516 BLAKE2B 6eec244f628ccf36e0ce58c70254540c8fbe424c650ed0c695b9764b524a537e212fff5e02a6b5948e19235ae5d253a9c4ac1b4362dc44f753e49b83eae9ae08 SHA512 657a74c36ec612a80cf1224a6009f20c0679a98e1cadac7c20fdc502d3160e4b193ebd9dbded06ac94e2511366ce2417340b6845a06509cd201b4229fa5f8a62
|
||||
DIST AdGuardHome-0.107.77-web.tar.gz 2577335 BLAKE2B 03e7138e8b42f74ba89bbe3679caf4c809989b13a5fbb5e1411668bc97ff766b78b1868a435a7981c340c9c7052326709fbba6c3b58e4b66a57606eceaa17cb5 SHA512 c7f981eccd143e79540099772adfc61310dcc897991df936a141aa2f9741d44032e1d0c1a10b87f83df58d7e456ffdca51f4dc705685bc495e34960aaf9ddf0a
|
||||
DIST AdGuardHome-0.107.77.tar.gz 2356736 BLAKE2B 6fbca1f31db556b74255f3fdd4e0bdfc09dae832728bde7bf9d88c54ecee99c5a7b6dbb3e5a563568695fb9223e569fef28a27fda7cec017924707f56148afba SHA512 e2c78393d2e2c76a59504ca7ac9a279ff7d7e8d69f8fa7e377e1435d76d246645539aabb89efebd241f0694a0292f5b4b00547184e3ae29582607e028708c0c5
|
||||
DIST AdGuardHome-0.107.78-deps.tar.xz 6232952 BLAKE2B 606b718a34efa82044aa310a56dcf8557c3fd66cbf18b75e905d5fab5df6ebe18da1643bc29f17d88209a1a95a08fc8d761223493c7eda6f2b12675a3e23f531 SHA512 9d560db7042d0d1b026eccfffd74fb4a7a81f75375dc66aa7724520e4880b6e4fbeb76fe091cd42facee9cfce93fda775b74fd8a8e0efa3bdfe99957b54f0c60
|
||||
DIST AdGuardHome-0.107.78-web.tar.gz 2579132 BLAKE2B f2659d26d083efdbefda4211eabe244aeddba85b11c25e61608f667a36f84f839c0a88efb6f1f1a18688be615a4cbf58a07125dd08e3b0b6ce5eeec4b6ecab86 SHA512 63ba0744064902f12db4c5779b69d2a9da93eb447e958526768917abcf2fca29ba357216643f8d8bb4f265fa340b00f91dbe31a939f446fbf529e55211bbfef0
|
||||
DIST AdGuardHome-0.107.78.tar.gz 2362396 BLAKE2B da0c253e53b1bec9a69b6b502823a4f71336ac25acc6854cf0c9e86c23f8476cc88b88c07762249bc32087d3d72345defce9f2a6fdf112f036d888b0b41d63cd SHA512 d52afe6d25827118c50a02cd3330cce244ba11a6f09fde9a7b51bc19c720c217cadfe8e5794ce4364cac2f1f8978e4319f39e416331cddbf3cba58cf19576b5e
|
||||
|
||||
Reference in New Issue
Block a user