[PATCH] ZNC: Update to 0.096, fix build and minor changes.
[PATCH] ZNC: Update to 0.096, fix build and minor changes.
Several small fixes for ZNC:
* Update to current 0.096, include new module
* Fix build to not link modules against libstdc++
* Move root check to after module load, to remove the 30 second pause on start.
* Add the possibility to directly use hashed passwords.
* Make the sample config more verbose for easier adaption.
Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com>


git-svn-id: svn://svn.openwrt.org/openwrt/packages@24548 3c298f89-4303-0410-b956-a3cf2f4a3e73

--- a/net/znc/Makefile
+++ b/net/znc/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=znc
-PKG_VERSION:=0.094
-PKG_RELEASE:=2
+PKG_VERSION:=0.096
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/znc
-PKG_MD5SUM:=db101f7a7756285d824b59e3b33e3ad5
+PKG_MD5SUM:=38eec4f1911a68b4d2fc704170e7cbf6
 
 PKG_BUILD_PARALLEL:=1
 
@@ -45,11 +45,11 @@
 
 
 CONFIGURE_VARS += \
-	CXX="$(STAGING_DIR)/host/bin/g++-uc"
+	CXX="$(STAGING_DIR)/host/bin/g++-uc" \
 	CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
 	CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
 	LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-	LIBS="-luClibc++ -lm -lssl $(LIBGCC_S) -lc"
+	LIBS="-luClibc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
 
 CONFIGURE_ARGS += \
 	--disable-c-ares \
@@ -192,6 +192,9 @@
 $(eval $(call module,block-motd,This module blocks the server's Message of the \
 	Day.,extra/))
 
+$(eval $(call module,clearbufferonmsg,This module keeps the buffer until the \
+	next message from the client.,extra/))
+
 $(eval $(call module,ctcpflood,This module tries to block ctcp floods.,extra/))
 
 $(eval $(call module,fakeonline,This module fakes the online status of \

--- a/net/znc/files/znc.conf
+++ b/net/znc/files/znc.conf
@@ -1,16 +1,24 @@
 config znc
 	# where to listen for connections
 	list listener	'192.168.1.1 1234'
+	# load global modules (You need to install them first):
+	# list module 'fail2ban'
 
 config user 'sampleUser'
+	# Use either a plain text password or use the full sha256#... line.
+	# You can generate one with 'znc -s'.
 	option password 'changeme'
 	option nick 	'sampleUser'
 	option altnick 	'userSample'
 	option ident 	'openwrt'
 	option realname 'John Doe'
+
 	# This adds support for channels in znc configuration:
 	# list channel    '#chan optional_password'
 
-	# list of allowed servers
+	# list of allowed servers:
 	list server 	'chat.freenode.net 6667'
 
+	# load user modules ('<module> [params...]'):
+	# list module 'simple_away -timer 10 disconnected'
+

--- a/net/znc/files/znc.init
+++ b/net/znc/files/znc.init
@@ -67,7 +67,16 @@
 	config_get vhost "$user" vhost
 
 	echo "<User $user>" >> $ZNC_CONFIG
-	echo "	Pass = plain#$password" >> $ZNC_CONFIG
+
+	case "$password" in
+	"md5#"* | "sha256#"* | "plain#"*)
+		echo "  Pass = $password" >> $ZNC_CONFIG
+		;;
+	*)
+		echo "	Pass = plain#$password" >> $ZNC_CONFIG
+		;;
+	esac
+
 	echo "	Nick = $nick" >> $ZNC_CONFIG
 	echo "	AltNick = ${altnick:-$nick"_"}" >> $ZNC_CONFIG
 	echo "	Ident = ${ident:-$nick}" >> $ZNC_CONFIG

comments