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)
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/
-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'
--- /dev/null
+#!/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
+++ /dev/null
-#!/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