%global web_version 6.5 %global ftl_version 6.6 %global ftl_tag v%{ftl_version} %global core_branch master+rpm %global web_branch master+rpm %global ftl_branch master+rpm %global core_hash d3bbfea9+rpm %global web_hash 7a17e01c+rpm %global ftl_hash 71b6fc62+rpm %global ftl_commit_date 2026-04-03 17:41:59 +0100 %global webroot /var/www/html/admin %global pihole_libexec %{_libexecdir}/pihole Name: pihole Version: 6.4.1 Release: 1%{?dist} Summary: Network-wide ad blocking with Pi-hole FTL, CLI, and web UI License: EUPL-1.2 URL: https://pi-hole.net/ Source0: https://github.com/pi-hole/pi-hole/archive/refs/tags/v%{version}.tar.gz#/core-v%{version}.tar.gz Source1: https://github.com/pi-hole/web/archive/refs/tags/v%{web_version}.tar.gz#/web-v%{web_version}.tar.gz Source2: https://github.com/pi-hole/FTL/archive/refs/tags/v%{ftl_version}.tar.gz#/FTL-v%{ftl_version}.tar.gz Source3: https://ftl.pi-hole.net/macvendor.db Patch0: pihole-rpm.patch Patch1: pihole-rpm-ftl.patch Patch2: pihole-rpm-fhs.patch BuildRequires: cmake BuildRequires: gcc BuildRequires: gmp-devel BuildRequires: libnetfilter_conntrack-devel BuildRequires: make BuildRequires: mbedtls-devel BuildRequires: nettle-devel BuildRequires: nftables-devel BuildRequires: libidn2-devel BuildRequires: libunistring-devel BuildRequires: readline-devel BuildRequires: systemd-rpm-macros BuildRequires: xxd Requires: bash Requires: bash-completion Requires: bind-utils Requires: ca-certificates Requires: cronie Requires: curl Requires: dialog Requires: findutils Requires: gawk Requires: grep Requires: iproute Requires: jq Requires: libcap Requires: logrotate Requires: lshw Requires: procps-ng Requires: psmisc Requires: sudo Requires: systemd Requires: unzip Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Suggests: padd %description Pi-hole is a network-wide DNS sinkhole that blocks unwanted content across devices on your network. This RPM bundles the Pi-hole CLI, the web interface, and the Pi-hole FTL daemon into a single installable package for RPM-based systems. This packaged build is managed through the system package manager. Pi-hole's upstream self-update, repair, checkout, and uninstall flows are disabled. %prep %setup -q -n pi-hole-%{version} tar -xzf %{SOURCE1} tar -xzf %{SOURCE2} %patch -P 0 -p1 %patch -P 1 -p1 %patch -P 2 -p1 %build GIT_BRANCH=%{ftl_branch} \ GIT_HASH=%{ftl_hash} \ GIT_VERSION=%{ftl_tag} \ GIT_DATE='%{ftl_commit_date}' \ GIT_TAG=%{ftl_tag} \ cmake -S FTL-%{ftl_version} -B build-ftl -DCMAKE_BUILD_TYPE=RelWithDebInfo GIT_BRANCH=%{ftl_branch} \ GIT_HASH=%{ftl_hash} \ GIT_VERSION=%{ftl_tag} \ GIT_DATE='%{ftl_commit_date}' \ GIT_TAG=%{ftl_tag} \ cmake --build build-ftl --parallel %{?_smp_build_ncpus} %install rm -rf %{buildroot} install -d %{buildroot}%{pihole_libexec} install -d %{buildroot}%{_sysconfdir}/cron.d install -d %{buildroot}%{_sysconfdir}/pihole/hosts install -d %{buildroot}%{_localstatedir}/log/pihole install -d %{buildroot}%{webroot} install -d %{buildroot}%{_datadir}/pihole install -d %{buildroot}%{_datadir}/pihole/database_migration install -d %{buildroot}%{_licensedir}/%{name} install -D -m 0755 build-ftl/pihole-FTL %{buildroot}%{_bindir}/pihole-FTL install -D -m 0755 pihole %{buildroot}%{_bindir}/pihole install -m 0755 gravity.sh %{buildroot}%{pihole_libexec}/ install -m 0755 advanced/Scripts/*.sh %{buildroot}%{pihole_libexec}/ install -m 0644 advanced/Scripts/COL_TABLE %{buildroot}%{pihole_libexec}/COL_TABLE rm -f %{buildroot}%{pihole_libexec}/piholeCheckout.sh rm -f %{buildroot}%{pihole_libexec}/updatecheck.sh rm -f %{buildroot}%{pihole_libexec}/update.sh install -D -m 0755 advanced/Templates/pihole-FTL-prestart.sh %{buildroot}%{pihole_libexec}/pihole-FTL-prestart.sh install -D -m 0755 advanced/Templates/pihole-FTL-poststop.sh %{buildroot}%{pihole_libexec}/pihole-FTL-poststop.sh install -D -m 0644 advanced/Templates/pihole-FTL.systemd %{buildroot}%{_unitdir}/pihole-FTL.service install -D -m 0644 advanced/Templates/pihole.cron %{buildroot}%{_sysconfdir}/cron.d/pihole install -D -m 0644 advanced/Templates/logrotate %{buildroot}%{_sysconfdir}/pihole/logrotate install -D -m 0644 advanced/Templates/gravity.db.sql %{buildroot}%{_datadir}/pihole/gravity.db.sql install -D -m 0644 advanced/Templates/gravity_copy.sql %{buildroot}%{_datadir}/pihole/gravity_copy.sql install -D -m 0755 advanced/Scripts/database_migration/gravity-db.sh %{buildroot}%{_datadir}/pihole/database_migration/gravity-db.sh cp -a advanced/Scripts/database_migration/gravity %{buildroot}%{_datadir}/pihole/database_migration/ install -D -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/pihole/macvendor.db install -D -m 0644 advanced/bash-completion/pihole.bash %{buildroot}%{_datadir}/bash-completion/completions/pihole install -D -m 0644 advanced/bash-completion/pihole-ftl.bash %{buildroot}%{_datadir}/bash-completion/completions/pihole-FTL install -D -m 0644 manpages/pihole.8 %{buildroot}%{_mandir}/man8/pihole.8 cp -a web-%{web_version}/. %{buildroot}%{webroot}/ rm -rf %{buildroot}%{webroot}/.devcontainer rm -rf %{buildroot}%{webroot}/.github rm -f %{buildroot}%{webroot}/.codespellignore rm -f %{buildroot}%{webroot}/.editorconfig rm -f %{buildroot}%{webroot}/.gitattributes rm -f %{buildroot}%{webroot}/.gitignore rm -f %{buildroot}%{webroot}/CONTRIBUTING.md rm -f %{buildroot}%{webroot}/README.md rm -f %{buildroot}%{webroot}/package.json rm -f %{buildroot}%{webroot}/package-lock.json rm -f %{buildroot}%{webroot}/postcss.config.js rm -f %{buildroot}%{webroot}/xo.config.js install -D -m 0644 LICENSE %{buildroot}%{_licensedir}/%{name}/core-LICENSE install -D -m 0644 web-%{web_version}/LICENSE %{buildroot}%{_licensedir}/%{name}/web-LICENSE install -D -m 0644 FTL-%{ftl_version}/LICENSE %{buildroot}%{_licensedir}/%{name}/ftl-LICENSE install -D -m 0644 /dev/null %{buildroot}%{_sysconfdir}/pihole/hosts/custom.list cat > %{buildroot}%{_sysconfdir}/pihole/versions </dev/null || groupadd -r pihole getent passwd pihole >/dev/null || \ useradd -r -g pihole -d /var/lib/pihole -s /usr/sbin/nologin -c "Pi-hole service account" pihole exit 0 %post mkdir -p %{_sysconfdir}/pihole/hosts %{_localstatedir}/log/pihole || : chown pihole:pihole %{_sysconfdir}/pihole %{_sysconfdir}/pihole/hosts %{_localstatedir}/log/pihole || : chmod 0755 %{_sysconfdir}/pihole %{_sysconfdir}/pihole/hosts %{_localstatedir}/log/pihole || : %systemd_post pihole-FTL.service %preun %systemd_preun pihole-FTL.service %postun %systemd_postun_with_restart pihole-FTL.service %files %license %{_licensedir}/%{name}/core-LICENSE %license %{_licensedir}/%{name}/web-LICENSE %license %{_licensedir}/%{name}/ftl-LICENSE %{_bindir}/pihole %{_bindir}/pihole-FTL %{pihole_libexec} %{_unitdir}/pihole-FTL.service %config %{_sysconfdir}/cron.d/pihole %config %{_sysconfdir}/pihole/logrotate %{_sysconfdir}/pihole/versions %config(noreplace) %{_sysconfdir}/pihole/hosts/custom.list %dir %{_sysconfdir}/pihole %dir %{_sysconfdir}/pihole/hosts %dir %{_localstatedir}/log/pihole %ghost %config(noreplace) %{_sysconfdir}/pihole/dhcp.leases %ghost %config(noreplace) %{_sysconfdir}/pihole/gravity.db %ghost %config(noreplace) %{_sysconfdir}/pihole/pihole-FTL.db %ghost %config(noreplace) %{_sysconfdir}/pihole/pihole.toml %ghost %{_localstatedir}/log/pihole/FTL.log %ghost %{_localstatedir}/log/pihole/pihole.log %ghost %{_localstatedir}/log/pihole/webserver.log %{_datadir}/pihole/gravity.db.sql %{_datadir}/pihole/gravity_copy.sql %{_datadir}/pihole/database_migration %{_datadir}/pihole/macvendor.db %{_datadir}/bash-completion/completions/pihole %{_datadir}/bash-completion/completions/pihole-FTL %{_mandir}/man8/pihole.8* %{webroot} %changelog * Tue Apr 07 2026 Johannes - 6.4.1-1 - Initial RPM packaging for Pi-hole core v6.4.1, web v6.5, and FTL v6.6 - Fixup core to be FHS-compliant - Disable upstream update functions