PKG_NAME:=sysrepo
PKG_VERSION:=0.7.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)?
CMAKE_INSTALL:=1
PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=SYSREPO_BINDINGS:swig/host
+PKG_BUILD_DEPENDS:=swig/host
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
-ifeq ($(CONFIG_SYSREPO_PYTHON),y)
-$(call include_mk, python3-package.mk)
-endif
-
-define Package/libsysrepo/config
- source "$(SOURCE)/Config_libsysrepo.in"
-endef
+include ../../lang/python/python3-package.mk
define Package/libsysrepo
SECTION:=libs
CATEGORY:=Libraries
TITLE:=YANG-based data store library
URL:=https://www.sysrepo.org/
- DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +libpthread +SYSREPO_BINDINGS:libstdcpp +SYSREPO_PYTHON:python3-base +SYSREPO_LUA:lua
- MENU:=1
+ DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +libpthread
+endef
+
+define Package/python3-sysrepo
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=YANG-based data store library - Python 3 bindings
+ URL:=https://www.sysrepo.org/
+ DEPENDS:=+libsysrepo +libstdcpp +python3-base
endef
define Package/sysrepo
Sysrepo is an YANG-based configuration and operational state data store for Unix/Linux applications.
endef
+SWIG_VERSION:=4.0.1
+
CMAKE_OPTIONS += \
-DUSE_AVL_LIB:BOOL=FALSE \
-DENABLE_TESTS:BOOL=FALSE \
-DBUILD_EXAMPLES:BOOL=FALSE \
- -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \
- -DGEN_LANGUAGE_BINDINGS:BOOL=FALSE \
- -DGEN_PYTHON_BINDINGS=0 \
- -DGEN_LUA_BINDINGS=0 \
-DREPOSITORY_LOC:PATH=/etc/sysrepo \
-DENABLE_NACM:BOOL=FALSE \
-DREQUEST_TIMEOUT=6 \
-DNOTIF_AGE_TIMEOUT=120 \
-DNOTIF_TIME_WINDOW=20 \
-DUSE_SR_MEM_MGMT=0 \
- -DFILE_FORMAT_EXT:STRING=xml
-
-ifeq ($(CONFIG_SYSREPO_LUA),y)
-CMAKE_OPTIONS += \
- -DGEN_LUA_BINDINGS:BOOL=TRUE \
- -DGEN_LUA_VERSION=5.1
-endif
-
-ifeq ($(CONFIG_SYSREPO_PYTHON),y)
-CMAKE_OPTIONS += \
- -DGEN_PYTHON_BINDINGS:BOOL=TRUE \
- -DGEN_PYTHON_VERSION=3 \
- -DGEN_PYTHON3_TESTS:BOOL=FALSE
-endif
-
-ifeq ($(CONFIG_SYSREPO_BINDINGS),y)
-CMAKE_OPTIONS += \
+ -DFILE_FORMAT_EXT:STRING=xml \
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \
-DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
- -DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/share/swig \
+ -DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/share/swig/$(SWIG_VERSION) \
-DSWIG_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/swig \
- -DCALL_TARGET_BINS_DIRECTLY=OFF
-endif
+ -DCALL_TARGET_BINS_DIRECTLY=OFF \
+ -DGEN_PYTHON_BINDINGS:BOOL=TRUE \
+ -DGEN_PYTHON_VERSION=3 \
+ -DGEN_PYTHON3_TESTS:BOOL=FALSE
define Package/libsysrepo/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
+endef
-ifeq ($(CONFIG_SYSREPO_PYTHON),y)
+define Package/python3-sysrepo/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/swig/libSysrepo-cpp.so* $(1)/usr/lib
- $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python3/libsysrepoPython3.py $(1)$(PYTHON_PKG_DIR)
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python3/_libsysrepoPython3.so $(1)$(PYTHON_PKG_DIR)
-endif
-
-ifeq ($(CONFIG_SYSREPO_LUA),y)
- $(INSTALL_DIR) $(1)/usr/lib/lua/
- $(CP) $(PKG_BUILD_DIR)/swig/lua/libSysrepo_Lua.so* $(1)/usr/lib
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/lua/libsysrepoLua.so $(1)/usr/lib/lua/libsysrepoLua.so
-endif
+ $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python/sysrepo.py $(1)$(PYTHON3_PKG_DIR)
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python/_sysrepo.so $(1)$(PYTHON3_PKG_DIR)
endef
define Package/sysrepo/install
endef
$(eval $(call BuildPackage,libsysrepo))
+$(eval $(call BuildPackage,python3-sysrepo))
$(eval $(call BuildPackage,sysrepo))
$(eval $(call BuildPackage,sysrepoctl))
$(eval $(call BuildPackage,sysrepocfg))