You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
4.7 KiB

  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=ntp
  9. PKG_VERSION:=4.2.6p5
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
  13. PKG_MD5SUM:=00df80a84ec9528fcfb09498075525bc
  14. PKG_LICENSE:=Unique
  15. PKG_LICENSE_FILES:=COPYRIGHT html/copyright.html
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  17. PKG_FIXUP:=autoreconf
  18. PKG_LIBTOOL_PATHS:=. sntp
  19. PKG_CHECK_FORMAT_SECURITY:=0
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/ntpd/Default
  22. SUBMENU:=Time Synchronization
  23. SECTION:=net
  24. CATEGORY:=Network
  25. TITLE:=ISC ntp
  26. MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  27. URL:=http://www.ntp.org/
  28. DEPENDS:=+libcap
  29. endef
  30. define Package/ntpd/Default/description
  31. The ISC ntp suite is a collection of tools used to synchronize the
  32. system clock with remote NTP time servers and run/monitor local NTP
  33. servers.
  34. endef
  35. define Package/ntpd
  36. $(call Package/ntpd/Default)
  37. TITLE+= server
  38. VARIANT:=nossl
  39. USERID:=ntp=123:ntp=123
  40. endef
  41. define Package/ntpd/description
  42. $(call Package/ntpd/Default/description)
  43. .
  44. This package contains the ntpd server.
  45. endef
  46. define Package/ntpd-ssl
  47. $(call Package/ntpd/Default)
  48. TITLE+= server (with OpenSSL support)
  49. VARIANT:=ssl
  50. DEPENDS+= +libopenssl
  51. USERID:=ntp=123:ntp=123
  52. endef
  53. define Package/ntpd-ssl/description
  54. $(call Package/ntpd/Default/description)
  55. .
  56. This package contains the ntpd server with OpenSSL support.
  57. endef
  58. define Package/ntpdate
  59. $(call Package/ntpd/Default)
  60. TITLE+=date
  61. VARIANT:=nossl
  62. endef
  63. define Package/ntpdate/description
  64. $(call Package/ntpd/Default/description)
  65. .
  66. This package contains ntpdate.
  67. endef
  68. define Package/ntp-utils
  69. $(call Package/ntpd/Default)
  70. TITLE+= utilities
  71. VARIANT:=nossl
  72. endef
  73. define Package/ntp-utils/description
  74. $(call Package/ntpd/Default/description)
  75. .
  76. This package contains ntpdc, ntpq and ntptime.
  77. endef
  78. define Package/ntp-keygen
  79. $(call Package/ntpd/Default)
  80. TITLE+=keygen
  81. VARIANT:=nossl
  82. endef
  83. define Package/ntp-keygen/description
  84. $(call Package/ntpd/Default/description)
  85. .
  86. This package contains the ntp-keygen.
  87. endef
  88. define Package/ntp-keygen-ssl
  89. $(call Package/ntpd/Default)
  90. TITLE+=keygen (with OpenSSL support)
  91. VARIANT:=ssl
  92. DEPENDS+= +libopenssl
  93. endef
  94. define Package/ntp-keygen-ssl/description
  95. $(call Package/ntpd/Default/description)
  96. .
  97. This package contains the ntp-keygen with OpenSSL support.
  98. endef
  99. define Package/ntpd/conffiles
  100. /etc/ntp.conf
  101. endef
  102. CONFIGURE_VARS += \
  103. ac_cv_header_md5_h=no \
  104. ac_cv_lib_rt_sched_setscheduler=no \
  105. ac_cv_header_dns_sd_h=no
  106. CONFIGURE_ARGS += \
  107. --disable-all-clocks \
  108. --disable-parse-clocks \
  109. --without-ntpsnmpd \
  110. --without-lineeditlibs \
  111. --enable-NMEA \
  112. --enable-LOCAL-CLOCK \
  113. --enable-SHM \
  114. --enable-linuxcaps
  115. ifeq ($(BUILD_VARIANT),ssl)
  116. CONFIGURE_ARGS += \
  117. --with-crypto \
  118. --with-openssl-incdir="$(STAGING_DIR)/usr/include" \
  119. --with-openssl-libdir="$(STAGING_DIR)/usr/lib"
  120. endif
  121. define Package/ntpd/install
  122. $(INSTALL_DIR) $(1)/sbin
  123. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/sbin/
  124. $(INSTALL_DIR) $(1)/etc
  125. $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
  126. $(INSTALL_DIR) $(1)/etc/init.d
  127. $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
  128. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  129. $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
  130. endef
  131. define Package/ntpd/postinst
  132. #!/bin/sh
  133. [ -L "$${IPKG_INSTROOT}/usr/sbin/ntpd" ] && rm -f "$${IPKG_INSTROOT}/usr/sbin/ntpd"
  134. exit 0
  135. endef
  136. define Package/ntpd/postrm
  137. #!/bin/sh
  138. /bin/busybox ntpd -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/sbin/ntpd
  139. exit 0
  140. endef
  141. Package/ntpd-ssl/conffiles = $(Package/ntpd/conffiles)
  142. Package/ntpd-ssl/install = $(Package/ntpd/install)
  143. define Package/ntpdate/install
  144. $(INSTALL_DIR) $(1)/usr/sbin
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdate/ntpdate $(1)/usr/sbin/
  146. $(INSTALL_DIR) $(1)/etc/init.d
  147. $(INSTALL_BIN) ./files/ntpdate.init $(1)/etc/init.d/ntpdate
  148. endef
  149. define Package/ntp-utils/install
  150. $(INSTALL_DIR) $(1)/usr/sbin
  151. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
  152. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
  153. $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntptime $(1)/usr/sbin/
  154. endef
  155. define Package/ntp-keygen/install
  156. $(INSTALL_DIR) $(1)/usr/sbin
  157. $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntp-keygen $(1)/usr/sbin/
  158. endef
  159. Package/ntp-keygen-ssl/install = $(Package/ntp-keygen/install)
  160. $(eval $(call BuildPackage,ntpd))
  161. $(eval $(call BuildPackage,ntpd-ssl))
  162. $(eval $(call BuildPackage,ntpdate))
  163. $(eval $(call BuildPackage,ntp-utils))
  164. $(eval $(call BuildPackage,ntp-keygen))
  165. $(eval $(call BuildPackage,ntp-keygen-ssl))