packages: znc: fix cert linking and add mirror
authorJonas Gorski <jogo@openwrt.org>
Sun, 6 Nov 2011 13:55:56 +0000 (13:55 +0000)
committerJonas Gorski <jogo@openwrt.org>
Sun, 6 Nov 2011 13:55:56 +0000 (13:55 +0000)
Properly (re-)create the link only if there's a file given and don't try to
change the owner of the link target.

Also add the znc release archive as a file mirror to prevent updates from
breaking the build.

SVN-Revision: 28774

net/znc/Makefile
net/znc/files/znc.init

index e6488db2a8f8574df5e45c9b039dba0c9070762b..d9b69583297b10fbcc62f7b706a2a5d0e8e93d43 100644 (file)
@@ -9,10 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=znc
 PKG_VERSION:=0.098
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://znc.in/releases
+PKG_SOURCE_URL:=http://znc.in/releases \
+               http://znc.in/releases/archive
 PKG_MD5SUM:=5667b4acb1f01309d6eded77abac700c
 
 PKG_BUILD_PARALLEL:=1
index be2f3f5a75e9b0faac459db29b67c178cb30bb54..01af217a9e7a317c7221b18c349532d59360f2ed 100644 (file)
@@ -52,7 +52,7 @@ znc_global() {
                config_get serverthrottle "$znc" serverthrottle
                config_get znc_pem_file "$znc" znc_ssl_cert
 
-               [ -z $znc_pem_file -o -f $ZNC_CONFIG_PATH/znc.pem ] || ln -s "$znc_pem_file" $ZNC_CONFIG_PATH/znc.pem
+               [ -z "$znc_pem_file" ] || ln -sf "$znc_pem_file" $ZNC_CONFIG_PATH/znc.pem
 
                [ -z $anoniplimit ] || echo "AnonIPLimit = $anoniplimit" >> $ZNC_CONFIG
                [ -z $maxbuffersize ] || echo "MaxBufferSize = $maxbuffersize" >> $ZNC_CONFIG
@@ -127,7 +127,7 @@ start() {
                config_foreach add_listener listener
                config_foreach add_user user
 
-               chown -R ${RUNAS_USER:-nobody}:${RUNAS_GROUP:-nogroup} /tmp/etc/znc
+               chown -hR ${RUNAS_USER:-nobody}:${RUNAS_GROUP:-nogroup} /tmp/etc/znc
        fi
 
        if [ "$EXTERNAL_CONFIG" -eq 1 -a "$RUNAS_USER"  ]