2021-07-24 10:00:43 +00:00
|
|
|
# Maintainer: George Rawlinson <george@rawlinson.net.nz>
|
2023-08-26 08:51:09 +00:00
|
|
|
|
2021-07-24 10:00:43 +00:00
|
|
|
pkgname=bind-adblock
|
2023-08-26 08:51:09 +00:00
|
|
|
pkgver=1
|
2021-07-24 10:00:43 +00:00
|
|
|
pkgrel=1
|
2023-08-26 08:51:09 +00:00
|
|
|
pkgdesc='Fetch various blocklists and generate a BIND RPZ zonefile'
|
2021-07-24 10:00:43 +00:00
|
|
|
arch=('any')
|
2023-08-26 08:51:09 +00:00
|
|
|
url='https://github.com/Trellmor/bind-adblock'
|
2021-07-24 10:00:43 +00:00
|
|
|
license=('MIT')
|
2023-08-26 08:51:09 +00:00
|
|
|
depends=('bind')
|
|
|
|
makedepends=(
|
|
|
|
'git'
|
|
|
|
'python-requests'
|
|
|
|
'python-dnspython'
|
|
|
|
'python-yaml'
|
|
|
|
'python-validators'
|
|
|
|
)
|
2021-07-24 10:00:43 +00:00
|
|
|
backup=('var/named/adblock.rpz')
|
2023-08-26 08:51:09 +00:00
|
|
|
install="$pkgname.install"
|
|
|
|
_commit='c621ce83e89dea5d7c1a19d0d802d6406d406ca5'
|
|
|
|
source=("$pkgname::git+$url#commit=$_commit")
|
|
|
|
b2sums=('SKIP')
|
2021-07-24 10:00:43 +00:00
|
|
|
|
|
|
|
pkgver() {
|
2023-08-26 08:51:09 +00:00
|
|
|
date +%y%m%d%H%M
|
2021-07-24 10:00:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_zonefile=adblock.rpz
|
|
|
|
_origin=adblock.rpz
|
|
|
|
|
|
|
|
build() {
|
2023-08-26 08:51:09 +00:00
|
|
|
cd "$pkgname"
|
|
|
|
# instead of packaging the script, build zonefile & update regularly
|
|
|
|
python update-zonefile.py \
|
|
|
|
--no-bind \
|
|
|
|
"$_zonefile-$pkgver" \
|
|
|
|
"$_origin"
|
|
|
|
|
|
|
|
sed -i "1 s/ 1 / ${pkgver} /" "$_zonefile-$pkgver"
|
2021-07-24 10:00:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2023-08-26 08:51:09 +00:00
|
|
|
cd "$pkgname"
|
|
|
|
|
|
|
|
# ensure directory permissions follow upstream (770)
|
|
|
|
install -vdm770 "$pkgdir/var/named"
|
2021-07-24 10:00:43 +00:00
|
|
|
|
2023-08-26 08:51:09 +00:00
|
|
|
# zonefile
|
|
|
|
install -vDm644 "$_zonefile-$pkgver" "$pkgdir/var/named/$_zonefile"
|
2021-07-24 10:00:43 +00:00
|
|
|
|
2023-08-26 08:51:09 +00:00
|
|
|
# license
|
|
|
|
install -vDm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
|
2021-07-24 10:00:43 +00:00
|
|
|
}
|