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.

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