diff options
author | pappy | 2019-01-06 03:40:31 +0200 |
---|---|---|
committer | pappy | 2019-01-06 03:40:31 +0200 |
commit | dae7fd4bc5a008789e9171e4eebe7202e38f360a (patch) | |
tree | ee4ff4c01e9cc361229c036fa53da4d1d941768b | |
download | aur-dae7fd4bc5a008789e9171e4eebe7202e38f360a.tar.gz |
initial import
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | PKGBUILD | 67 | ||||
-rw-r--r-- | rbldnsd.install | 19 | ||||
-rw-r--r-- | rbldnsd.ip4set | 2 | ||||
-rw-r--r-- | rbldnsd.opts | 27 | ||||
-rw-r--r-- | rbldnsd.service | 13 | ||||
-rw-r--r-- | rbldnsd.sh | 19 | ||||
-rw-r--r-- | rbldnsd.sysusers | 1 | ||||
-rw-r--r-- | rbldnsd.tmpfiles | 2 |
10 files changed, 185 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cc7e37eb898c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = rbldnsd-git + pkgdesc = Small Daemon for DNSBLs + pkgver = 0 + pkgrel = 1 + url = https://rbldnsd.io + arch = x86_64 + license = GPL + provides = rbldnsd + conflicts = rbldnsd + source = rbldnsd-git::git+https://github.com/spamhaus/rbldnsd.git + source = rbldnsd.sh + source = rbldnsd.sysusers + source = rbldnsd.tmpfiles + source = rbldnsd.service + source = rbldnsd.opts + source = rbldnsd.ip4set + sha256sums = SKIP + sha256sums = 312a7b6ad2f873b3ff4256810cd03288805236cde853316beff28e9883b766cd + sha256sums = 8e671965d7a80ffab0279f4b08a751d596ade0b02abdb8b860e39aabfb677734 + sha256sums = 19a540e4619334fd8c6604adc3337f51c95089f87f64ebb5c2b0760dc571ea49 + sha256sums = f17616ba4220550f933578371b9a11018ec993879fb2813215a65de84c3dce1f + sha256sums = 40cac6754bd2e7e40a60a824bfe0501ebbb52f8e81a185199b94773a186506fe + sha256sums = 80e32fa4746acf8f3d00f735eef4c1584979ac59e899bee22f6e07a9b2ba9b06 + +pkgname = rbldnsd-git + install = rbldnsd.install + backup = etc/conf.d/rbldnsd + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..deb4787c7b7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +src/ +pkg/ +*.war +*.tar.xz +*.tar.gz +*.log +*-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..68aec410b4e1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,67 @@ +# Maintainer: pappy <pappy _AT_ a s c e l i o n _DOT_ com> + +_pkgname=rbldnsd +pkgname=$_pkgname-git +pkgver=0 +pkgrel=1 +pkgdesc="Small Daemon for DNSBLs" +arch=(x86_64) +url=https://rbldnsd.io +license=(GPL) +provides=($_pkgname) +conflicts=($_pkgname) +source=($_pkgname-git::git+https://github.com/spamhaus/$_pkgname.git + $_pkgname.sh + $_pkgname.sysusers + $_pkgname.tmpfiles + $_pkgname.service + $_pkgname.opts + $_pkgname.ip4set + ) +sha256sums=('SKIP' + '312a7b6ad2f873b3ff4256810cd03288805236cde853316beff28e9883b766cd' + '8e671965d7a80ffab0279f4b08a751d596ade0b02abdb8b860e39aabfb677734' + '19a540e4619334fd8c6604adc3337f51c95089f87f64ebb5c2b0760dc571ea49' + 'f17616ba4220550f933578371b9a11018ec993879fb2813215a65de84c3dce1f' + '40cac6754bd2e7e40a60a824bfe0501ebbb52f8e81a185199b94773a186506fe' + '80e32fa4746acf8f3d00f735eef4c1584979ac59e899bee22f6e07a9b2ba9b06') + +pkgver() { + cd $srcdir/$_pkgname-git + latest=$(git describe --tags $(git rev-list --tags --max-count=1)) + echo -n $latest.$(git rev-list --count HEAD).$(git rev-parse --short HEAD) +} + +prepare() +{ + cd $srcdir/$_pkgname-git + ./configure +} + +build() +{ + cd $srcdir/$_pkgname-git + make +} + +package() +{ + backup=(etc/conf.d/$_pkgname) + install=$_pkgname.install + + pushd $srcdir/$_pkgname-git + install -Dm755 $_pkgname $pkgdir/usr/lib/$_pkgname/$_pkgname + install -Dm644 $_pkgname.8 $pkgdir/usr/share/man/man8/$_pkgname.8 + popd + + install -Dm755 $_pkgname.sh $pkgdir/usr/bin/$_pkgname + install -Dm644 $_pkgname.sysusers $pkgdir/usr/lib/sysusers.d/$_pkgname.conf + install -Dm644 $_pkgname.service $pkgdir/usr/lib/systemd/system/$_pkgname.service + install -Dm644 $_pkgname.tmpfiles $pkgdir/usr/lib/tmpfiles.d/$_pkgname.conf + install -Dm644 $_pkgname.opts $pkgdir/etc/conf.d/$_pkgname + + install -Dm644 $_pkgname.ip4set $pkgdir/usr/lib/$_pkgname/local.txt.ip4set + + gzip -9 $pkgdir/usr/share/man/man8/$_pkgname.8 +} + diff --git a/rbldnsd.install b/rbldnsd.install new file mode 100644 index 000000000000..ed110cd63e05 --- /dev/null +++ b/rbldnsd.install @@ -0,0 +1,19 @@ + +post_install() +{ + echo "" + echo "To start rbldnsd, run: systemctl start rbldnsd" + echo "To enable rbldnsd at boot, run: systemctl enable rbldnsd" + echo "" +} + +post_upgrade() +{ + systemctl daemon-reload +} + +pre_remove() +{ + systemctl disable --now rbldnsd +} + diff --git a/rbldnsd.ip4set b/rbldnsd.ip4set new file mode 100644 index 000000000000..4d91a5b7e2ee --- /dev/null +++ b/rbldnsd.ip4set @@ -0,0 +1,2 @@ +186.50.95.146 +79.101.162.246 diff --git a/rbldnsd.opts b/rbldnsd.opts new file mode 100644 index 000000000000..1b1d4aed058b --- /dev/null +++ b/rbldnsd.opts @@ -0,0 +1,27 @@ +# Specify the IP addresses to which the daemon should bind +# The default port is 53. If you have to specify an other port +# then you will add "/<port>" behind the IP address +BIND=(127.0.0.1/53 127.0.0.1/31453) + +# Set interval between checking for zone file changes to be <seconds>. +# rbldnsd will check zone file’s last modification time every so often, +# and if it detects a change, zone will be automatically reloaded. +# Setting this value to 0 disables automatic zone change detection. +CHECK_TIME=3600 + +# Set default reply time−to−live (TTL) value to be defttl, and set +# constraints for TTL to minttl and maxttl. +# TTL=defttl:minttl:maxttl or TTL=defttl +TTL=3600 + +# The zone name +ZONE=rbl.example.com + +# Synchronizations, make sure rbldnsd is restarted after you modify and sync +# the databases for the first time. +RSYNC[ip4set]="psbl-mirror.surriel.com::psbl/psbl.txt rsync.unsubscore.com::LBBL/ubl_rbldns.txt" + +# Other options +# OPTIONS="$OPTIONS -l query.log" +# OPTIONS="$OPTIONS -s stats.log" + diff --git a/rbldnsd.service b/rbldnsd.service new file mode 100644 index 000000000000..2d7e05e18efb --- /dev/null +++ b/rbldnsd.service @@ -0,0 +1,13 @@ +[Unit] +Description=rbldnsd.service +After=network.target + +[Service] +Type=forking +ExecStart=/usr/bin/rbldnsd +PIDFile=/run/rbldnsd.pid +Restart=on-abort + +[Install] +WantedBy=multi-user.target + diff --git a/rbldnsd.sh b/rbldnsd.sh new file mode 100644 index 000000000000..65408de56ab1 --- /dev/null +++ b/rbldnsd.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +declare -A SYNC +source /etc/conf.d/rbldnsd + +printf -v O_BIND -- ' -b %s' ${BIND[@]} + +OPTIONS="-u rbldnsd:rbldnsd $OPTIONS" +OPTIONS="-p /run/rbldnsd.pid $OPTIONS" +OPTIONS="-t $TTL $OPTIONS" +OPTIONS="-c $CHECK_TIME $OPTIONS" +OPTIONS="-r /var/rbldnsd $OPTIONS" + +cd /var/rbldnsd + +printf -v O_ZONES -- "$ZONE:%s " `find -mindepth 2 -type f | awk -F/ '{printf "%s:%s/%s\n", $2, $2, $3}'` + +exec /usr/lib/rbldnsd/rbldnsd $O_BIND $OPTIONS $O_ZONES + diff --git a/rbldnsd.sysusers b/rbldnsd.sysusers new file mode 100644 index 000000000000..d250e8deb3e4 --- /dev/null +++ b/rbldnsd.sysusers @@ -0,0 +1 @@ +u rbldnsd - - /var/rbldnsd diff --git a/rbldnsd.tmpfiles b/rbldnsd.tmpfiles new file mode 100644 index 000000000000..e23625c34aab --- /dev/null +++ b/rbldnsd.tmpfiles @@ -0,0 +1,2 @@ +d /var/rbldnsd 0750 rbldnsd rbldnsd - +C /var/rbldnsd/ip4set/local.txt 640 root rbldnsd - /usr/lib/rbldnsd/local.txt.ip4set |