2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
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
:=4d64a99592b818aa9419fc9dcb149746
18 PKG_BUILD_DEPENDS
:=libelf
20 PKG_LIBTOOL_PATHS
:=. sntp
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/ntpd
/Default
25 SUBMENU
:=Time Synchronization
29 URL
:=http
://www.ntp.org
/
32 define Package
/ntpd
/Default
/description
33 The ISC ntp suite is a collection of tools used to synchronize
34 the system clock with remote NTP time servers and run
/montior
39 $(call Package
/ntpd
/Default
)
43 define Package
/ntpd
/description
44 $(call Package
/ntpd
/Default
/description
)
45 This package contains the ntpd server.
48 define Package
/ntpd-openssl
49 $(call Package
/ntpd
/Default
)
50 TITLE
+= server
(with OpenSSL support
)
54 define Package
/ntpd-openssl
/description
55 $(call Package
/ntpd
/Default
/description
)
56 This package contains the ntpd server with OpenSSL support.
59 define Package
/ntpdate
60 $(call Package
/ntpd
/Default
)
64 define Package
/ntpdate
/description
65 $(call Package
/ntpd
/Default
/description
)
66 This package contains ntpdate.
69 define Package
/ntp-utils
70 $(call Package
/ntpd
/Default
)
75 define Package
/ntp-utils
/description
76 $(call Package
/ntpd
/Default
/description
)
77 This package contains ntpdc and ntpq.
80 define Package
/ntpd
/conffiles
84 define Package
/ntpd
/Default
/postinst
86 grep
-q
'^ntp[[:space:]]*123/udp' $${IPKG_INSTROOT}/etc
/services
2>/dev
/null
87 [ $$?
-ne
0 ] && echo
"ntp 123/udp # Network Time Protocol" >>$${IPKG_INSTROOT}/etc
/services || exit
0
88 grep
-q
'^ntp[[:space:]]*123/tcp' $${IPKG_INSTROOT}/etc
/services
2>/dev
/null
89 [ $$?
-ne
0 ] && echo
"ntp 123/tcp # Network Time Protocol" >>$${IPKG_INSTROOT}/etc
/services || exit
0
92 define Package
/ntpdate
/postinst
93 $(call Package
/ntpd
/Default
/postinst
)
96 define Package
/ntpd
/postinst
97 $(call Package
/ntpd
/Default
/postinst
)
100 define Package
/ntp-utils
/postinst
101 $(call Package
/ntpd
/Default
/postinst
)
104 TARGET_CPPFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/libelf
107 ac_cv_header_md5_h
=no \
108 ac_cv_lib_rt_sched_setscheduler
=no \
109 ac_cv_header_dns_sd_h
=no
111 define Build
/Template
113 $(STAMP_BUILT
)-$(2): $(STAMP_PREPARED
)
114 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
115 $(call Build
/Configure
/Default
, \
116 --disable-all-clocks \
117 --disable-parse-clocks \
119 --enable-LOCAL-CLOCK \
121 --disable-linuxcaps \
123 $(MAKE
) -C
$(PKG_BUILD_DIR
) CFLAGS
="$(TARGET_CFLAGS)"
124 ( cd
$(PKG_BUILD_DIR
); mv
-f ntpd
/ntpd
$(PKG_NAME
)-$(2) )
127 $(STAMP_BUILT
): $(STAMP_BUILT
)-$(2)
131 ifneq ($(SDK
)$(CONFIG_PACKAGE_ntpd-openssl
),)
132 define Build
/with-openssl
133 $(call Build
/Template
,ntpd-openssl
,with-openssl
, \
135 --with-openssl-incdir
="$(STAGING_DIR)/usr/include" \
136 --with-openssl-libdir
="$(STAGING_DIR)/usr/lib" \
140 $(eval
$(Build
/with-openssl
))
142 ifneq ($(SDK
)$(CONFIG_PACKAGE_ntpd
),)
143 define Build
/without-ssl
144 $(call Build
/Template
,ntpd
,without-ssl
)
148 ifneq ($(SDK
)$(CONFIG_PACKAGE_ntpdate
),)
149 define Build
/without-ssl
150 $(call Build
/Template
,ntpd
,without-ssl
)
154 ifneq ($(SDK
)$(CONFIG_PACKAGE_ntp-utils
),)
155 define Build
/without-ssl
156 $(call Build
/Template
,ntpd
,without-ssl
)
159 $(eval
$(Build
/without-ssl
))
161 define Package
/ntpd
/install
162 $(INSTALL_DIR
) $(1)/usr
/sbin
/
163 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/$(PKG_NAME
)-without-ssl
$(1)/usr
/sbin
/$(PKG_NAME
)
164 $(INSTALL_DIR
) $(1)/etc
165 $(INSTALL_CONF
) .
/files
/ntp.conf
$(1)/etc
/
166 $(INSTALL_DIR
) $(1)/etc
/init.d
167 $(INSTALL_BIN
) .
/files
/ntpd.init
$(1)/etc
/init.d
/ntpd
168 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/iface
169 $(INSTALL_BIN
) .
/files
/ntpd.hotplug
$(1)/etc
/hotplug.d
/iface
/20-ntpd
172 define Package
/ntpd-openssl
/install
173 $(INSTALL_DIR
) $(1)/usr
/sbin
/
174 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/$(PKG_NAME
)-with-openssl
$(1)/usr
/sbin
/$(PKG_NAME
)
175 $(INSTALL_DIR
) $(1)/etc
176 $(INSTALL_CONF
) .
/files
/ntp.conf
$(1)/etc
/
177 $(INSTALL_DIR
) $(1)/etc
/init.d
178 $(INSTALL_BIN
) .
/files
/ntpd.init
$(1)/etc
/init.d
/ntpd
179 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/iface
180 $(INSTALL_BIN
) .
/files
/ntpd.hotplug
$(1)/etc
/hotplug.d
/iface
/20-ntpd
183 define Package
/ntpdate
/install
184 $(INSTALL_DIR
) $(1)/usr
/sbin
/
185 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ntpdate
/ntpdate
$(1)/usr
/sbin
/
186 $(INSTALL_DIR
) $(1)/etc
/init.d
187 $(INSTALL_BIN
) .
/files
/ntpdate.init
$(1)/etc
/init.d
/ntpdate
190 define Package
/ntp-utils
/install
191 $(INSTALL_DIR
) $(1)/usr
/sbin
/
192 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ntpdc
/ntpdc
$(1)/usr
/sbin
/
193 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ntpq
/ntpq
$(1)/usr
/sbin
/
196 $(eval
$(call BuildPackage
,ntpd-openssl
))
197 $(eval
$(call BuildPackage
,ntpd
))
198 $(eval
$(call BuildPackage
,ntpdate
))
199 $(eval
$(call BuildPackage
,ntp-utils
))