# Contributor: Mettacrawer # Contributor: luizribeiro # Contributor: max.bra # Contributor: graysky # Maintainer: Piotr Zarycki pkgname=pi-hole-ftl _pkgname=FTL _servicename=pihole-FTL pkgver=6.7 pkgrel=1 # Upstream release metadata. # Update _commit and _commit_date with each upstream version bump. _commit='fa65a88f8cdef1013594d4de14108077954faea4' _commit_date='2026-07-06 21:07:11 +0100' arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64') pkgdesc="The Pi-hole FTL engine" url="https://github.com/pi-hole/FTL" license=('EUPL-1.2') depends=('nettle' 'gmp' 'mbedtls3' 'pi-hole-web') makedepends=('cmake' 'xxd') conflicts=('dnsmasq') provides=('dnsmasq') install=$pkgname.install backup=( 'etc/pihole/pihole-FTL.conf' 'etc/pihole/dhcp.leases' ) source=( "$pkgname-v$pkgver.tar.gz::https://github.com/pi-hole/FTL/archive/v$pkgver.tar.gz" "$pkgname.tmpfile" "$pkgname.sysuser" "$pkgname.service" "nettle4_base64_decode_update.patch" ) sha256sums=( 'SKIP' '0feb4597a4afd9054553505d305b0feb7e1f6e1705b092561648ff37d0a2893c' 'dd1d2a341e774d4e549373ae75604031b9af0ee44debcd71a89259d9110d2a77' '0998da040d038ddbad129ba8e1ea74741bc912813407b579cab1b3b3f206e721' '998cb258704aeecd9a73aa566673b451be72c73be327987b14e0ffa7c9570dc6' ) prepare() { cd "$srcdir/$_pkgname-$pkgver" # Nettle 4.0 API change: # base64_decode_update() now treats dst_length as input/output. patch -Np1 -i "$srcdir/nettle4_base64_decode_update.patch" # GCC 16: sanitize_dns_hosts() increments this counter but never reads it. # Scope the workaround to this function only since other validator loops use i. sed -i \ '/^void sanitize_dns_hosts(/,/^}/ s/int i = 0;/int i __attribute__((unused)) = 0;/' \ src/config/validator.c # Arch's parallel-installable mbedTLS 3 compatibility package uses the # pre-mbedTLS-4 certificate/key parsing APIs. sed -i \ 's/mbedtls_x509write_crt_pem(\([^,]*\), \([^,]*\), sizeof(\([^)]*\)))/mbedtls_x509write_crt_pem(\1, \2, sizeof(\3), NULL, NULL)/g' \ src/webserver/x509.c sed -i \ 's/mbedtls_pk_parse_keyfile(\([^,]*\), \([^,]*\), NULL);/mbedtls_pk_parse_keyfile(\1, \2, NULL, NULL, NULL);/g' \ src/webserver/x509.c } build() { cd "$srcdir/$_pkgname-$pkgver" # mbedtls3 is installed in a parallel include tree. # Treat its headers as system headers so FTL's -Werror policy does not turn # warnings originating in mbedTLS headers into build failures with GCC 16. CFLAGS+=" -isystem /usr/include/mbedtls3" # GitHub source archives contain no .git directory. Without these variables, # FTL's version generator can walk up into makepkg's/AUR's Git checkout and # embed unrelated package-repository metadata (e.g. vDev-...-dirty). # # gen_version.cmake explicitly supports these environment overrides. export GIT_BRANCH='master' export GIT_HASH="${_commit:0:8}" export GIT_VERSION="v$pkgver" export GIT_DATE="$_commit_date" export GIT_TAG="v$pkgver" STATIC=false ./build.sh \ "-DLIBMBEDTLS=/usr/lib/mbedtls3/libmbedtls.so \ -DLIBMBEDX509=/usr/lib/mbedtls3/libmbedx509.so \ -DLIBMBEDCRYPTO=/usr/lib/mbedtls3/libmbedcrypto.so" } package() { cd "$srcdir" install -Dm775 \ "$_pkgname-$pkgver/pihole-FTL" \ "$pkgdir/usr/bin/pihole-FTL" install -Dm644 \ "$pkgname.tmpfile" \ "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" install -Dm644 \ "$pkgname.sysuser" \ "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" install -dm755 "$pkgdir/etc/pihole" install -Dm664 /dev/null "$pkgdir/etc/pihole/dhcp.leases" install -Dm644 \ "$pkgname.service" \ "$pkgdir/usr/lib/systemd/system/$_servicename.service" install -dm755 \ "$pkgdir/usr/lib/systemd/system/multi-user.target.wants" ln -s \ "../$_servicename.service" \ "$pkgdir/usr/lib/systemd/system/multi-user.target.wants/$_servicename.service" install -dm755 "$pkgdir/usr/share/licenses/pihole" install -Dm644 \ "$_pkgname-$pkgver/LICENSE" \ "$pkgdir/usr/share/licenses/pihole/Pi-hole-FTL" # Pi-hole 5.0+ dnsmasq drop-in support ln -s ./pihole-FTL "$pkgdir/usr/bin/dnsmasq" }