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.

103 lines
2.8 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=chrony
  9. PKG_VERSION:=4.2
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://download.tuxfamily.org/chrony/
  13. PKG_HASH:=273f9fd15c328ed6f3a5f6ba6baec35a421a34a73bb725605329b1712048db9a
  14. PKG_MAINTAINER:=Miroslav Lichvar <mlichvar0@gmail.com>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:tuxfamily:chrony
  18. PKG_BUILD_DEPENDS:=pps-tools
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/chrony/Default
  21. SUBMENU:=Time Synchronization
  22. SECTION:=net
  23. CATEGORY:=Network
  24. DEPENDS:=+libcap +libpthread
  25. USERID:=chrony=323:chrony=323
  26. TITLE:=A versatile NTP client and server
  27. URL:=http://chrony.tuxfamily.org/
  28. PROVIDES:=nts
  29. endef
  30. define Package/chrony
  31. $(call Package/chrony/Default)
  32. TITLE+= (without NTS)
  33. VARIANT:=normal
  34. CONFLICTS:=chrony-nts
  35. endef
  36. define Package/chrony-nts
  37. $(call Package/chrony/Default)
  38. TITLE+= (with NTS)
  39. DEPENDS+= +PACKAGE_chrony-nts:libgnutls +PACKAGE_chrony-nts:ca-bundle
  40. VARIANT:=with-nts
  41. endef
  42. define Package/chrony/description
  43. An NTP client and server designed to perform well in a wide range
  44. of conditions. It can synchronize the system clock with NTP servers,
  45. reference clocks, and manual input using wristwatch and keyboard.
  46. endef
  47. Package/chrony-nts/description = $(Package/chrony/description)
  48. define Package/chrony/conffiles
  49. /etc/chrony/chrony.conf
  50. /etc/config/chrony
  51. endef
  52. Package/chrony-nts/conffiles = $(Package/chrony/conffiles)
  53. CONFIGURE_ARGS+= \
  54. --host-machine=$(shell echo $(GNU_TARGET_NAME) | sed -e 's/-.*//') \
  55. --host-release="" \
  56. --host-system=Linux \
  57. --sysconfdir=/etc/chrony \
  58. --prefix=/usr \
  59. --chronyrundir=/var/run/chrony \
  60. $(if $(findstring normal,$(BUILD_VARIANT)),--disable-nts,--enable,nts) \
  61. --disable-readline \
  62. --disable-rtc \
  63. --disable-sechash \
  64. --with-user=chrony
  65. CONFIGURE_VARS+=CPPFLAGS=-DNDEBUG
  66. TARGET_CFLAGS += -flto
  67. TARGET_LDFLAGS += -flto
  68. define Package/chrony/install
  69. $(INSTALL_DIR) $(1)/usr/bin/
  70. $(INSTALL_DIR) $(1)/usr/sbin/
  71. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chronyd $(1)/usr/sbin
  72. $(INSTALL_BIN) $(PKG_BUILD_DIR)/chronyc $(1)/usr/bin
  73. $(INSTALL_DIR) $(1)/etc/init.d
  74. $(INSTALL_DIR) $(1)/etc/config
  75. $(INSTALL_DIR) $(1)/etc/chrony
  76. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  77. $(INSTALL_BIN) ./files/chrony.hotplug $(1)/etc/hotplug.d/iface/20-chrony
  78. $(INSTALL_BIN) ./files/chronyd.init $(1)/etc/init.d/chronyd
  79. $(INSTALL_CONF) ./files/chrony.config $(1)/etc/config/chrony
  80. $(INSTALL_CONF) ./files/chrony.conf $(1)/etc/chrony/chrony.conf
  81. endef
  82. Package/chrony-nts/install= $(Package/chrony/install)
  83. $(eval $(call BuildPackage,chrony))
  84. $(eval $(call BuildPackage,chrony-nts))