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.

134 lines
3.9 KiB

  1. #
  2. # Copyright (C) 2017 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_LICENSE:=ASL-2.0
  9. PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
  10. PKG_NAME:=sysrepo
  11. PKG_VERSION:=0.6.0
  12. PKG_RELEASE:=2
  13. PKG_SOURCE_PROTO:=git
  14. PKG_SOURCE_VERSION:=e4a5705a4c5293ba121048c71899b98243d99edf
  15. PKG_MIRROR_HASH:=aa0fb5d7c947dd428d9f573c84edf6237c8c1a4db92dcd4d7552a68d25277a39
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
  17. PKG_SOURCE_URL:=https://github.com/sysrepo/sysrepo.git
  18. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  20. CMAKE_INSTALL:=1
  21. PKG_BUILD_PARALLEL:=1
  22. PKG_INSTALL:=1
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/cmake.mk
  25. define Package/libsysrepo
  26. SECTION:=utils
  27. CATEGORY:=Utilities
  28. URL:=$(PKG_SOURCE_URL)
  29. TITLE:=YANG-based data store library
  30. DEPENDS:=+libyang +libprotobuf-c +libev +libavl
  31. endef
  32. define Package/sysrepo
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. URL:=$(PKG_SOURCE_URL)
  36. TITLE:=YANG-based data store daemon and plugin
  37. DEPENDS:=+libsysrepo
  38. endef
  39. define Package/sysrepoctl
  40. SECTION:=utils
  41. CATEGORY:=Utilities
  42. URL:=$(PKG_SOURCE_URL)
  43. TITLE:=sysrepo cli tool
  44. DEPENDS:=+libsysrepo
  45. endef
  46. define Package/sysrepocfg
  47. SECTION:=utils
  48. CATEGORY:=Utilities
  49. URL:=$(PKG_SOURCE_URL)
  50. TITLE:=sysrepo configuration tool
  51. DEPENDS:=+libsysrepo
  52. endef
  53. define Package/sysrepo/description
  54. Sysrepo is an YANG-based configuration and operational state data store for Unix/Linux applications.
  55. endef
  56. CMAKE_OPTIONS += \
  57. -DCMAKE_BUILD_TYPE:STRING=Release \
  58. -DENABLE_TESTS:BOOL=FALSE \
  59. -DBUILD_EXAMPLES:BOOL=FALSE \
  60. -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \
  61. -DGEN_LANGUAGE_BINDINGS:BOOL=FALSE \
  62. -DREPOSITORY_LOC:PATH=/etc/sysrepo \
  63. -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  64. -DENABLE_NACM:BOOL=FALSE \
  65. -DREQUEST_TIMEOUT=6 \
  66. -DLONG_REQUEST_TIMEOUT=30 \
  67. -DCOMMIT_VERIFY_TIMEOUT=20 \
  68. -DOPER_DATA_PROVIDE_TIMEOUT=4 \
  69. -DNOTIF_AGE_TIMEOUT=120 \
  70. -DNOTIF_TIME_WINDOW=20 \
  71. -DUSE_SR_MEM_MGMT=0
  72. define Package/libsysrepo/install
  73. $(INSTALL_DIR) $(1)/usr/lib
  74. $(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/
  75. $(INSTALL_DIR) $(1)/etc/sysrepo/yang/internal
  76. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-module-dependencies.yang $(1)/etc/sysrepo/yang/internal
  77. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-notification-store.yang $(1)/etc/sysrepo/yang/internal
  78. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-persistent-data.yang $(1)/etc/sysrepo/yang/internal
  79. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  80. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-acm@2012-02-22.yang $(1)/etc/sysrepo/yang/
  81. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/
  82. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/nc-notifications.yang $(1)/etc/sysrepo/yang/
  83. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/notifications.yang $(1)/etc/sysrepo/yang/
  84. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf@2011-06-01.yang $(1)/etc/sysrepo/yang/
  85. $(INSTALL_DIR) $(1)/etc/sysrepo/data/internal
  86. $(INSTALL_DIR) $(1)/etc/sysrepo/data/notifications
  87. $(INSTALL_DIR) $(1)/etc/uci-defaults
  88. $(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
  89. endef
  90. define Package/sysrepo/install
  91. $(INSTALL_DIR) $(1)/bin
  92. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepod $(1)/bin/
  93. $(INSTALL_DIR) $(1)/bin
  94. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
  95. $(INSTALL_DIR) $(1)/etc/init.d/
  96. $(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo
  97. endef
  98. define Package/sysrepoctl/install
  99. $(INSTALL_DIR) $(1)/bin
  100. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepoctl $(1)/bin/
  101. endef
  102. define Package/sysrepocfg/install
  103. $(INSTALL_DIR) $(1)/bin
  104. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/
  105. endef
  106. $(eval $(call BuildPackage,libsysrepo))
  107. $(eval $(call BuildPackage,sysrepo))
  108. $(eval $(call BuildPackage,sysrepoctl))
  109. $(eval $(call BuildPackage,sysrepocfg))