ntpclient: fix and cleanup
authorOliver Ertl <oliver@ertl-net.net>
Mon, 30 Jul 2007 08:34:04 +0000 (08:34 +0000)
committerOliver Ertl <oliver@ertl-net.net>
Mon, 30 Jul 2007 08:34:04 +0000 (08:34 +0000)
SVN-Revision: 8222

net/ntpclient/Makefile
net/ntpclient/files/ntpclient.config
net/ntpclient/files/ntpclient.hotplug [new file with mode: 0644]
net/ntpclient/files/ntpclient.init [deleted file]

index 56c8a3c07514a5087dab337a8f860e736cbbed35..0e44e828cdde1203a2049e160d46a0f94588a828 100644 (file)
@@ -10,12 +10,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ntpclient
 PKG_VERSION:=2003_194
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://doolittle.icarus.com/ntpclient/
 PKG_MD5SUM:=94e84d5c6023c5e1f3890b28d0a08c92
-PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
@@ -30,15 +29,14 @@ define Package/ntpclient
   URL:=http://doolittle.icarus.com/ntpclient/
 endef
 
-define Build/Compile
-       $(call Build/Compile/Default,all adjtimex)
-endef
+MAKE_FLAGS += \
+       all adjtimex
 
 define Package/ntpclient/install       
        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
-       $(INSTALL_BIN) ./files/ntpclient.init $(1)/etc/hotplug.d/iface/20-ntpclient
+       $(INSTALL_DATA) ./files/ntpclient.hotplug $(1)/etc/hotplug.d/iface/20-ntpclient
        $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_DATA) ./files/ntpclient.config $(1)/etc/config/ntp_client
+       $(INSTALL_CONF) ./files/ntpclient.config $(1)/etc/config/ntpclient
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpclient $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/adjtimex $(1)/usr/sbin/
index 5be82ca168b5da7ffbe64d92bbe8b6d093c55386..8e2717d6e1744404fd31b4cf9d643c67702df30f 100644 (file)
@@ -1,9 +1,9 @@
-config ntp_client
+config ntpclient
        option hostname 'pool.ntp.org'
        option port     '123'
        option count    '1'
 
-config ntp_client
+config ntpclient
        option hostname 'ntp.ubuntu.com'
        option port     '123'
        option count    '1'
diff --git a/net/ntpclient/files/ntpclient.hotplug b/net/ntpclient/files/ntpclient.hotplug
new file mode 100644 (file)
index 0000000..a3ce8b8
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+
+. /etc/functions.sh
+
+DONE=0
+config_cb() {
+       local cfg="$CONFIG_SECTION"
+       local cfgtype
+       config_get cfgtype "$cfg" TYPE
+
+       case "$cfgtype" in
+               ntpclient)
+                       config_get hostname     $cfg hostname
+                       config_get port         $cfg port
+                       config_get count        $cfg count                      
+
+                       [ "$DONE" = "1" ] && exit 0
+                       ps x | grep 'bin/[n]tpclient' >&- || {
+                               route -n 2>&- | grep '^0.0.0.0' >&- && {
+                                       /usr/sbin/ntpclient -c ${count:-1} -s -h $hostname -p ${port:-123} 2>&- >&- && DONE=1
+                               }
+                       }
+               ;;
+       esac
+}
+case "${ACTION:-ifup}" in
+       ifup)
+               config_load ntpclient&
+       ;;
+       ifdown)
+               route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&-
+       ;;
+esac
diff --git a/net/ntpclient/files/ntpclient.init b/net/ntpclient/files/ntpclient.init
deleted file mode 100644 (file)
index 306c281..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2006 OpenWrt.org
-
-. /etc/functions.sh
-
-DONE=0
-config_cb() {
-       local cfg="$CONFIG_SECTION"
-       local cfgtype
-       config_get cfgtype "$cfg" TYPE
-
-       case "$cfgtype" in
-               ntp_client)
-                       config_get hostname     $cfg hostname
-                       config_get port         $cfg port
-                       config_get count        $cfg count                      
-
-                       [ "$DONE" = "1" ] && exit 0
-                       ps x | grep 'bin/[n]tpclient' >&- || {
-                               route -n 2>&- | grep '^0.0.0.0' >&- && {
-                                       /usr/sbin/ntpclient -c ${count:-1} -s -h $hostname -p ${port:-123} 2>&- >&- && DONE=1
-                               }
-                       }
-               ;;
-       esac
-}
-case "${ACTION:-ifup}" in
-       ifup)
-               config_load ntp_client&
-       ;;
-       ifdown)
-               route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&-
-       ;;
-esac