From: agb Date: Tue, 22 Apr 2008 23:33:04 +0000 (+0000) Subject: [packages] copy/modify openntpd's postinst code for ntpd, ntpdate and ntp-utils X-Git-Url: http://git.archive.openwrt.org/?a=commitdiff_plain;h=dac516c143d7eeeb7c7d6d119274ffc4ebe7b121;p=packages.git [packages] copy/modify openntpd's postinst code for ntpd, ntpdate and ntp-utils git-svn-id: svn://svn.openwrt.org/openwrt/packages@10919 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/net/ntpd/Makefile b/net/ntpd/Makefile index 3f693ff76..910d12f5d 100644 --- a/net/ntpd/Makefile +++ b/net/ntpd/Makefile @@ -37,7 +37,6 @@ endef define Package/ntpd $(call Package/ntpd/Default) - DEPENDS:=+ntpdate TITLE+= server endef @@ -71,10 +70,24 @@ define Package/ntpd/conffiles /etc/ntp.conf endef -define Package/ntpd/postinst +define Package/ntpd/Default/postinst #!/bin/sh -echo "ntp 123/udp # Network Time Protocol -ntp 123/tcp # Network Time Protocol" >> $${IPKG_INSTROOT}/etc/services +grep -q '^ntp[[:space:]]*123/udp' $${IPKG_INSTROOT}/etc/services 2>/dev/null +[ $$? -ne 0 ] && echo "ntp 123/udp # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0 +grep -q '^ntp[[:space:]]*123/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null +[ $$? -ne 0 ] && echo "ntp 123/tcp # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0 +endef + +define Package/ntpdate/postinst + $(call Package/ntpd/Default/postinst) +endef + +define Package/ntpd/postinst + $(call Package/ntpd/Default/postinst) +endef + +define Package/ntp-utils/postinst + $(call Package/ntpd/Default/postinst) endef TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libelf