Port ntpclient to -ng
git-svn-id: svn://svn.openwrt.org/openwrt/packages@4485 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
46
net/ntpclient/Makefile
Normal file
46
net/ntpclient/Makefile
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2006 OpenWrt.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=ntpclient
|
||||||
|
PKG_VERSION:=2003_194
|
||||||
|
PKG_RELEASE:=2
|
||||||
|
PKG_MD5SUM:=94e84d5c6023c5e1f3890b28d0a08c92
|
||||||
|
|
||||||
|
PKG_SOURCE_URL:=http://doolittle.faludi.com/ntpclient
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
|
||||||
|
PKG_CAT:=zcat
|
||||||
|
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/ntpclient
|
||||||
|
SECTION:=net
|
||||||
|
CATEGORY:=Network
|
||||||
|
TITLE:=NTP (Network Time Protocol) client
|
||||||
|
DESCRIPTION:=NTP client for setting system time from NTP servers.
|
||||||
|
URL:=http://doolittle.faludi.com/ntpclient
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||||
|
CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" all adjtimex
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/ntpclient/install
|
||||||
|
install -d -m0755 $(1)/etc/hotplug.d/iface
|
||||||
|
install -m0755 ./files/ntpclient.init $(1)/etc/hotplug.d/iface/10-ntpclient
|
||||||
|
install -d -m0755 $(1)/usr/sbin
|
||||||
|
install -m0755 $(PKG_BUILD_DIR)/ntpclient $(1)/usr/sbin/
|
||||||
|
install -m0755 $(PKG_BUILD_DIR)/adjtimex $(1)/usr/sbin/
|
||||||
|
install -m0755 $(PKG_BUILD_DIR)/rate.awk $(1)/usr/sbin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,ntpclient))
|
11
net/ntpclient/files/ntpclient.init
Normal file
11
net/ntpclient/files/ntpclient.init
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
ntp_server=$(nvram get ntp_server)
|
||||||
|
case "${ACTION:-ifup}" in
|
||||||
|
ifup)
|
||||||
|
ps x | grep 'bin/[n]tpclient' >&- || {
|
||||||
|
route -n 2>&- | grep '^0.0.0.0' >&- && /usr/sbin/ntpclient -c 1 -s -h ${ntp_server:-pool.ntp.org} &
|
||||||
|
}
|
||||||
|
;;
|
||||||
|
ifdown)
|
||||||
|
route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&- ;;
|
||||||
|
esac
|
Reference in New Issue
Block a user