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.

127 lines
3.7 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:=util
  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:=util
  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:=util
  41. CATEGORY:=Utilities
  42. URL:=$(PKG_SOURCE_URL)
  43. TITLE:=sysrepo cli tool
  44. DEPENDS:=+libsysrepo
  45. endef
  46. define Package/sysrepocfg
  47. SECTION:=util
  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. define Package/libsysrepo/install
  66. $(INSTALL_DIR) $(1)/usr/lib
  67. $(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/
  68. $(INSTALL_DIR) $(1)/etc/sysrepo/yang/internal
  69. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-module-dependencies.yang $(1)/etc/sysrepo/yang/internal
  70. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-notification-store.yang $(1)/etc/sysrepo/yang/internal
  71. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-persistent-data.yang $(1)/etc/sysrepo/yang/internal
  72. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  73. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-acm@2012-02-22.yang $(1)/etc/sysrepo/yang/
  74. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/
  75. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/nc-notifications.yang $(1)/etc/sysrepo/yang/
  76. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/notifications.yang $(1)/etc/sysrepo/yang/
  77. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf@2011-06-01.yang $(1)/etc/sysrepo/yang/
  78. $(INSTALL_DIR) $(1)/etc/sysrepo/data/internal
  79. $(INSTALL_DIR) $(1)/etc/sysrepo/data/notifications
  80. $(INSTALL_DIR) $(1)/etc/uci-defaults
  81. $(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
  82. endef
  83. define Package/sysrepo/install
  84. $(INSTALL_DIR) $(1)/bin
  85. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepod $(1)/bin/
  86. $(INSTALL_DIR) $(1)/bin
  87. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
  88. $(INSTALL_DIR) $(1)/etc/init.d/
  89. $(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo
  90. endef
  91. define Package/sysrepoctl/install
  92. $(INSTALL_DIR) $(1)/bin
  93. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepoctl $(1)/bin/
  94. endef
  95. define Package/sysrepocfg/install
  96. $(INSTALL_DIR) $(1)/bin
  97. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/
  98. endef
  99. $(eval $(call BuildPackage,libsysrepo))
  100. $(eval $(call BuildPackage,sysrepo))
  101. $(eval $(call BuildPackage,sysrepoctl))
  102. $(eval $(call BuildPackage,sysrepocfg))