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_NAME:=sysrepo
  9. PKG_VERSION:=1.4.122
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=2cc7537a03f48dc3c955436e1e0ed077bc3b31a755d6979d24ca42e1187fce01
  14. PKG_MAINTAINER:=Jakov Smolic <jakov.smolic@sartura.hr>
  15. PKG_LICENSE:=Apache-2.0
  16. PKG_LICENSE_FILES:=LICENSE
  17. CMAKE_INSTALL:=1
  18. PKG_BUILD_DEPENDS:=swig/host
  19. PYTHON3_PKG_BUILD:=0
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. include ../../lang/python/python3-package.mk
  23. define Package/libsysrepo
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. TITLE:=YANG-based data store library
  27. URL:=https://www.sysrepo.org/
  28. DEPENDS:=+libyang +libatomic +libprotobuf-c +libev +libredblack +librt +libpthread
  29. endef
  30. define Package/python3-sysrepo
  31. SECTION:=lang
  32. CATEGORY:=Languages
  33. SUBMENU:=Python
  34. TITLE:=YANG-based data store library - Python 3 bindings
  35. URL:=https://www.sysrepo.org/
  36. DEPENDS:=+libsysrepo +libstdcpp +python3-base +libyang-cpp
  37. endef
  38. define Package/sysrepo
  39. SECTION:=utils
  40. CATEGORY:=Utilities
  41. TITLE:=YANG-based data store daemon and plugin
  42. URL:=https://www.sysrepo.org/
  43. DEPENDS:=+libsysrepo
  44. endef
  45. define Package/sysrepoctl
  46. SECTION:=utils
  47. CATEGORY:=Utilities
  48. TITLE:=sysrepo cli tool
  49. URL:=https://www.sysrepo.org/
  50. DEPENDS:=+libsysrepo
  51. endef
  52. define Package/sysrepocfg
  53. SECTION:=utils
  54. CATEGORY:=Utilities
  55. TITLE:=sysrepo configuration tool
  56. URL:=https://www.sysrepo.org/
  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. SWIG_VERSION:=4.0.1
  63. CMAKE_OPTIONS += \
  64. -DENABLE_TESTS:BOOL=FALSE \
  65. -DBUILD_EXAMPLES:BOOL=FALSE \
  66. -DCMAKE_INSTALL_PREFIX=/usr \
  67. -DCMAKE_BUILD_TYPE="Package" \
  68. -DREPOSITORY_LOC:PATH=/etc/sysrepo \
  69. -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \
  70. -DSWIG_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/swig \
  71. -DCALL_TARGET_BINS_DIRECTLY=OFF \
  72. -DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
  73. -DGEN_PYTHON_BINDINGS:BOOL=TRUE
  74. define Package/libsysrepo/install
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysrepo.so* $(1)/usr/lib/
  77. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  78. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-with-defaults.yang $(1)/etc/sysrepo/yang/
  79. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/
  80. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-netconf.yang $(1)/etc/sysrepo/yang/
  81. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/ietf-origin.yang $(1)/etc/sysrepo/yang/
  82. $(INSTALL_DATA) $(PKG_BUILD_DIR)/modules/sysrepo.yang $(1)/etc/sysrepo/yang/
  83. $(INSTALL_DIR) $(1)/etc/uci-defaults
  84. $(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
  85. endef
  86. define Package/python3-sysrepo/install
  87. $(INSTALL_DIR) $(1)/usr/lib
  88. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysrepo-cpp.so* $(1)/usr/lib
  89. $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
  90. $(INSTALL_DATA) $(PKG_BUILD_DIR)/bindings/python/sysrepo.py $(1)$(PYTHON3_PKG_DIR)
  91. $(INSTALL_DATA) $(PKG_BUILD_DIR)/bindings/python/_sysrepo.so $(1)$(PYTHON3_PKG_DIR)
  92. endef
  93. define Package/sysrepo/install
  94. $(INSTALL_DIR) $(1)/usr/bin
  95. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sysrepo-plugind $(1)/usr/bin/
  96. $(INSTALL_DIR) $(1)/etc/init.d/
  97. $(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo
  98. endef
  99. define Package/sysrepoctl/install
  100. $(INSTALL_DIR) $(1)/usr/bin
  101. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sysrepoctl $(1)/usr/bin/
  102. endef
  103. define Package/sysrepocfg/install
  104. $(INSTALL_DIR) $(1)/usr/bin
  105. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sysrepocfg $(1)/usr/bin/
  106. endef
  107. $(eval $(call BuildPackage,libsysrepo))
  108. $(eval $(call BuildPackage,python3-sysrepo))
  109. $(eval $(call BuildPackage,sysrepo))
  110. $(eval $(call BuildPackage,sysrepoctl))
  111. $(eval $(call BuildPackage,sysrepocfg))