Add pi-hole
This commit is contained in:
71
src/pi-hole-ftl/PKGBUILD
Normal file
71
src/pi-hole-ftl/PKGBUILD
Normal file
@@ -0,0 +1,71 @@
|
||||
# Maintainer: max.bra <max dot bra dot gtalk at gmail dot com>
|
||||
|
||||
pkgname=pi-hole-ftl
|
||||
_pkgname=FTL
|
||||
pkgver=3.0
|
||||
pkgrel=2
|
||||
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
|
||||
pkgdesc="The Pi-hole FTL engine"
|
||||
url="https://github.com/pi-hole/FTL"
|
||||
license=('EUPL-1.1')
|
||||
depends=()
|
||||
makedepends=('sqlite')
|
||||
install=$pkgname.install
|
||||
backup=('etc/pihole/pihole-FTL.conf')
|
||||
source=("https://github.com/pi-hole/FTL/archive/v$pkgver.tar.gz"
|
||||
"$pkgname.tmpfile"
|
||||
"$pkgname.service"
|
||||
"$pkgname.conf"
|
||||
"$pkgname.sysuser"
|
||||
)
|
||||
md5sums=('45fd33e4498b2ab9403d96e1251abb8c'
|
||||
'ca844c23699ba64777571253bc7ccb21'
|
||||
'0f65203b2585fb83e02826091d220386'
|
||||
'2d6ae93eea48a09ce5bc5bf62e081dd4'
|
||||
'68e78907dc2a0c89421d02377e76d353')
|
||||
|
||||
prepare() {
|
||||
_ssc="/tmp/sedcontrol"
|
||||
|
||||
cd "$srcdir"/"$_pkgname"-"$pkgver"
|
||||
|
||||
# git descriptions setup
|
||||
sed -i "s|^GIT_BRANCH := .*$|GIT_BRANCH := master|w $_ssc" "$srcdir"/$_pkgname-$pkgver/Makefile
|
||||
if [ -s $_ssc ] ; then rm $_ssc ; else echo " ==> Sed error: git descriptions setup 1" && return 1 ; fi
|
||||
sed -i "s|^GIT_VERSION := .*$|GIT_VERSION := v$pkgver|w $_ssc" "$srcdir"/$_pkgname-$pkgver/Makefile
|
||||
if [ -s $_ssc ] ; then rm $_ssc ; else echo " ==> Sed error: git descriptions setup 2" && return 1 ; fi
|
||||
sed -i "s|^GIT_DATE := .*$|GIT_DATE := $(date -I)|w $_ssc" "$srcdir"/$_pkgname-$pkgver/Makefile
|
||||
if [ -s $_ssc ] ; then rm $_ssc ; else echo " ==> Sed error: git descriptions setup 3" && return 1 ; fi
|
||||
sed -i "s|^GIT_TAG := .*$|GIT_TAG := v$pkgver|w $_ssc" "$srcdir"/$_pkgname-$pkgver/Makefile
|
||||
if [ -s $_ssc ] ; then rm $_ssc ; else echo " ==> Sed error: git descriptions setup 4" && return 1 ; fi
|
||||
|
||||
# setting up logs paths
|
||||
sed -i "s|/var/log/pihole-FTL.log|/run/log/pihole-ftl/pihole-FTL.log|w $_ssc" "$srcdir"/$_pkgname-$pkgver/memory.c
|
||||
if [ -s $_ssc ] ; then rm $_ssc ; else echo " ==> Sed error: setting up logs paths 1" && return 1 ; fi
|
||||
sed -i "s|/var/run/pihole-FTL|/run/pihole-ftl/pihole-FTL|w $_ssc" "$srcdir"/$_pkgname-$pkgver/memory.c
|
||||
if [ -s $_ssc ] ; then rm $_ssc ; else echo " ==> Sed error: setting up logs paths 2" && return 1 ; fi
|
||||
sed -i "s|/var/log/pihole.log|/run/log/pihole/pihole.log|w $_ssc" "$srcdir"/$_pkgname-$pkgver/memory.c
|
||||
if [ -s $_ssc ] ; then rm $_ssc ; else echo " ==> Sed error: setting up logs paths 3" && return 1 ; fi
|
||||
sed -i "s|/var/run/pihole/|/run/pihole-ftl/|w $_ssc" "$srcdir"/$_pkgname-$pkgver/memory.c
|
||||
if [ -s $_ssc ] ; then rm $_ssc ; else echo " ==> Sed error: setting up logs paths 4" && return 1 ; fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd $_pkgname-$pkgver
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir"
|
||||
install -Dm755 "$_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 -Dm644 "$pkgname.conf" "$pkgdir"/etc/pihole/pihole-FTL.conf
|
||||
|
||||
install -Dm644 "$pkgname.service" "$pkgdir"/usr/lib/systemd/system/$pkgname.service
|
||||
install -dm755 "$pkgdir/usr/lib/systemd/system/multi-user.target.wants"
|
||||
ln -s ../$pkgname.service "$pkgdir/usr/lib/systemd/system/multi-user.target.wants/$pkgname.service"
|
||||
}
|
||||
9
src/pi-hole-ftl/pi-hole-ftl.conf
Normal file
9
src/pi-hole-ftl/pi-hole-ftl.conf
Normal file
@@ -0,0 +1,9 @@
|
||||
SOCKET_LISTENING=localonly
|
||||
TIMEFRAME=rolling24h
|
||||
QUERY_DISPLAY=yes
|
||||
AAAA_QUERY_ANALYSIS=yes
|
||||
MAXDBDAYS=365
|
||||
RESOLVE_IPV6=yes
|
||||
RESOLVE_IPV4=yes
|
||||
DBINTERVAL=1.0
|
||||
DBFILE=/etc/pihole/pihole-FTL.db
|
||||
12
src/pi-hole-ftl/pi-hole-ftl.install
Normal file
12
src/pi-hole-ftl/pi-hole-ftl.install
Normal file
@@ -0,0 +1,12 @@
|
||||
post_install() {
|
||||
echo -e "\e[1;33m==>\e[0m Possible configurations in \e[1;31m/etc/pihole/pihole-FTL.conf\e[0m file"
|
||||
echo -e "\e[1;33m==>\e[0m Please read the instructions on the project page: \e[1;36mhttps://github.com/pi-hole/FTL#ftls-config-file\e[0m"
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install $1
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
userdel -f pihole
|
||||
}
|
||||
12
src/pi-hole-ftl/pi-hole-ftl.service
Normal file
12
src/pi-hole-ftl/pi-hole-ftl.service
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Pi-hole FTL engine
|
||||
|
||||
[Service]
|
||||
User=pihole
|
||||
Group=pihole
|
||||
PIDFile=/run/pihole-ftl/pihole-FTL.pid
|
||||
ExecStart=/usr/bin/pihole-FTL no-daemon
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
1
src/pi-hole-ftl/pi-hole-ftl.sysuser
Normal file
1
src/pi-hole-ftl/pi-hole-ftl.sysuser
Normal file
@@ -0,0 +1 @@
|
||||
u pihole - "pihole daemon" /
|
||||
5
src/pi-hole-ftl/pi-hole-ftl.tmpfile
Normal file
5
src/pi-hole-ftl/pi-hole-ftl.tmpfile
Normal file
@@ -0,0 +1,5 @@
|
||||
d /run/log/pihole-ftl 0755 pihole pihole - -
|
||||
f /run/log/pihole-ftl/pihole-FTL.log 0644 pihole pihole - -
|
||||
d /run/pihole-ftl 0755 pihole pihole - -
|
||||
f /run/pihole-ftl/pihole-FTL.pid 0644 pihole pihole - -
|
||||
f /run/pihole-ftl/pihole-FTL.port 0644 pihole pihole - -
|
||||
Reference in New Issue
Block a user