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.

196 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. USERID:=ntp=123:ntp=123
  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. USERID:=ntp=123:ntp=123
  50. endef
  51. define Package/ntpd-ssl/description
  52. $(call Package/ntpd/Default/description)
  53. .
  54. This package contains the ntpd server with OpenSSL support.
  55. endef
  56. define Package/ntpdate
  57. $(call Package/ntpd/Default)
  58. TITLE+=date
  59. VARIANT:=nossl
  60. endef
  61. define Package/ntpdate/description
  62. $(call Package/ntpd/Default/description)
  63. .
  64. This package contains ntpdate.
  65. endef
  66. define Package/ntp-utils
  67. $(call Package/ntpd/Default)
  68. TITLE+= utilities
  69. VARIANT:=nossl
  70. endef
  71. define Package/ntp-utils/description
  72. $(call Package/ntpd/Default/description)
  73. .
  74. This package contains ntpdc, ntpq and ntptime.
  75. endef
  76. define Package/ntp-keygen
  77. $(call Package/ntpd/Default)
  78. TITLE+=keygen
  79. VARIANT:=nossl
  80. endef
  81. define Package/ntp-keygen/description
  82. $(call Package/ntpd/Default/description)
  83. .
  84. This package contains the ntp-keygen.
  85. endef
  86. define Package/ntp-keygen-ssl
  87. $(call Package/ntpd/Default)
  88. TITLE+=keygen (with OpenSSL support)
  89. VARIANT:=ssl
  90. DEPENDS+= +libopenssl
  91. endef
  92. define Package/ntp-keygen-ssl/description
  93. $(call Package/ntpd/Default/description)
  94. .
  95. This package contains the ntp-keygen with OpenSSL support.
  96. endef
  97. define Package/ntpd/conffiles
  98. /etc/ntp.conf
  99. endef
  100. CONFIGURE_VARS += \
  101. ac_cv_header_md5_h=no \
  102. ac_cv_lib_rt_sched_setscheduler=no \
  103. ac_cv_header_dns_sd_h=no
  104. CONFIGURE_ARGS += \
  105. --disable-all-clocks \
  106. --disable-parse-clocks \
  107. --without-ntpsnmpd \
  108. --without-lineeditlibs \
  109. --enable-NMEA \
  110. --enable-LOCAL-CLOCK \
  111. --enable-SHM \
  112. --enable-linuxcaps
  113. ifeq ($(BUILD_VARIANT),ssl)
  114. CONFIGURE_ARGS += \
  115. --with-crypto \
  116. --with-openssl-incdir="$(STAGING_DIR)/usr/include" \
  117. --with-openssl-libdir="$(STAGING_DIR)/usr/lib"
  118. endif
  119. define Package/ntpd/install
  120. $(INSTALL_DIR) $(1)/sbin
  121. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/sbin/
  122. $(INSTALL_DIR) $(1)/etc
  123. $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
  124. $(INSTALL_DIR) $(1)/etc/init.d
  125. $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
  126. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  127. $(INSTALL_BIN) ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
  128. endef
  129. define Package/ntpd/postinst
  130. #!/bin/sh
  131. [ -L "$${IPKG_INSTROOT}/usr/sbin/ntpd" ] && rm -f "$${IPKG_INSTROOT}/usr/sbin/ntpd"
  132. exit 0
  133. endef
  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. Package/ntpd-ssl/conffiles = $(Package/ntpd/conffiles)
  140. Package/ntpd-ssl/install = $(Package/ntpd/install)
  141. define Package/ntpdate/install
  142. $(INSTALL_DIR) $(1)/usr/sbin
  143. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdate/ntpdate $(1)/usr/sbin/
  144. $(INSTALL_DIR) $(1)/etc/init.d
  145. $(INSTALL_BIN) ./files/ntpdate.init $(1)/etc/init.d/ntpdate
  146. endef
  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. define Package/ntp-keygen/install
  154. $(INSTALL_DIR) $(1)/usr/sbin
  155. $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntp-keygen $(1)/usr/sbin/
  156. endef
  157. Package/ntp-keygen-ssl/install = $(Package/ntp-keygen/install)
  158. $(eval $(call BuildPackage,ntpd))
  159. $(eval $(call BuildPackage,ntpd-ssl))
  160. $(eval $(call BuildPackage,ntpdate))
  161. $(eval $(call BuildPackage,ntp-utils))
  162. $(eval $(call BuildPackage,ntp-keygen))
  163. $(eval $(call BuildPackage,ntp-keygen-ssl))