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.

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