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.

156 lines
4.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:=0.7.8
  10. PKG_RELEASE:=2
  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:=d3066c1776a6727b96bbb3517eb646d0bb6037e8e1addcbe873cae590493843e
  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. 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 +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
  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. -DUSE_AVL_LIB:BOOL=FALSE \
  65. -DENABLE_TESTS:BOOL=FALSE \
  66. -DBUILD_EXAMPLES:BOOL=FALSE \
  67. -DREPOSITORY_LOC:PATH=/etc/sysrepo \
  68. -DENABLE_NACM:BOOL=FALSE \
  69. -DREQUEST_TIMEOUT=6 \
  70. -DLONG_REQUEST_TIMEOUT=30 \
  71. -DCOMMIT_VERIFY_TIMEOUT=20 \
  72. -DOPER_DATA_PROVIDE_TIMEOUT=4 \
  73. -DNOTIF_AGE_TIMEOUT=120 \
  74. -DNOTIF_TIME_WINDOW=20 \
  75. -DUSE_SR_MEM_MGMT=0 \
  76. -DFILE_FORMAT_EXT:STRING=xml \
  77. -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \
  78. -DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
  79. -DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/share/swig/$(SWIG_VERSION) \
  80. -DSWIG_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/swig \
  81. -DCALL_TARGET_BINS_DIRECTLY=OFF \
  82. -DGEN_PYTHON_BINDINGS:BOOL=TRUE \
  83. -DGEN_PYTHON_VERSION=3 \
  84. -DGEN_PYTHON3_TESTS:BOOL=FALSE
  85. define Package/libsysrepo/install
  86. $(INSTALL_DIR) $(1)/usr/lib
  87. $(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/
  88. $(INSTALL_DIR) $(1)/etc/sysrepo/yang/internal
  89. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-module-dependencies.yang $(1)/etc/sysrepo/yang/internal
  90. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-notification-store.yang $(1)/etc/sysrepo/yang/internal
  91. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-persistent-data.yang $(1)/etc/sysrepo/yang/internal
  92. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  93. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-acm@2018-02-14.yang $(1)/etc/sysrepo/yang/ietf-netconf-acm@2018-02-14.yang
  94. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06.yang
  95. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/nc-notifications.yang $(1)/etc/sysrepo/yang/nc-notifications@2008-07-14.yang
  96. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/notifications.yang $(1)/etc/sysrepo/yang/notifications@2008-07-14.yang
  97. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf@2011-06-01.yang $(1)/etc/sysrepo/yang/ietf-netconf@2011-06-01.yang
  98. $(INSTALL_DIR) $(1)/etc/sysrepo/data/internal
  99. $(INSTALL_DIR) $(1)/etc/sysrepo/data/notifications
  100. $(INSTALL_DIR) $(1)/etc/uci-defaults
  101. $(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
  102. endef
  103. define Package/python3-sysrepo/install
  104. $(INSTALL_DIR) $(1)/usr/lib
  105. $(CP) $(PKG_BUILD_DIR)/swig/libSysrepo-cpp.so* $(1)/usr/lib
  106. $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
  107. $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python/sysrepo.py $(1)$(PYTHON3_PKG_DIR)
  108. $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python/_sysrepo.so $(1)$(PYTHON3_PKG_DIR)
  109. endef
  110. define Package/sysrepo/install
  111. $(INSTALL_DIR) $(1)/bin
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepod $(1)/bin/
  113. $(INSTALL_DIR) $(1)/bin
  114. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
  115. $(INSTALL_DIR) $(1)/etc/init.d/
  116. $(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo
  117. endef
  118. define Package/sysrepoctl/install
  119. $(INSTALL_DIR) $(1)/bin
  120. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepoctl $(1)/bin/
  121. endef
  122. define Package/sysrepocfg/install
  123. $(INSTALL_DIR) $(1)/bin
  124. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/
  125. endef
  126. $(eval $(call BuildPackage,libsysrepo))
  127. $(eval $(call BuildPackage,python3-sysrepo))
  128. $(eval $(call BuildPackage,sysrepo))
  129. $(eval $(call BuildPackage,sysrepoctl))
  130. $(eval $(call BuildPackage,sysrepocfg))