[packages] ntpd: update to v4.2.4p7
[openwrt/svn-archive/archive.git] / net / ntpd / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ntp
11 PKG_VERSION:=4.2.4p7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
16 PKG_MD5SUM:=8c19ff62ed4f7d64f8e2aa59cb11f364
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_BUILD_DEPENDS:=libelf
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/ntpd/Default
24 SUBMENU:=Time Synchronization
25 SECTION:=net
26 CATEGORY:=Network
27 TITLE:=ISC ntp
28 URL:=http://www.ntp.org/
29 endef
30
31 define Package/ntpd/Default/description
32 The ISC ntp suite is a collection of tools used to synchronize
33 the system clock with remote NTP time servers and run/montior
34 local NTP servers.
35 endef
36
37 define Package/ntpd
38 $(call Package/ntpd/Default)
39 TITLE+= server
40 endef
41
42 define Package/ntpd/description
43 $(call Package/ntpd/Default/description)
44 This package contains the ntpd server.
45 endef
46
47 define Package/ntpdate
48 $(call Package/ntpd/Default)
49 TITLE+=date
50 endef
51
52 define Package/ntpdate/description
53 $(call Package/ntpd/Default/description)
54 This package contains ntpdate.
55 endef
56
57 define Package/ntp-utils
58 $(call Package/ntpd/Default)
59 DEPENDS:=+libncurses
60 TITLE+= utilities
61 endef
62
63 define Package/ntp-utils/description
64 $(call Package/ntpd/Default/description)
65 This package contains ntpdc and ntpq.
66 endef
67
68 define Package/ntpd/conffiles
69 /etc/ntp.conf
70 endef
71
72 define Package/ntpd/Default/postinst
73 #!/bin/sh
74 grep -q '^ntp[[:space:]]*123/udp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
75 [ $$? -ne 0 ] && echo "ntp 123/udp # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
76 grep -q '^ntp[[:space:]]*123/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
77 [ $$? -ne 0 ] && echo "ntp 123/tcp # Network Time Protocol" >>$${IPKG_INSTROOT}/etc/services || exit 0
78 endef
79
80 define Package/ntpdate/postinst
81 $(call Package/ntpd/Default/postinst)
82 endef
83
84 define Package/ntpd/postinst
85 $(call Package/ntpd/Default/postinst)
86 endef
87
88 define Package/ntp-utils/postinst
89 $(call Package/ntpd/Default/postinst)
90 endef
91
92 TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libelf
93
94 define Build/Configure
95 $(call Build/Configure/Default, \
96 --disable-all-clocks \
97 --disable-parse-clocks \
98 --enable-NMEA \
99 --enable-LOCAL-CLOCK \
100 --enable-SHM \
101 --disable-linuxcaps, \
102 ac_cv_lib_rt_sched_setscheduler=no \
103 )
104 endef
105
106 define Build/Compile
107 $(MAKE) -C $(PKG_BUILD_DIR) \
108 CFLAGS="$(TARGET_CFLAGS)"
109 endef
110
111 define Package/ntpd/install
112 $(INSTALL_DIR) $(1)/usr/sbin/
113 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/usr/sbin/
114 $(INSTALL_DIR) $(1)/etc
115 $(INSTALL_DATA) ./files/ntp.conf $(1)/etc/
116 $(INSTALL_DIR) $(1)/etc/init.d
117 $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
118 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
119 $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
120 endef
121
122 define Package/ntpdate/install
123 $(INSTALL_DIR) $(1)/usr/sbin/
124 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdate/ntpdate $(1)/usr/sbin/
125 $(INSTALL_DIR) $(1)/etc/init.d
126 $(INSTALL_BIN) ./files/ntpdate.init $(1)/etc/init.d/ntpdate
127 endef
128
129 define Package/ntp-utils/install
130 $(INSTALL_DIR) $(1)/usr/sbin/
131 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
132 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
133 endef
134
135 $(eval $(call BuildPackage,ntpd))
136 $(eval $(call BuildPackage,ntpdate))
137 $(eval $(call BuildPackage,ntp-utils))