ntpd: update to version 4.2.8p17
[feed/packages.git] / net / ntpd / Makefile
1 #
2 # Copyright (C) 2006-2016 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.8p17
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_HASH:=103dd272e6a66c5b8df07dce5e9a02555fcd6f1397bdfb782237328e89d3a866
17
18 PKG_LICENSE:=NTP
19 PKG_LICENSE_FILES:=COPYRIGHT html/copyright.html
20 PKG_CPE_ID:=cpe:/a:ntp:ntp
21
22 PKG_FIXUP:=autoreconf
23 PKG_LIBTOOL_PATHS:=. sntp
24 PKG_CHECK_FORMAT_SECURITY:=0
25 PKG_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/ntpd/Default
30 SUBMENU:=Time Synchronization
31 SECTION:=net
32 CATEGORY:=Network
33 TITLE:=ISC ntp
34 MAINTAINER:=Peter Wagner <tripolar@gmx.at>
35 URL:=http://www.ntp.org/
36 DEPENDS:=+libopenssl +libpthread +libcap
37 endef
38
39 define Package/ntpd/Default/description
40 The ISC ntp suite is a collection of tools used to synchronize the
41 system clock with remote NTP time servers and run/monitor local NTP
42 servers.
43 endef
44
45 define Package/ntpd
46 $(call Package/ntpd/Default)
47 DEPENDS+= +ntp-utils
48 TITLE+= server
49 USERID:=ntp=123:ntp=123
50 endef
51
52 define Package/ntpd/description
53 $(call Package/ntpd/Default/description)
54 .
55 This package contains the ntpd server.
56 endef
57
58 define Package/ntpdate
59 $(call Package/ntpd/Default)
60 TITLE+=date
61 endef
62
63 define Package/ntpdate/description
64 $(call Package/ntpd/Default/description)
65 .
66 This package contains ntpdate.
67 endef
68
69 define Package/ntp-utils
70 $(call Package/ntpd/Default)
71 TITLE+= utilities
72 DEPENDS+= +libevent2-pthreads
73 endef
74
75 define Package/ntp-utils/description
76 $(call Package/ntpd/Default/description)
77 .
78 This package contains ntpdc, ntpq, ntptime and sntp.
79 endef
80
81 define Package/ntp-keygen
82 $(call Package/ntpd/Default)
83 TITLE+=keygen
84 DEPENDS+= +libevent2-core
85 endef
86
87 define Package/ntp-keygen/description
88 $(call Package/ntpd/Default/description)
89 .
90 This package contains the ntp-keygen.
91 endef
92
93 CONFIGURE_VARS += \
94 ac_cv_header_md5_h=no \
95 ac_cv_lib_rt_sched_setscheduler=no \
96 ac_cv_header_dns_sd_h=no \
97 hw_cv_func_snprintf_c99=yes \
98 hw_cv_func_vsnprintf_c99=yes \
99
100 CONFIGURE_ARGS += \
101 --disable-all-clocks \
102 --disable-parse-clocks \
103 --without-ntpsnmpd \
104 --without-lineeditlibs \
105 --enable-NMEA \
106 --enable-LOCAL-CLOCK \
107 --enable-SHM \
108 --enable-ATOM \
109 --enable-linuxcaps \
110 --with-yielding-select=yes \
111 --with-crypto \
112 $(if $(CONFIG_PACKAGE_ntp-utils),--with-sntp,--without-sntp) \
113 --with-openssl-incdir="$(STAGING_DIR)/usr/include" \
114 --with-openssl-libdir="$(STAGING_DIR)/usr/lib"
115
116 define Package/ntpd/install
117 $(INSTALL_DIR) $(1)/sbin
118 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/sbin/
119 $(INSTALL_DIR) $(1)/usr/sbin
120 $(INSTALL_BIN) ./files/ntpd.hotplug-helper $(1)/usr/sbin/
121 $(INSTALL_DIR) $(1)/etc/init.d
122 $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
123 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
124 $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
125 endef
126
127 define Package/ntpd/postinst
128 #!/bin/sh
129 [ -L "$${IPKG_INSTROOT}/usr/sbin/ntpd" ] && rm -f "$${IPKG_INSTROOT}/usr/sbin/ntpd"
130 exit 0
131 endef
132
133 define Package/ntpd/postrm
134 #!/bin/sh
135 /bin/busybox ntpd -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/sbin/ntpd
136 exit 0
137 endef
138
139 define Package/ntpdate/install
140 $(INSTALL_DIR) $(1)/usr/sbin
141 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdate/ntpdate $(1)/usr/sbin/
142 $(INSTALL_DIR) $(1)/etc/init.d
143 $(INSTALL_BIN) ./files/ntpdate.init $(1)/etc/init.d/ntpdate
144 endef
145
146 define Package/ntp-utils/install
147 $(INSTALL_DIR) $(1)/usr/sbin
148 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
149 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
150 $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntptime $(1)/usr/sbin/
151 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sntp/sntp $(1)/usr/sbin/
152 endef
153
154 define Package/ntp-keygen/install
155 $(INSTALL_DIR) $(1)/usr/sbin
156 $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntp-keygen $(1)/usr/sbin/
157 endef
158
159 $(eval $(call BuildPackage,ntpd))
160 $(eval $(call BuildPackage,ntpdate))
161 $(eval $(call BuildPackage,ntp-utils))
162 $(eval $(call BuildPackage,ntp-keygen))