mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-04-07 03:10:15 -04:00
net-dns/AdGuardHome: update to 0.107.63
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
This commit is contained in:
141
net-dns/AdGuardHome/AdGuardHome-0.107.63.ebuild
Normal file
141
net-dns/AdGuardHome/AdGuardHome-0.107.63.ebuild
Normal file
@@ -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="ad09f2b"
|
||||
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/${PN}-0.107.57/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.63.service "${PN}".service
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
readme.gentoo_print_elog
|
||||
}
|
||||
@@ -7,5 +7,8 @@ DIST AdGuardHome-0.107.60.tar.gz 2266231 BLAKE2B 325c0456bc934a5aac9fce3a272efa3
|
||||
DIST AdGuardHome-0.107.61-deps.tar.xz 5241764 BLAKE2B c0ef0f4cfaac1f69cecd702bb7805ca47be478ef39c898222e21586fff82275c205df1081f91c9f683881f853cda1b291cd88faea2a4306e785a4deb0929e1bb SHA512 7fdf45758477a785084fa4277cace32a9103e510c94f7565fc59b14035cc798fe53373f913cdffe6c13cc8a5c51da78fc812fc1a4e62329025011ba3f17e4e76
|
||||
DIST AdGuardHome-0.107.61-web.tar.gz 2460494 BLAKE2B 29627c3397bbe600a5611f6b011968a9d474a3d45ad337d6eaff252a1c5f9df422c5c69e765a1b4d08782fc12135a74e9ae63e869ab0c2777ae34a528d388c63 SHA512 f9df85f9b7661e7ac7c7d3860a746bed33aa329c183ffb2f3836ebe6e418be2fac378bc742fd8bd9361dbfc91d9a561af5e140189e62c650f104666bfecc0f4a
|
||||
DIST AdGuardHome-0.107.61.tar.gz 2269745 BLAKE2B 79f6d4e1b57a803a42f9a7d4abe5fc7d13ef6f736c75d523489ecffcc58ca8868e3f2c4a3564351f74cfdaa3e0e67e0bd4a8c87fa568cae1895790bf5ea84866 SHA512 6f99aa776190ef93226606c37977f1778cd92cd3e851406be7a0bf597df692d7106e91448550760ca2b3ec9152ec902c17deea2506e00e3a7623a11bcbab025c
|
||||
DIST AdGuardHome-0.107.63-deps.tar.xz 5310180 BLAKE2B e574095b1279afa7b1a9274df358d28d630da8daca09801f61d5a808be0e12748dfd9354bfdc370c1d65e6753dc99cfe300552daacae2454c43abf28dc1f4295 SHA512 c1726eb2e03fe03afc23b300c9ad5bbe97067215313a8d12fdc76712e49baddd2d189fb3ce5a19e0ed0bf27284b05fb0aa15ce83a048946a371c9169c5a6029d
|
||||
DIST AdGuardHome-0.107.63-web.tar.gz 2554041 BLAKE2B 4eb67d1ca79e99923cff5706765b8db1f84dcd980e298b7f1cb84e84197954793a4f1296d446048d3c4af152d9aefd2c11e2aa40e70684514eaffd24b3f70b5f SHA512 0350c38aa1700b9b4657ba7b041bd63eb3fe5f6abfa73adb344006b552656ccadc742c528e54d188211e7310e23d39c224df9c775885134d655c576fe9e5ba80
|
||||
DIST AdGuardHome-0.107.63.tar.gz 2319402 BLAKE2B 5cd3b86080cb9c467f6f1a77992786b66b088b21923022d309493ee0c22bdcf0f4a4e44ccb7ca3fac96b0416576cbd301773fe897b6b5af29b0c5cf5ac98829d SHA512 c1e3b074ebf1b1a842858c609e483a9b2b11124f4a3f588296691a697873bdc1fffd2b5155e9a4ab14947b04f526a8ae6c4362c6d7de0f9be415cf41c0670fb0
|
||||
DIST AdGuardHome-wiki-5657b4b.tar.xz 181172 BLAKE2B 604484e8ecad6a1af61af5b3f5f46a20779951936e55eb51884081c161dd6a97b3a1ec08ad0fec2511ec5173944cacfbe8ca2d4b56c44b375b281671a2280068 SHA512 1a555490b6145a611c456e0443bcd07504c51c2cf1afa20ca74850479762297451c9096a0f0d03aa2f1fe95ae9fa500beb16d4d080d2525c71c987b52f0eb861
|
||||
DIST AdGuardHome-wiki-ad09f2b.tar.xz 181172 BLAKE2B 604484e8ecad6a1af61af5b3f5f46a20779951936e55eb51884081c161dd6a97b3a1ec08ad0fec2511ec5173944cacfbe8ca2d4b56c44b375b281671a2280068 SHA512 1a555490b6145a611c456e0443bcd07504c51c2cf1afa20ca74850479762297451c9096a0f0d03aa2f1fe95ae9fa500beb16d4d080d2525c71c987b52f0eb861
|
||||
|
||||
26
net-dns/AdGuardHome/files/AdGuardHome-0.107.63.service
Normal file
26
net-dns/AdGuardHome/files/AdGuardHome-0.107.63.service
Normal file
@@ -0,0 +1,26 @@
|
||||
# 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=syslog.target 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 -v
|
||||
ExecReload=/usr/bin/AdGuardHome -s reload
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user