Browse Source

add sysrepo

Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
lilik-openwrt-22.03
Mislav Novakovic 7 years ago
parent
commit
7720c87e0c
7 changed files with 15010 additions and 0 deletions
  1. +139
    -0
      net/sysrepo/Makefile
  2. +13
    -0
      net/sysrepo/files/libsysrepo.default
  3. +19
    -0
      net/sysrepo/files/sysrepo-plugind.init
  4. +19
    -0
      net/sysrepo/files/sysrepod.init
  5. +14782
    -0
      net/sysrepo/patches/001-protobuf-remove-protoc-command-from-cmake-file
  6. +26
    -0
      net/sysrepo/patches/002-remove-buildtime-module-install
  7. +12
    -0
      net/sysrepo/patches/003-missing-time-header

+ 139
- 0
net/sysrepo/Makefile View File

@ -0,0 +1,139 @@
#
# Copyright (C) 2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_LICENSE:=ASL-2.0
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_NAME:=sysrepo
PKG_VERSION:=0.6.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e4a5705a4c5293ba121048c71899b98243d99edf
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/sysrepo/sysrepo.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
CMAKE_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libsysrepo
SECTION:=util
CATEGORY:=Utilities
URL:=$(PKG_SOURCE_URL)
TITLE:=YANG-based data store library
DEPENDS:=+libyang +libprotobuf-c +libev +libavl
endef
define Package/sysrepod
SECTION:=util
CATEGORY:=Utilities
URL:=$(PKG_SOURCE_URL)
TITLE:=YANG-based data store daemon
DEPENDS:=+libsysrepo
endef
define Package/sysrepoctl
SECTION:=util
CATEGORY:=Utilities
URL:=$(PKG_SOURCE_URL)
TITLE:=sysrepo cli tool
DEPENDS:=+libsysrepo
endef
define Package/sysrepocfg
SECTION:=util
CATEGORY:=Utilities
URL:=$(PKG_SOURCE_URL)
TITLE:=sysrepo configuration tool
DEPENDS:=+libsysrepo
endef
define Package/sysrepo-plugind
SECTION:=util
CATEGORY:=Utilities
URL:=$(PKG_SOURCE_URL)
TITLE:=sysrepo plugin daemon
DEPENDS:=+libsysrepo
endef
define Package/sysrepo/description
Sysrepo is an YANG-based configuration and operational state data store for Unix/Linux applications.
endef
CMAKE_OPTIONS += \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DENABLE_TESTS:BOOL=FALSE \
-DBUILD_EXAMPLES:BOOL=FALSE \
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \
-DGEN_LANGUAGE_BINDINGS:BOOL=FALSE \
-DREPOSITORY_LOC:PATH=/etc/sysrepo \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DENABLE_NACM:BOOL=FALSE
define Package/libsysrepo/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/sysrepo/yang/internal
$(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-module-dependencies.yang $(1)/etc/sysrepo/yang/internal
$(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-notification-store.yang $(1)/etc/sysrepo/yang/internal
$(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-persistent-data.yang $(1)/etc/sysrepo/yang/internal
$(INSTALL_DIR) $(1)/etc/sysrepo/yang
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-acm@2012-02-22.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/nc-notifications.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/notifications.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf@2011-06-01.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DIR) $(1)/etc/sysrepo/data/internal
$(INSTALL_DIR) $(1)/etc/sysrepo/data/notifications
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
endef
define Package/sysrepod/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepod $(1)/bin/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) ./files/sysrepod.init $(1)/etc/init.d/sysrepod
endef
define Package/sysrepoctl/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepoctl $(1)/bin/
endef
define Package/sysrepocfg/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/
endef
define Package/sysrepo-plugind/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) ./files/sysrepo-plugind.init $(1)/etc/init.d/sysrepo-plugind
endef
$(eval $(call BuildPackage,libsysrepo))
$(eval $(call BuildPackage,sysrepod))
$(eval $(call BuildPackage,sysrepoctl))
$(eval $(call BuildPackage,sysrepocfg))
$(eval $(call BuildPackage,sysrepo-plugind))

+ 13
- 0
net/sysrepo/files/libsysrepo.default View File

@ -0,0 +1,13 @@
#!/bin/sh
# Warning, problems can occur if the device restarts in the middle of this uci-default script
if [ -x /bin/sysrepoctl ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-acm@2012-02-22.yang -p 644
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-notifications.yang -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/nc-notifications.yang -p 666
sysrepoctl --install --yang=/etc/sysrepo/yang/notifications.yang -p 666
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf@2011-06-01.yang -p 600
fi
exit 0

+ 19
- 0
net/sysrepo/files/sysrepo-plugind.init View File

@ -0,0 +1,19 @@
#!/bin/sh /etc/rc.common
START=90
STOP=10
USE_PROCD=1
PROG=/bin/sysrepo-plugind
start_service() {
procd_open_instance
procd_set_param command $PROG
procd_set_param respawn
procd_close_instance
}
stop_service()
{
service_stop ${PROG}
}

+ 19
- 0
net/sysrepo/files/sysrepod.init View File

@ -0,0 +1,19 @@
#!/bin/sh /etc/rc.common
START=70
STOP=10
USE_PROCD=1
PROG=/bin/sysrepod
start_service() {
procd_open_instance
procd_set_param command $PROG
procd_set_param respawn
procd_close_instance
}
stop_service()
{
service_stop ${PROG}
}

+ 14782
- 0
net/sysrepo/patches/001-protobuf-remove-protoc-command-from-cmake-file
File diff suppressed because it is too large
View File


+ 26
- 0
net/sysrepo/patches/002-remove-buildtime-module-install View File

@ -0,0 +1,26 @@
Index: sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/CMakeLists.txt
===================================================================
--- sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf.orig/CMakeLists.txt
+++ sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/CMakeLists.txt
@@ -280,7 +280,7 @@ install (FILES ${INTERNAL_YANGS} DESTINA
# install NACM YANG module
if(ENABLE_NACM)
- INSTALL_YANG("ietf-netconf-acm" "@2012-02-22" "644")
+ # INSTALL_YANG("ietf-netconf-acm" "@2012-02-22" "644")
endif(ENABLE_NACM)
find_package(PkgConfig QUIET)
@@ -304,9 +304,9 @@ if(WITH_SYSTEMD)
FILES_MATCHING PATTERN "*.service")
endif()
-INSTALL_YANG("ietf-netconf-notifications" "" "666")
-INSTALL_YANG("nc-notifications" "" "666")
-INSTALL_YANG("notifications" "" "666")
+# INSTALL_YANG("ietf-netconf-notifications" "" "666")
+# INSTALL_YANG("nc-notifications" "" "666")
+# INSTALL_YANG("notifications" "" "666")
if(GEN_LANGUAGE_BINDINGS)
add_subdirectory(swig)

+ 12
- 0
net/sysrepo/patches/003-missing-time-header View File

@ -0,0 +1,12 @@
Index: sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/inc/sysrepo.h
===================================================================
--- sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf.orig/inc/sysrepo.h
+++ sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/inc/sysrepo.h
@@ -51,6 +51,7 @@
* @ref xp_page "XPath Addressing" is used for node identification in data-related calls.
*/
+#include <time.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

Loading…
Cancel
Save