upgpkg: bind-adblock

This commit is contained in:
George Rawlinson 2023-08-26 20:51:09 +12:00
parent ad0b1d5e25
commit 12d0300a79
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

View file

@ -1,56 +1,53 @@
# Maintainer: George Rawlinson <george@rawlinson.net.nz> # Maintainer: George Rawlinson <george@rawlinson.net.nz>
pkgname=bind-adblock pkgname=bind-adblock
pkgver=2009021459 pkgver=1
pkgrel=1 pkgrel=1
pkgdesc="Fetch various blocklists and generate a BIND RPZ zonefile" pkgdesc='Fetch various blocklists and generate a BIND RPZ zonefile'
arch=('any') arch=('any')
url="https://github.com/Trellmor/bind-adblock" url='https://github.com/Trellmor/bind-adblock'
license=('MIT') license=('MIT')
depends=('bind>=9.8') depends=('bind')
makedepends=(python-requests python-dnspython) makedepends=(
'git'
'python-requests'
'python-dnspython'
'python-yaml'
'python-validators'
)
backup=('var/named/adblock.rpz') backup=('var/named/adblock.rpz')
install=$pkgname.install install="$pkgname.install"
# Commit IDs of latest Git commit _commit='c621ce83e89dea5d7c1a19d0d802d6406d406ca5'
_long=7bc3d5b3cd87eb5af11e1b531842eef550df23a7 source=("$pkgname::git+$url#commit=$_commit")
_short="${_long:0:6}" b2sums=('SKIP')
source=("$_short-update-zonefile.py::https://raw.githubusercontent.com/Trellmor/bind-adblock/$_long/update-zonefile.py"
"$_short-LICENSE::https://raw.githubusercontent.com/Trellmor/bind-adblock/$_long/LICENSE"
"$_short-blocklist.txt::https://raw.githubusercontent.com/Trellmor/bind-adblock/$_long/blocklist.txt")
sha512sums=('a83a727021abae5a2b28843d3111177b2e4ef025db462710012cd642b0c445e449b359a3082bb09c925e9f73ca0535ef739bdd1464783aa433b923aeeb6bd53c'
'19c76446db8f97aece5045aeb0e0303d152522383d1d543bb42fcc37dd8d50013030946293047b115f2c3ee0d238f8b1ec6b6dd1b5327d2ff95dded5edd83787'
'c7a4b2254d9ac5888a7f02649fa97c1f0540bfcd968366f3a64d8a575576d715a05128fc7d8aa6015ec0e1cbf973c1019f9af76b0fb668478efd9806803f2d2f')
pkgver() { pkgver() {
date +%y%m%d%H%M date +%y%m%d%H%M
}
prepare() {
mkdir -p "$pkgname"
cp "$_short-update-zonefile.py" "$pkgname/update-zonefile.py"
cp "$_short-blocklist.txt" "$pkgname/blocklist.txt"
} }
_zonefile=adblock.rpz _zonefile=adblock.rpz
_origin=adblock.rpz _origin=adblock.rpz
build() { build() {
cd "$pkgname" cd "$pkgname"
# instead of packaging the script, build zonefile & update regularly # instead of packaging the script, build zonefile & update regularly
python update-zonefile.py \ python update-zonefile.py \
--no-bind \ --no-bind \
"$_zonefile-$pkgver" \ "$_zonefile-$pkgver" \
"$_origin" "$_origin"
sed -i "1 s/ 1 / ${pkgver} /" "$_zonefile-$pkgver" sed -i "1 s/ 1 / ${pkgver} /" "$_zonefile-$pkgver"
} }
package() { package() {
# ensure directory permissions follow upstream (770) cd "$pkgname"
install -dm770 "$pkgdir/var/named"
# package zonefile # ensure directory permissions follow upstream (770)
install -Dm644 "$srcdir/$pkgname/$_zonefile-$pkgver" "$pkgdir/var/named/$_zonefile" install -vdm770 "$pkgdir/var/named"
# package license # zonefile
install -Dm644 "$srcdir/$_short-LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" install -vDm644 "$_zonefile-$pkgver" "$pkgdir/var/named/$_zonefile"
# license
install -vDm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
} }