Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Herbster0815:HTPC
pi-hole-ftl
pi-hole-ftl.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pi-hole-ftl.spec of Package pi-hole-ftl
# # spec file for package pi-hole-ftl # # Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # This package has used https://build.opensuse.org/package/show/home:alarrosa:branches:home:malcolmlewis:SLES12-SP2-RPI-Extra/pihole as a guide. %define _lto_cflags %{nil} Name: pi-hole-ftl Version: 6.x Release: 1.1 Summary: Network-wide ad blocking via your own Linux hardware License: EUPL-1.1 Group: System/Management Url: https://pi-hole.net/ # https://github.com/pi-hole/FTL Source0: %{name}-%{version}.tar.xz # https://raw.githubusercontent.com/pi-hole/pi-hole/development-v6/advanced/Templates/pihole-FTL.systemd Source1: pihole-ftl.service Source2: pihole-FTL.conf.in Source3: permissions Source4: rpmlintrc Source6: override.conf # https://github.com/pi-hole/pi-hole/blob/development-v6/advanced/Templates/pihole-FTL-poststop.sh Source7: pihole-FTL-prestart.sh # https://github.com/pi-hole/pi-hole/blob/development-v6/advanced/Templates/pihole-FTL-prestart.sh Source8: pihole-FTL-poststop.sh # https://github.com/pi-hole/pi-hole/blob/master/advanced/06-rfc6761.conf Source9: 06-rfc6761.conf Patch1: 001_%{name}_fix_warnings_as_errors.patch Patch2: 002_%{name}_fix_shared_libraries.patch Patch3: 003_%{name}_version.patch BuildRequires: cmake BuildRequires: libnettle-devel >= 3.9 BuildRequires: pkgconfig(libidn2) BuildRequires: libidn2 BuildRequires: pkgconfig(readline) BuildRequires: pkgconfig(history) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(dbus-1) BuildRequires: sqlite3-devel BuildRequires: gmp-devel BuildRequires: mbedtls-devel >= 3.4 BuildRequires: systemd-rpm-macros BuildRequires: xz BuildRequires: vim BuildRequires: libunistring-devel # Does not work: systemctl - command not found :-( BuildRequires: -post-build-checks PreReq: permissions Requires: pi-hole Requires: user(pihole) group(pihole) BuildRoot: %{_tmppath}/%{name}-%{version}-build %systemd_requires %description FTLDNS™ (pihole-FTL) provides an interactive API and also generates statistics for Pi-hole®'s Web interface. * Fast: stats are read directly from memory by coupling our codebase closely with dnsmasq * Versatile: upstream changes to dnsmasq can quickly be merged in without much conflict * Lightweight: runs smoothly with minimal hardware and software requirements such as Raspberry Pi Zero * Interactive: our API can be used to interface with your projects * Insightful: stats normally reserved inside of dnsmasq are made available so you can see what's really happening on your network %prep %setup -q -n %{name}-%{version} # Show correct gcc-Version and arch for pi-hole-ftl in the webgui GCC_VERSION=$(gcc --version | head -n1| awk '{print $4}') sed -i "s|7.5.0|$GCC_VERSION|g" /home/abuild/rpmbuild/SOURCES/003_pi-hole-ftl_version.patch %ifnarch x86_64 ARCH=$(uname -m) sed -i "s/x86_64/$ARCH/g" /home/abuild/rpmbuild/SOURCES/003_pi-hole-ftl_version.patch %endif %patch1 -p1 %patch2 -p1 %patch3 -p1 # Remove comments from pihole-FTL.conf to cause pihole bash script behave properly. sed "/^;/d" %{S:2} > pihole-FTL.conf %build %cmake %cmake_build %install %cmake_install install -D -m 0644 %{S:1} %{buildroot}%{_unitdir}/%{name}.service install -d -m 0775 %{buildroot}%{_datadir}/pi-hole/ install -D -m 0755 %{S:7} %{buildroot}%{_datadir}/pi-hole/ install -D -m 0755 %{S:8} %{buildroot}%{_datadir}/pi-hole/ install -D -m 0644 pihole-FTL.conf %{buildroot}%{_sysconfdir}/pihole/pihole-FTL.conf install -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/permissions.d/%{name} install -d -m 0775 %{buildroot}/var/log/pihole install -d -m 0775 %{buildroot}/%{_sysconfdir}/dnsmasq.d/ install -D -m 0644 %{S:9} %{buildroot}%{_sysconfdir}/dnsmasq.d/ # create tmpfile conf install -d -m 0755 %{buildroot}/%{_tmpfilesdir} echo "d /run/pihole 0750 pihole pihole" > %{buildroot}/%{_tmpfilesdir}/%{name}.conf # SUSE policy wants to have this symlink. install -d -m 0755 %{buildroot}/%{_sbindir} ln -s service %{buildroot}/%{_sbindir}/rc%{name} # Nice-Level install -d -m 0755 %{buildroot}/%{_unitdir}/%{name}.service.d install -m 0644 %{SOURCE6} %{buildroot}/%{_unitdir}/%{name}.service.d %pre %service_add_pre %{name}.service %post %tmpfiles_create %{_tmpfilesdir}/%{name}.conf %service_add_post %{name}.service %set_permissions /usr/bin/pihole-FTL # Systemd-resolved's DNSStubListener and dnsmasq can't share port 53. echo "Testing if systemd-resolved is enabled" if ( grep -E '#?DNSStubListener=yes' /etc/systemd/resolved.conf &> /dev/null ); then # Disable the DNSStubListener to unbind it from port 53 # Note that this breaks dns functionality on host until dnsmasq/ftl are up and running echo "Disabling systemd-resolved DNSStubListener" # Make a backup of the original /etc/systemd/resolved.conf # (This will need to be restored on uninstallation) sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf echo "Restarting systemd-resolved" systemctl reload-or-restart systemd-resolved else echo "Systemd-resolved does not need to be restarted" fi echo "Creating/updating pihole gravity database..." /usr/bin/pihole -g %preun %service_del_preun %{name}.service %postun %service_del_postun %{name}.service %verifyscript %verify_permissions -e /usr/bin/pihole-FTL %files %defattr(-,root,root) %license LICENSE %verify(not user) %attr(0755, root, root) %{_bindir}/pihole-FTL %{_unitdir}/%{name}.service %dir %{_unitdir}/%{name}.service.d %{_unitdir}/%{name}.service.d/override.conf %config %attr(0644, pihole, pihole) %{_sysconfdir}/pihole/pihole-FTL.conf %attr(0775, pihole, pihole) %dir /var/log/pihole/ %config %{_sysconfdir}/permissions.d/pi-hole-ftl %{_tmpfilesdir}/%{name}.conf %{_sbindir}/rc%{name} %dir %{_datadir}/pi-hole/ %dir %{_sysconfdir}/dnsmasq.d %{_datadir}/pi-hole/pihole-FTL-prestart.sh %{_datadir}/pi-hole/pihole-FTL-poststop.sh %config %{_sysconfdir}/dnsmasq.d/06-rfc6761.conf %ghost /run/pihole %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor