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.

194 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_FIXUP:=autoreconf
  16. PKG_LIBTOOL_PATHS:=. sntp
  17. PKG_CHECK_FORMAT_SECURITY:=0
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/ntpd/Default
  20. SUBMENU:=Time Synchronization
  21. SECTION:=net
  22. CATEGORY:=Network
  23. TITLE:=ISC ntp
  24. MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  25. URL:=http://www.ntp.org/
  26. DEPENDS:=+libcap
  27. endef
  28. define Package/ntpd/Default/description
  29. The ISC ntp suite is a collection of tools used to synchronize the
  30. system clock with remote NTP time servers and run/montior local NTP
  31. servers.
  32. endef
  33. define Package/ntpd
  34. $(call Package/ntpd/Default)
  35. TITLE+= server
  36. VARIANT:=nossl
  37. endef
  38. define Package/ntpd/description
  39. $(call Package/ntpd/Default/description)
  40. .
  41. This package contains the ntpd server.
  42. endef
  43. define Package/ntpd-ssl
  44. $(call Package/ntpd/Default)
  45. TITLE+= server (with OpenSSL support)
  46. VARIANT:=ssl
  47. DEPENDS+= +libopenssl
  48. endef
  49. define Package/ntpd-ssl/description
  50. $(call Package/ntpd/Default/description)
  51. .
  52. This package contains the ntpd server with OpenSSL support.
  53. endef
  54. define Package/ntpdate
  55. $(call Package/ntpd/Default)
  56. TITLE+=date
  57. VARIANT:=nossl
  58. endef
  59. define Package/ntpdate/description
  60. $(call Package/ntpd/Default/description)
  61. .
  62. This package contains ntpdate.
  63. endef
  64. define Package/ntp-utils
  65. $(call Package/ntpd/Default)
  66. TITLE+= utilities
  67. VARIANT:=nossl
  68. endef
  69. define Package/ntp-utils/description
  70. $(call Package/ntpd/Default/description)
  71. .
  72. This package contains ntpdc, ntpq and ntptime.
  73. endef
  74. define Package/ntp-keygen
  75. $(call Package/ntpd/Default)
  76. TITLE+=keygen
  77. VARIANT:=nossl
  78. endef
  79. define Package/ntp-keygen/description
  80. $(call Package/ntpd/Default/description)
  81. .
  82. This package contains the ntp-keygen.
  83. endef
  84. define Package/ntp-keygen-ssl
  85. $(call Package/ntpd/Default)
  86. TITLE+=keygen (with OpenSSL support)
  87. VARIANT:=ssl
  88. DEPENDS+= +libopenssl
  89. endef
  90. define Package/ntp-keygen-ssl/description
  91. $(call Package/ntpd/Default/description)
  92. .
  93. This package contains the ntp-keygen with OpenSSL support.
  94. endef
  95. define Package/ntpd/conffiles
  96. /etc/ntp.conf
  97. endef
  98. CONFIGURE_VARS += \
  99. ac_cv_header_md5_h=no \
  100. ac_cv_lib_rt_sched_setscheduler=no \
  101. ac_cv_header_dns_sd_h=no
  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-linuxcaps
  111. ifeq ($(BUILD_VARIANT),ssl)
  112. CONFIGURE_ARGS += \
  113. --with-crypto \
  114. --with-openssl-incdir="$(STAGING_DIR)/usr/include" \
  115. --with-openssl-libdir="$(STAGING_DIR)/usr/lib"
  116. endif
  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. 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. define Package/ntpd/postrm
  133. #!/bin/sh
  134. /bin/busybox ntpd -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/sbin/ntpd
  135. exit 0
  136. endef
  137. Package/ntpd-ssl/conffiles = $(Package/ntpd/conffiles)
  138. Package/ntpd-ssl/install = $(Package/ntpd/install)
  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. define Package/ntp-utils/install
  146. $(INSTALL_DIR) $(1)/usr/sbin
  147. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
  148. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
  149. $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntptime $(1)/usr/sbin/
  150. endef
  151. define Package/ntp-keygen/install
  152. $(INSTALL_DIR) $(1)/usr/sbin
  153. $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntp-keygen $(1)/usr/sbin/
  154. endef
  155. Package/ntp-keygen-ssl/install = $(Package/ntp-keygen/install)
  156. $(eval $(call BuildPackage,ntpd))
  157. $(eval $(call BuildPackage,ntpd-ssl))
  158. $(eval $(call BuildPackage,ntpdate))
  159. $(eval $(call BuildPackage,ntp-utils))
  160. $(eval $(call BuildPackage,ntp-keygen))
  161. $(eval $(call BuildPackage,ntp-keygen-ssl))