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.

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