include $(TOPDIR)/rules.mk
PKG_NAME:=ngircd
-PKG_VERSION:=27
+PKG_VERSION:=28
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://ngircd.barton.de/pub/ngircd
-PKG_HASH:=6897880319dd5e2e73c1c9019613509f88eb5b8daa5821a36fbca3d785c247b8
+PKG_HASH:=b48ba320a931d445ae335c47f88a9406a20f5c71c623bee5f7755d0522d435ee
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_LICENSE:=GPL-2.0
case "$1" in
ngircd|ngircd-nossl)
- # Verify the installed default config passes ngircd's built-in syntax check
- [ -f /etc/ngircd.conf ]
- ngircd --configtest 2>&1 | grep -qi "ok\|using config\|ngircd"
+ BIN=/usr/sbin/ngircd
+ # The daemon, its init script and the default config must be installed.
+ [ -x "$BIN" ] || { echo "FAIL: $BIN not installed"; exit 1; }
+ [ -x /etc/init.d/ngircd ] || { echo "FAIL: init script missing"; exit 1; }
+ [ -f /etc/ngircd.conf ] || { echo "FAIL: /etc/ngircd.conf missing"; exit 1; }
+
+ # The shipped default config must pass ngircd's own validator (exit 0).
+ "$BIN" --configtest >/tmp/ngircd-ct.log 2>&1 || {
+ echo "FAIL: configtest rejected the default config"; cat /tmp/ngircd-ct.log; exit 1; }
+ grep -qi ngircd /tmp/ngircd-ct.log || { echo "FAIL: unexpected configtest output"; exit 1; }
+
+ # configtest must actually read the file it is given: pointing it at a
+ # missing config has to fail, proving the positive check above is real.
+ if "$BIN" --configtest --config /tmp/ngircd-absent.conf >/dev/null 2>&1; then
+ echo "FAIL: configtest accepted a missing config file"; exit 1
+ fi
+
+ echo "ngircd: config validation OK"
;;
*)
exit 0