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.

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