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.

195 lines
4.6 KiB

  1. #
  2. # Copyright (C) 2006-2011 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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_BUILD_DEPENDS:=libelf1
  16. PKG_FIXUP:=autoreconf
  17. PKG_LIBTOOL_PATHS:=. sntp
  18. PKG_CHECK_FORMAT_SECURITY:=0
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/ntpd/Default
  21. SUBMENU:=Time Synchronization
  22. SECTION:=net
  23. CATEGORY:=Network
  24. TITLE:=ISC ntp
  25. MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  26. URL:=http://www.ntp.org/
  27. DEPENDS:=+libcap
  28. endef
  29. define Package/ntpd/Default/description
  30. The ISC ntp suite is a collection of tools used to synchronize the
  31. system clock with remote NTP time servers and run/montior local NTP
  32. servers.
  33. endef
  34. define Package/ntpd
  35. $(call Package/ntpd/Default)
  36. TITLE+= server
  37. VARIANT:=nossl
  38. endef
  39. define Package/ntpd/description
  40. $(call Package/ntpd/Default/description)
  41. .
  42. This package contains the ntpd server.
  43. endef
  44. define Package/ntpd-ssl
  45. $(call Package/ntpd/Default)
  46. TITLE+= server (with OpenSSL support)
  47. VARIANT:=ssl
  48. DEPENDS+= +libopenssl
  49. endef
  50. define Package/ntpd-ssl/description
  51. $(call Package/ntpd/Default/description)
  52. .
  53. This package contains the ntpd server with OpenSSL support.
  54. endef
  55. define Package/ntpdate
  56. $(call Package/ntpd/Default)
  57. TITLE+=date
  58. VARIANT:=nossl
  59. endef
  60. define Package/ntpdate/description
  61. $(call Package/ntpd/Default/description)
  62. .
  63. This package contains ntpdate.
  64. endef
  65. define Package/ntp-utils
  66. $(call Package/ntpd/Default)
  67. TITLE+= utilities
  68. VARIANT:=nossl
  69. endef
  70. define Package/ntp-utils/description
  71. $(call Package/ntpd/Default/description)
  72. .
  73. This package contains ntpdc, ntpq and ntptime.
  74. endef
  75. define Package/ntp-keygen
  76. $(call Package/ntpd/Default)
  77. TITLE+=keygen
  78. VARIANT:=nossl
  79. endef
  80. define Package/ntp-keygen/description
  81. $(call Package/ntpd/Default/description)
  82. .
  83. This package contains the ntp-keygen.
  84. endef
  85. define Package/ntp-keygen-ssl
  86. $(call Package/ntpd/Default)
  87. TITLE+=keygen (with OpenSSL support)
  88. VARIANT:=ssl
  89. DEPENDS+= +libopenssl
  90. endef
  91. define Package/ntp-keygen-ssl/description
  92. $(call Package/ntpd/Default/description)
  93. .
  94. This package contains the ntp-keygen with OpenSSL support.
  95. endef
  96. define Package/ntpd/conffiles
  97. /etc/ntp.conf
  98. endef
  99. CONFIGURE_VARS += \
  100. ac_cv_header_md5_h=no \
  101. ac_cv_lib_rt_sched_setscheduler=no \
  102. ac_cv_header_dns_sd_h=no
  103. CONFIGURE_ARGS += \
  104. --disable-all-clocks \
  105. --disable-parse-clocks \
  106. --without-ntpsnmpd \
  107. --without-lineeditlibs \
  108. --enable-NMEA \
  109. --enable-LOCAL-CLOCK \
  110. --enable-SHM \
  111. --enable-linuxcaps
  112. ifeq ($(BUILD_VARIANT),ssl)
  113. CONFIGURE_ARGS += \
  114. --with-crypto \
  115. --with-openssl-incdir="$(STAGING_DIR)/usr/include" \
  116. --with-openssl-libdir="$(STAGING_DIR)/usr/lib"
  117. endif
  118. define Package/ntpd/install
  119. $(INSTALL_DIR) $(1)/sbin
  120. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/sbin/
  121. $(INSTALL_DIR) $(1)/etc
  122. $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
  123. $(INSTALL_DIR) $(1)/etc/init.d
  124. $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
  125. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  126. $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
  127. endef
  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. 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. Package/ntpd-ssl/conffiles = $(Package/ntpd/conffiles)
  139. Package/ntpd-ssl/install = $(Package/ntpd/install)
  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. 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. endef
  152. define Package/ntp-keygen/install
  153. $(INSTALL_DIR) $(1)/usr/sbin
  154. $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntp-keygen $(1)/usr/sbin/
  155. endef
  156. Package/ntp-keygen-ssl/install = $(Package/ntp-keygen/install)
  157. $(eval $(call BuildPackage,ntpd))
  158. $(eval $(call BuildPackage,ntpd-ssl))
  159. $(eval $(call BuildPackage,ntpdate))
  160. $(eval $(call BuildPackage,ntp-utils))
  161. $(eval $(call BuildPackage,ntp-keygen))
  162. $(eval $(call BuildPackage,ntp-keygen-ssl))