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.

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