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