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.

175 lines
5.2 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.7.4
  12. PKG_RELEASE:=3
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)?
  15. PKG_HASH:=238456bbb18149fd0fa5ebc9acb3c6e3129474c796db7447c2a95dcd40ab3084
  16. CMAKE_INSTALL:=1
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. ifeq ($(CONFIG_SYSREPO_PYTHON),y)
  22. $(call include_mk, python-package.mk)
  23. endif
  24. define Package/libsysrepo/config
  25. source "$(SOURCE)/Config_libsysrepo.in"
  26. endef
  27. PKG_BUILD_DEPENDS:=+SYSREPO_BINDINGS:swig/host
  28. define Package/libsysrepo
  29. SECTION:=utils
  30. CATEGORY:=Utilities
  31. URL:=$(PKG_SOURCE_URL)
  32. TITLE:=YANG-based data store library
  33. DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +SYSREPO_BINDINGS:libstdcpp +SYSREPO_PYTHON:python-base +SYSREPO_LUA:lua
  34. MENU:=1
  35. endef
  36. define Package/sysrepo
  37. SECTION:=utils
  38. CATEGORY:=Utilities
  39. URL:=$(PKG_SOURCE_URL)
  40. TITLE:=YANG-based data store daemon and plugin
  41. DEPENDS:=+libsysrepo
  42. endef
  43. define Package/sysrepoctl
  44. SECTION:=utils
  45. CATEGORY:=Utilities
  46. URL:=$(PKG_SOURCE_URL)
  47. TITLE:=sysrepo cli tool
  48. DEPENDS:=+libsysrepo
  49. endef
  50. define Package/sysrepocfg
  51. SECTION:=utils
  52. CATEGORY:=Utilities
  53. URL:=$(PKG_SOURCE_URL)
  54. TITLE:=sysrepo configuration tool
  55. DEPENDS:=+libsysrepo
  56. endef
  57. define Package/sysrepo/description
  58. Sysrepo is an YANG-based configuration and operational state data store for Unix/Linux applications.
  59. endef
  60. CMAKE_OPTIONS += \
  61. -DCMAKE_BUILD_TYPE:STRING=Release \
  62. -DUSE_AVL_LIB:BOOL=FALSE \
  63. -DENABLE_TESTS:BOOL=FALSE \
  64. -DBUILD_EXAMPLES:BOOL=FALSE \
  65. -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \
  66. -DGEN_LANGUAGE_BINDINGS:BOOL=FALSE \
  67. -DGEN_PYTHON_BINDINGS=0 \
  68. -DGEN_LUA_BINDINGS=0 \
  69. -DREPOSITORY_LOC:PATH=/etc/sysrepo \
  70. -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  71. -DENABLE_NACM:BOOL=FALSE \
  72. -DREQUEST_TIMEOUT=6 \
  73. -DLONG_REQUEST_TIMEOUT=30 \
  74. -DCOMMIT_VERIFY_TIMEOUT=20 \
  75. -DOPER_DATA_PROVIDE_TIMEOUT=4 \
  76. -DNOTIF_AGE_TIMEOUT=120 \
  77. -DNOTIF_TIME_WINDOW=20 \
  78. -DUSE_SR_MEM_MGMT=0
  79. ifeq ($(CONFIG_SYSREPO_LUA),y)
  80. CMAKE_OPTIONS += \
  81. -DGEN_LUA_BINDINGS:BOOL=TRUE \
  82. -DGEN_LUA_VERSION=5.1
  83. endif
  84. ifeq ($(CONFIG_SYSREPO_PYTHON),y)
  85. CMAKE_OPTIONS += \
  86. -DGEN_PYTHON_BINDINGS:BOOL=TRUE \
  87. -DGEN_PYTHON_VERSION=2
  88. endif
  89. ifeq ($(CONFIG_SYSREPO_BINDINGS),y)
  90. CMAKE_OPTIONS += \
  91. -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \
  92. -DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
  93. -DSWIG_DIR=$(STAGING_DIR)/host/share/swig
  94. endif
  95. define Package/libsysrepo/install
  96. $(INSTALL_DIR) $(1)/usr/lib
  97. $(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/
  98. $(INSTALL_DIR) $(1)/etc/sysrepo/yang/internal
  99. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-module-dependencies.yang $(1)/etc/sysrepo/yang/internal
  100. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-notification-store.yang $(1)/etc/sysrepo/yang/internal
  101. $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-persistent-data.yang $(1)/etc/sysrepo/yang/internal
  102. $(INSTALL_DIR) $(1)/etc/sysrepo/yang
  103. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-acm@2012-02-22.yang $(1)/etc/sysrepo/yang/ietf-netconf-acm@2012-02-22.yang
  104. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06.yang
  105. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/nc-notifications.yang $(1)/etc/sysrepo/yang/nc-notifications@2008-07-14.yang
  106. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/notifications.yang $(1)/etc/sysrepo/yang/notifications@2008-07-14.yang
  107. $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf@2011-06-01.yang $(1)/etc/sysrepo/yang/ietf-netconf@2011-06-01.yang
  108. $(INSTALL_DIR) $(1)/etc/sysrepo/data/internal
  109. $(INSTALL_DIR) $(1)/etc/sysrepo/data/notifications
  110. $(INSTALL_DIR) $(1)/etc/uci-defaults
  111. $(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
  112. ifeq ($(CONFIG_SYSREPO_PYTHON),y)
  113. $(INSTALL_DIR) $(1)/usr/lib
  114. $(CP) $(PKG_BUILD_DIR)/swig/libSysrepo-cpp.so* $(1)/usr/lib
  115. $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
  116. $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python2/libsysrepoPython2.py $(1)$(PYTHON_PKG_DIR)
  117. $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python2/_libsysrepoPython2.so $(1)$(PYTHON_PKG_DIR)
  118. endif
  119. ifeq ($(CONFIG_SYSREPO_LUA),y)
  120. $(INSTALL_DIR) $(1)/usr/lib/lua/
  121. $(CP) $(PKG_BUILD_DIR)/swig/lua/libSysrepo_Lua.so* $(1)/usr/lib
  122. $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/lua/libsysrepoLua.so $(1)/usr/lib/lua/libsysrepoLua.so
  123. endif
  124. endef
  125. define Package/sysrepo/install
  126. $(INSTALL_DIR) $(1)/bin
  127. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepod $(1)/bin/
  128. $(INSTALL_DIR) $(1)/bin
  129. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
  130. $(INSTALL_DIR) $(1)/etc/init.d/
  131. $(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo
  132. endef
  133. define Package/sysrepoctl/install
  134. $(INSTALL_DIR) $(1)/bin
  135. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepoctl $(1)/bin/
  136. endef
  137. define Package/sysrepocfg/install
  138. $(INSTALL_DIR) $(1)/bin
  139. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/
  140. endef
  141. $(eval $(call BuildPackage,libsysrepo))
  142. $(eval $(call BuildPackage,sysrepo))
  143. $(eval $(call BuildPackage,sysrepoctl))
  144. $(eval $(call BuildPackage,sysrepocfg))