Skip to contentSkip to conversation

Add netopeer2 package (and dependencies)

PATCH New Heiko Thiery 2 participants 8 messages Oct 28, 2019 – Oct 29, 2019

lore
Share & tools
lore
#0 lore raw

v5 cover Add netopeer2 package (and dependencies)

From: Heiko Thiery <[email protected]>

This patchset contains the netopeer2 package and the required dependencies. Netopeer2 is a set of tools implementing network configuration tools based on the NETCONF Protocol.

This includes the packages for sysrepo, netopeer2-server, netopeer2-cli, netopeer2-keystored.

Also add the host target support for libev. This is needed for the install steps of sysrepo and netopeer2-server and netopeer2-keystored.

---
Changes v1 -> v2:
- replace libredblack with libavl because this is also supported by debian.
- changes all over the place to integrate review comments.

Changes v2 -> v3:
- download the netopeer2 sources only once for the packages netopeer2-cli, netopeer2-keystored and netopeer2-server. Use the same value in <pkg>_DL_SUBDIR and <pkg>_SOURCE for all 3 packages.
- add sysv init scripts for netopeer-server, sysrepod and syrepo-plugind.
- changes all over the place to integrate review comments.

Changes v3 -> v4:
- add config option for sysrepo examples
- remove select of BR2_PACKAGE_NETOPEER2_SERVER_TLS in netopeer2-server because it creates a recursive dependency.

Changes v4 -> v5:
- fix up the 'v' prefix in the versions
- sysrepo: fix REPOSITORY_LOC not to install in staging for host build
- sysrepo: disable building python/cpp buildings
- sysrepo: fix indentations in init scripts
- sysrepo: fix alphabetic sorting issue in Config.in
- sysrepo: move comment to the end of Config.in
- sysrepo: drop config option for host gcc version
- netopeer2: drop config option for host gcc version
- netopeer2: move comment to the end of Config.in

Heiko Thiery (5):
package/libev: use host-autotools-package macro
package/sysrepo: add package
package/netopeer2-keystored: add package
package/netopeer2-server: add package
package/netopeer2-cli: add package

 DEVELOPERS                                    |  4 +
 package/Config.in                             |  4 +
 package/libev/libev.mk                        |  1 +
 package/netopeer2-cli/Config.in               | 21 +++++
 package/netopeer2-cli/netopeer2-cli.hash      |  1 +
 package/netopeer2-cli/netopeer2-cli.mk        | 17 ++++
 package/netopeer2-keystored/Config.in         | 17 ++++
 .../netopeer2-keystored.hash                  |  2 +
 .../netopeer2-keystored.mk                    | 31 +++++++
 package/netopeer2-server/Config.in            | 51 +++++++++++
 package/netopeer2-server/S52netopeer2-server  | 90 +++++++++++++++++++
 .../netopeer2-server/netopeer2-server.hash    |  1 +
 package/netopeer2-server/netopeer2-server.mk  | 33 +++++++
 ...espect-CMAKE_INSTALL_PREFIX-and-DEST.patch | 33 +++++++
 ...t-make-systemd-unit-dir-configurable.patch | 40 +++++++++
 package/sysrepo/Config.in                     | 35 ++++++++
 package/sysrepo/S50sysrepod                   | 45 ++++++++++
 package/sysrepo/S51sysrepo-plugind            | 50 +++++++++++
 package/sysrepo/sysrepo.hash                  |  2 +
 package/sysrepo/sysrepo.mk                    | 60 +++++++++++++
 20 files changed, 538 insertions(+)
 create mode 100644 package/netopeer2-cli/Config.in
 create mode 120000 package/netopeer2-cli/netopeer2-cli.hash
 create mode 100644 package/netopeer2-cli/netopeer2-cli.mk
 create mode 100644 package/netopeer2-keystored/Config.in
 create mode 100644 package/netopeer2-keystored/netopeer2-keystored.hash
 create mode 100644 package/netopeer2-keystored/netopeer2-keystored.mk
 create mode 100644 package/netopeer2-server/Config.in
 create mode 100644 package/netopeer2-server/S52netopeer2-server
 create mode 120000 package/netopeer2-server/netopeer2-server.hash
 create mode 100644 package/netopeer2-server/netopeer2-server.mk
 create mode 100644 package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch
 create mode 100644 package/sysrepo/0002-CMakeLists.txt-make-systemd-unit-dir-configurable.patch
 create mode 100644 package/sysrepo/Config.in
 create mode 100644 package/sysrepo/S50sysrepod
 create mode 100644 package/sysrepo/S51sysrepo-plugind
 create mode 100644 package/sysrepo/sysrepo.hash
 create mode 100644 package/sysrepo/sysrepo.mk
Signature · 1 line
2.20.1
#1 lore raw

PATCH v5 1/5 package/libev: use host-autotools-package macro

From: Heiko Thiery <[email protected]>

Enable host support for the lib because the package host-sysrepo (depends on package libnetconf2) is needed by package netopeer2keystored.

---
 package/libev/libev.mk | 1 +
 1 file changed, 1 insertion(+)
package/libev/libev.mk +1 -0
index 2b2d5db004..38b0530f62 100644
@@ -18,3 +18,4 @@ endef
 LIBEV_POST_PATCH_HOOKS += LIBEV_DISABLE_EVENT_H_INSTALL
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.20.1
#2 lore raw

PATCH v5 1/5 package/libev: use host-autotools-package macro

Quoted 6 lines · Heiko Thiery

From: Heiko Thiery <[email protected]>

Enable host support for the lib because the package host-sysrepo (depends on package libnetconf2) is needed by package netopeer2keystored.

Applied to master, thanks.

Regards,
Arnout

Quoted 14 lines
---
 package/libev/libev.mk | 1 +
 1 file changed, 1 insertion(+)
package/libev/libev.mk +1 -0
index 2b2d5db004..38b0530f62 100644
@@ -18,3 +18,4 @@ endef
 LIBEV_POST_PATCH_HOOKS += LIBEV_DISABLE_EVENT_H_INSTALL
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
#3 lore raw

PATCH v5 2/5 package/sysrepo: add package

In reply to Heiko Thiery

From: Heiko Thiery <[email protected]>

sysrepo is a YANG-based configuration and operational state data store for Unix/Linux applications. It is a dependency of Netopeer, a NETCONF server.

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...espect-CMAKE_INSTALL_PREFIX-and-DEST.patch | 33 ++++++++++
 ...t-make-systemd-unit-dir-configurable.patch | 40 +++++++++++++
 package/sysrepo/Config.in                     | 35 +++++++++++
 package/sysrepo/S50sysrepod                   | 45 ++++++++++++++
 package/sysrepo/S51sysrepo-plugind            | 50 ++++++++++++++++
 package/sysrepo/sysrepo.hash                  |  2 +
 package/sysrepo/sysrepo.mk                    | 60 +++++++++++++++++++
 9 files changed, 267 insertions(+)
 create mode 100644 package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch
 create mode 100644 package/sysrepo/0002-CMakeLists.txt-make-systemd-unit-dir-configurable.patch
 create mode 100644 package/sysrepo/Config.in
 create mode 100644 package/sysrepo/S50sysrepod
 create mode 100644 package/sysrepo/S51sysrepo-plugind
 create mode 100644 package/sysrepo/sysrepo.hash
 create mode 100644 package/sysrepo/sysrepo.mk
DEVELOPERS +1 -0
index f41ac5f096..6f6b768e0d 100644
@@ -1048,6 +1048,7 @@ F:	package/python-sip/
 N:	Heiko Thiery <[email protected]>
 F:	package/libnetconf2/
 F:	package/libyang/
+F:	package/sysrepo/
 
 N:	Henrique Camargo <[email protected]>
 F:	package/json-glib/
package/Config.in +1 -0
index a1ac5069aa..ae1c5013b6 100644
@@ -1680,6 +1680,7 @@ menu "Networking"
 	source "package/slirp/Config.in"
 	source "package/snmppp/Config.in"
 	source "package/sofia-sip/Config.in"
+	source "package/sysrepo/Config.in"
 	source "package/thrift/Config.in"
 	source "package/usbredir/Config.in"
 	source "package/wampcc/Config.in"
package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch new file +33 -0
new file mode 100644
index 0000000000..5cb3606475
@@ -0,0 +1,33 @@
+From c4a2195febbd5d436f8de79d8391d8da9aa60ac4 Mon Sep 17 00:00:00 2001
+From: Michael Walle <[email protected]>
+Date: Thu, 10 Oct 2019 14:58:16 +0200
+Subject: [PATCH 1/2] CMakeLists.txt: respect CMAKE_INSTALL_PREFIX and DESTDIR
+
+Don't use absolute pathnames in the install function. This way the files
+will be installed in the correct location even if CMAKE_INSTALL_PREFIX
+and DESTDIR are changed.
+
+Patch comes from upstream pull-request:
+https://github.com/sysrepo/sysrepo/pull/1638
+
+Signed-off-by: Heiko Thiery <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e4521088..14b7cd36 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -357,7 +357,7 @@ if(WITH_SYSTEMD)
+         ${PROJECT_SOURCE_DIR}/deploy/systemd/sysrepod.service
+         ${PROJECT_SOURCE_DIR}/deploy/systemd/sysrepo-plugind.service
+     )
+-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/deploy/systemd/ DESTINATION "/lib/systemd/system"
++    install(DIRECTORY ${PROJECT_SOURCE_DIR}/deploy/systemd/ DESTINATION "lib/systemd/system"
+         FILES_MATCHING PATTERN "*.service")
+ endif()
+ 
+-- 
+2.20.1
+
package/sysrepo/0002-CMakeLists.txt-make-systemd-unit-dir-configurable.patch new file +40 -0
new file mode 100644
index 0000000000..3ab75f7957
@@ -0,0 +1,40 @@
+From 906927b4ee2dd0d5bd669d193fc851d14919fbd1 Mon Sep 17 00:00:00 2001
+From: Michael Walle <[email protected]>
+Date: Thu, 10 Oct 2019 14:38:57 +0200
+Subject: [PATCH 2/2] CMakeLists.txt: make systemd unit dir configurable
+
+Patch comes from upstream pull-request:
+https://github.com/sysrepo/sysrepo/pull/1638
+
+Signed-off-by: Heiko Thiery <[email protected]>
+---
+ CMakeLists.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 14b7cd36..14c84675 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -217,6 +217,9 @@ else()
+     message(FATAL_ERROR "Unknown file format \"${FILE_FORMAT_EXT}\", must be json, xml, or lyb.")
+ endif()
+ 
++set(SYSTEMD_UNIT_DIR "lib/systemd/system/" CACHE STRING
++    "Path to the systemd service directory.")
++
+ # timeouts
+ set(REQUEST_TIMEOUT 15 CACHE STRING
+     "Timeout (in seconds) for Sysrepo API requests. Set to 0 for no timeout.")
+@@ -357,7 +360,8 @@ if(WITH_SYSTEMD)
+         ${PROJECT_SOURCE_DIR}/deploy/systemd/sysrepod.service
+         ${PROJECT_SOURCE_DIR}/deploy/systemd/sysrepo-plugind.service
+     )
+-    install(DIRECTORY ${PROJECT_SOURCE_DIR}/deploy/systemd/ DESTINATION "lib/systemd/system"
++    install(DIRECTORY ${PROJECT_SOURCE_DIR}/deploy/systemd/
++        DESTINATION "${SYSTEMD_UNIT_DIR}"
+         FILES_MATCHING PATTERN "*.service")
+ endif()
+ 
+-- 
+2.20.1
+
package/sysrepo/Config.in new file +35 -0
new file mode 100644
index 0000000000..c2aac81ce9
@@ -0,0 +1,35 @@
+config BR2_PACKAGE_SYSREPO
+	bool "sysrepo"
+	depends on BR2_USE_MMU # libnetconf2
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" # host-protbuf
+	select BR2_PACKAGE_LIBAVL
+	select BR2_PACKAGE_LIBEV
+	select BR2_PACKAGE_LIBNETCONF2
+	select BR2_PACKAGE_LIBYANG
+	select BR2_PACKAGE_PCRE
+	select BR2_PACKAGE_PCRE_UCP
+	select BR2_PACKAGE_PROTOBUF_C
+	help
+	  Sysrepo is an YANG-based configuration and operational state
+	  data store for Unix/Linux applications.
+
+	  https://github.com/sysrepo
+
+if BR2_PACKAGE_SYSREPO
+
+config BR2_PACKAGE_SYSREPO_EXAMPLES
+	bool "enable examples"
+	help
+	  Enable sysrepo examples.
+
+endif
+
+comment "sysrepo needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8"
+	depends on BR2_USE_MMU
+	depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP \
+		|| !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
package/sysrepo/S50sysrepod new file +45 -0

45 lines not on this page · raw message

package/sysrepo/S51sysrepo-plugind new file +50 -0

50 lines not on this page · raw message

package/sysrepo/sysrepo.hash new file +2 -0
new file mode 100644
index 0000000000..48d8290797
@@ -0,0 +1,2 @@
+sha256 d3066c1776a6727b96bbb3517eb646d0bb6037e8e1addcbe873cae590493843e  sysrepo-0.7.8.tar.gz
+sha256 28a773bfffa828ec38c030fc8ace5f3aeb90926ec1309bbd135441c4387ce3cd  LICENSE
package/sysrepo/sysrepo.mk new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.20.1
#4 lore raw

PATCH v5 2/5 package/sysrepo: add package

Quoted 7 lines · Heiko Thiery

From: Heiko Thiery <[email protected]>

sysrepo is a YANG-based configuration and operational state data store for Unix/Linux applications. It is a dependency of Netopeer, a NETCONF server.

Applied to master, thanks, but still with a number of modifications.

Regards,
Arnout

[snip]

package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch line 4

Quoted 4 lines
package/sysrepo/0001-CMakeLists.txt-respect-CMAKE_INSTALL_PREFIX-and-DEST.patch new file +4 -0
+From c4a2195febbd5d436f8de79d8391d8da9aa60ac4 Mon Sep 17 00:00:00 2001
+From: Michael Walle <[email protected]>
+Date: Thu, 10 Oct 2019 14:58:16 +0200
+Subject: [PATCH 1/2] CMakeLists.txt: respect CMAKE_INSTALL_PREFIX and DESTDIR

As reported by check-package, the 1/2 shouldn't be there.

[snip]

package/sysrepo/Config.in line 6

Quoted 12 lines
package/sysrepo/Config.in new file +6 -0
new file mode 100644
index 0000000000..c2aac81ce9
@@ -0,0 +1,35 @@
+config BR2_PACKAGE_SYSREPO
+	bool "sysrepo"
+	depends on BR2_USE_MMU # libnetconf2
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS

I double-checked that all of the above dependencies really come from the
package itself and are not just from libnetconf2.

package/sysrepo/Config.in line 15

Quoted 9 lines
package/sysrepo/Config.in new file +9 -0
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" # host-protbuf
+	select BR2_PACKAGE_LIBAVL
+	select BR2_PACKAGE_LIBEV
+	select BR2_PACKAGE_LIBNETCONF2
+	select BR2_PACKAGE_LIBYANG
+	select BR2_PACKAGE_PCRE
+	select BR2_PACKAGE_PCRE_UCP
+	select BR2_PACKAGE_PROTOBUF_C

I have not checked if any of the above carried more dependencies. Probably not.

Quoted 26 lines
package/sysrepo/Config.in new file +20 -0
+	help
+	  Sysrepo is an YANG-based configuration and operational state
+	  data store for Unix/Linux applications.
+
+	  https://github.com/sysrepo
+
+if BR2_PACKAGE_SYSREPO
+
+config BR2_PACKAGE_SYSREPO_EXAMPLES
+	bool "enable examples"
+	help
+	  Enable sysrepo examples.
+
+endif
+
+comment "sysrepo needs a toolchain w/ C++, threads, dynamic library, gcc >= 4.8"
+	depends on BR2_USE_MMU
+	depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP \
+		|| !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
package/sysrepo/S50sysrepod new file +0 -0
new file mode 100644
index 0000000000..2a3c6c9cf5

package/sysrepo/S50sysrepod line 7

Quoted 7 lines
package/sysrepo/S50sysrepod new file +7 -0
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+DAEMON="sysrepod"
+PIDFILE="/var/run/$DAEMON.pid"
+
+SYSREPOD_ARGS=""
+

You forgot to source /etc/default/$DAEMON here.

Which makes me wonder: on which example did you base this?

package/sysrepo/S50sysrepod line 10

Quoted 3 lines
package/sysrepo/S50sysrepod new file +3 -0
+start() {
+	printf 'Starting %s: ' "$DAEMON"
+	start-stop-daemon -S -b -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \

This can't work. sysrepod daemonizes by itself, so the -b is not needed and the
-p would create a race condition between start-stop-daemon and sysrepod writing to the same file. So I've removed the -b and -p options. I haven't tested this, but I guess you haven't either :-)

IMO, if you're in a situation that you can't (easily) test a start script, it's
better to not provide one instead of providing an incorrect one :-)

Quoted 121 lines
package/sysrepo/S50sysrepod new file +35 -0
+		-- $SYSREPOD_ARGS
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo "OK"
+	else
+		echo "FAIL"
+	fi
+	return "$status"
+}
+
+stop() {
+	printf 'Stopping %s: ' "$DAEMON"
+	start-stop-daemon -K -q -p "$PIDFILE"
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo "OK"
+	else
+		echo "FAIL"
+	fi
+	return "$status"
+}
+
+restart() {
+	stop
+	sleep 1
+	start
+}
+
+case "$1" in
+	start|stop|restart)
+		"$1";;
+	*)
+		echo "Usage: $0 {start|stop|restart}"
+		exit 1
+esac
package/sysrepo/S51sysrepo-plugind new file +50 -0
new file mode 100644
index 0000000000..7463712961
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+DAEMON="sysrepo-plugind"
+PIDFILE="/var/run/$DAEMON.pid"
+
+SYSREPO_PLUGIND_ARGS=""
+
+start() {
+	printf 'Starting %s: ' "$DAEMON"
+	start-stop-daemon -S -b -q -p $PIDFILE -x "/usr/bin/$DAEMON" \
+		-- $SYSREPO_PLUGIND_ARGS
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo "OK"
+	else
+		echo "FAIL"
+	fi
+	return "$status"
+}
+
+stop() {
+	printf 'Stopping %s: ' "$DAEMON"
+	start-stop-daemon -K -q -p $PIDFILE
+	status=$?
+	if [ "$status" -eq 0 ]; then
+		echo "OK"
+	else
+		echo "FAIL"
+	fi
+	return "$status"
+}
+
+restart() {
+	stop
+	sleep 1
+	start
+}
+
+reload() {
+	# we do not support real reload .. just restart
+	restart
+}
+
+case "$1" in
+    start|stop|restart|reload)
+		"$1";;
+	*)
+		echo "Usage: $0 {start|stop|restart|reload}"
+		exit 1
+esac
package/sysrepo/sysrepo.hash new file +2 -0
new file mode 100644
index 0000000000..48d8290797
@@ -0,0 +1,2 @@
+sha256 d3066c1776a6727b96bbb3517eb646d0bb6037e8e1addcbe873cae590493843e  sysrepo-0.7.8.tar.gz
+sha256 28a773bfffa828ec38c030fc8ace5f3aeb90926ec1309bbd135441c4387ce3cd  LICENSE
package/sysrepo/sysrepo.mk new file +16 -0
new file mode 100644
index 0000000000..31317d6236
@@ -0,0 +1,60 @@
+################################################################################
+#
+# sysrepo
+#
+################################################################################
+
+SYSREPO_VERSION = 0.7.8
+SYSREPO_SITE = $(call github,sysrepo,sysrepo,v$(SYSREPO_VERSION))
+SYSREPO_INSTALL_STAGING = YES
+SYSREPO_LICENSE = Apache-2.0
+SYSREPO_LICENSE_FILES = LICENSE
+SYSREPO_DEPENDENCIES = libev libnetconf2 libavl libyang pcre protobuf-c host-sysrepo
+HOST_SYSREPO_DEPENDENCIES = host-libev host-libnetconf2 host-libavl host-libyang host-pcre host-protobuf-c
+
+SYSREPO_CONF_OPTS = \
+	-DGEN_PYTHON2_TESTS=OFF \

package/sysrepo/sysrepo.mk line 26

Quoted 10 lines
package/sysrepo/sysrepo.mk new file +10 -0
+	-DENABLE_TESTS=OFF \
+	-DGEN_CPP_BINDINGS=OFF \
+	-DGEN_LANGUAGE_BINDINGS=OFF \
+	-DGEN_PYTHON_BINDINGS=OFF \
+	-DBUILD_CPP_EXAMPLES=OFF \
+	-DCALL_SYSREPOCTL_BIN=$(HOST_DIR)/bin/sysrepoctl \
+	-DCALL_SYSREPOCFG_BIN=$(HOST_DIR)/bin/sysrepocfg \
+	-DBUILD_EXAMPLES=$(if $(BR2_PACKAGE_SYSREPO_EXAMPLES),ON,OFF) \
+	$(if $(BR2_INIT_SYSTEMD),-DWITH_SYSTEMD=ON) \
+	$(if $(BR2_INIT_SYSTEMD),-DSYSTEMD_UNIT_DIR=usr/lib/systemd/system)

I don't understand why this is needed. It is the default, no? OK, without the
usr bit, but systemd requires merged /usr so that doesn't matter.

package/sysrepo/sysrepo.mk line 30

Quoted 4 lines
package/sysrepo/sysrepo.mk new file +4 -0
+
+# On ARM, this is needed to prevent unaligned memory access with an optimized
+# build .. https://github.com/sysrepo/sysrepo/issues/947
+SYSREPO_CONF_OPTS += -DUSE_SR_MEM_MGMT=OFF

I first thought, why not do this on ARM only. But looking at the bug report, I
wouldn't trust this memory management feature on any platform :-)

Quoted 17 lines
package/sysrepo/sysrepo.mk new file +17 -0
+
+define SYSREPO_INSTALL_INIT_SYSV
+	$(INSTALL) -m 755 -D package/sysrepo/S50sysrepod \
+		$(TARGET_DIR)/etc/init.d/S50sysrepod
+	$(INSTALL) -m 755 -D package/sysrepo/S51sysrepo-plugind \
+		$(TARGET_DIR)/etc/init.d/S51sysrepo-plugind
+endef
+
+define SYSREPO_INSTALL_INIT_SYSTEMD
+	mkdir -p $(TARGET_DIR)/etc/systemd/systemd/multi-user.target.wants
+	ln -fs ../../../../usr/lib/systemd/system/sysrepod.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../../../../usr/lib/systemd/system/sysrepo-plugind.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+endef
+
+HOST_SYSREPO_CONF_OPTS = \

package/sysrepo/sysrepo.mk line 57

Quoted 10 lines
package/sysrepo/sysrepo.mk new file +10 -0
+	-DGEN_PYTHON2_TESTS=OFF \
+	-DENABLE_TESTS=OFF \
+	-DGEN_CPP_BINDINGS=OFF \
+	-DGEN_LANGUAGE_BINDINGS=OFF \
+	-DGEN_PYTHON_BINDINGS=OFF \
+	-DCALL_TARGET_BINS_DIRECTLY=OFF \
+	-DBUILD_EXAMPLES=OFF \
+	-DBUILD_CPP_EXAMPLES=OFF \
+	-DREPOSITORY_LOC=$(HOST_DIR)/etc/sysrepo \
+	-DSUBSCRIPTIONS_SOCKET_DIR=$(HOST_DIR)/var/run/sysrepo-subscriptions

I'm surprised the latter two are needed, I would expect them to default to
something under the install prefix. But ok.

Regards,
Arnout

Quoted 4 lines
package/sysrepo/sysrepo.mk new file +3 -0
+
+$(eval $(cmake-package))
+$(eval $(host-cmake-package))
#5 lore raw

PATCH v5 3/5 package/netopeer2-keystored: add package

In reply to Heiko Thiery

From: Heiko Thiery <[email protected]>

netopeer2 keystored plugin.

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 package/netopeer2-keystored/Config.in         | 17 ++++++++++
 .../netopeer2-keystored.hash                  |  2 ++
 .../netopeer2-keystored.mk                    | 31 +++++++++++++++++++
 5 files changed, 52 insertions(+)
 create mode 100644 package/netopeer2-keystored/Config.in
 create mode 100644 package/netopeer2-keystored/netopeer2-keystored.hash
 create mode 100644 package/netopeer2-keystored/netopeer2-keystored.mk
DEVELOPERS +1 -0
index 6f6b768e0d..0f0089dfaf 100644
@@ -1048,6 +1048,7 @@ F:	package/python-sip/
 N:	Heiko Thiery <[email protected]>
 F:	package/libnetconf2/
 F:	package/libyang/
+F:	package/netopeer2-keystored/
 F:	package/sysrepo/
 
 N:	Henrique Camargo <[email protected]>
package/Config.in +1 -0
index ae1c5013b6..1fcd7dd2d7 100644
@@ -1659,6 +1659,7 @@ menu "Networking"
 	source "package/mongoose/Config.in"
 	source "package/nanomsg/Config.in"
 	source "package/neon/Config.in"
+	source "package/netopeer2-keystored/Config.in"
 	source "package/nghttp2/Config.in"
 	source "package/norm/Config.in"
 	source "package/nss-mdns/Config.in"
package/netopeer2-keystored/Config.in new file +17 -0
new file mode 100644
index 0000000000..d23ec2f1b9
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_NETOPEER2_KEYSTORED
+	bool "netopeer2-keystored"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_STATIC_LIBS
+	select BR2_PACKAGE_LIBYANG
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_SYSREPO
+	help
+	  Netopeer2 is a set of tools implementing network
+	  configuration tools based on the NETCONF Protocol.
+
+	  This is the keystored sysrepo plugin.
+
+	  https://github.com/CESNET/Netopeer2
+
+comment "needs a toolchain w/ threads, dynamic libraray"
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
package/netopeer2-keystored/netopeer2-keystored.hash new file +2 -0
new file mode 100644
index 0000000000..2ad5db9260
@@ -0,0 +1,2 @@
+sha256 59688271be4fecbbee671fc7eb3dc0538b13b4baab53e923e26eaeb33e6f7ec0  netopeer2-0.7-r2.tar.gz
+sha256 932b75a8610a5c58e0fe0f70f8e4ebbcf3a2392acc16a88e95aebcdbdb9245e0  LICENSE
package/netopeer2-keystored/netopeer2-keystored.mk new file +31 -0
new file mode 100644
index 0000000000..65a4c799b7
@@ -0,0 +1,31 @@
+################################################################################
+#
+# netopeer2-keystored
+#
+################################################################################
+
+NETOPEER2_KEYSTORED_VERSION = 0.7-r2
+NETOPEER2_KEYSTORED_SOURCE = netopeer2-$(NETOPEER2_KEYSTORED_VERSION).tar.gz
+NETOPEER2_KEYSTORED_SITE = $(call github,CESNET,Netopeer2,v$(NETOPEER2_KEYSTORED_VERSION))
+NETOPEER2_KEYSTORED_DL_SUBDIR = netopeer2
+NETOPEER2_KEYSTORED_SUBDIR = keystored
+NETOPEER2_KEYSTORED_LICENSE = BSD-3-Clause
+NETOPEER2_KEYSTORED_LICENSE_FILES = LICENSE
+NETOPEER2_KEYSTORED_DEPENDENCIES = host-sysrepo sysrepo
+
+NETOPEER2_KEYSTORED_CONF_OPTS = \
+	-DKEYSTORED_DEFER_SSH_KEY=ON \
+	-DSSH_KEY_INSTALL=ON \
+	-DMODEL_INSTALL=ON \
+	-DSYSREPOCTL_EXECUTABLE=$(HOST_DIR)/bin/sysrepoctl \
+	-DSYSREPOCFG_EXECUTABLE=$(HOST_DIR)/bin/sysrepocfg
+
+define NETOPEER2_KEYSTORED_PERMISSIONS
+	/etc/sysrepo/data/ietf-keystore.persist f 600 0 0 - - - - -
+	/etc/sysrepo/data/ietf-keystore.running f 600 0 0 - - - - -
+	/etc/sysrepo/data/ietf-keystore.running.lock f 600 0 0 - - - - -
+	/etc/sysrepo/data/ietf-keystore.startup f 600 0 0 - - - - -
+	/etc/sysrepo/data/ietf-keystore.startup.lock f 600 0 0 - - - - -
+endef
+
+$(eval $(cmake-package))
Signature · 1 line
2.20.1
#6 lore raw

PATCH v5 4/5 package/netopeer2-server: add package

In reply to Heiko Thiery

From: Heiko Thiery <[email protected]>

Netopeer2 is a set of tools implementing network configuration tools based on the NETCONF Protocol. This is the second generation of the toolset, originally available as the Netopeer project. Netopeer2 is based on the new generation of the NETCONF and YANG libraries - libyang and libnetconf2. The Netopeer server uses sysrepo as a NETCONF datastore implementation.

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 package/netopeer2-server/Config.in            | 51 +++++++++++
 package/netopeer2-server/S52netopeer2-server  | 90 +++++++++++++++++++
 .../netopeer2-server/netopeer2-server.hash    |  1 +
 package/netopeer2-server/netopeer2-server.mk  | 33 +++++++
 6 files changed, 177 insertions(+)
 create mode 100644 package/netopeer2-server/Config.in
 create mode 100644 package/netopeer2-server/S52netopeer2-server
 create mode 120000 package/netopeer2-server/netopeer2-server.hash
 create mode 100644 package/netopeer2-server/netopeer2-server.mk
DEVELOPERS +1 -0
index 0f0089dfaf..217d044930 100644
@@ -1049,6 +1049,7 @@ N:	Heiko Thiery <[email protected]>
 F:	package/libnetconf2/
 F:	package/libyang/
 F:	package/netopeer2-keystored/
+F:	package/netopeer2-server/
 F:	package/sysrepo/
 
 N:	Henrique Camargo <[email protected]>
package/Config.in +1 -0
index 1fcd7dd2d7..aaecef433f 100644
@@ -1660,6 +1660,7 @@ menu "Networking"
 	source "package/nanomsg/Config.in"
 	source "package/neon/Config.in"
 	source "package/netopeer2-keystored/Config.in"
+	source "package/netopeer2-server/Config.in"
 	source "package/nghttp2/Config.in"
 	source "package/norm/Config.in"
 	source "package/nss-mdns/Config.in"
package/netopeer2-server/Config.in new file +51 -0

51 lines not on this page · raw message

package/netopeer2-server/S52netopeer2-server new file +90 -0

90 lines not on this page · raw message

package/netopeer2-server/netopeer2-server.hash new file +1 -0
new file mode 120000
index 0000000000..47bb47d7e3
@@ -0,0 +1 @@
+../netopeer2-keystored/netopeer2-keystored.hash
\ No newline at end of file
package/netopeer2-server/netopeer2-server.mk new file +33 -0
new file mode 100644
index 0000000000..449c2082d3
@@ -0,0 +1,33 @@
+################################################################################
+#
+# netopeer2-server
+#
+################################################################################
+
+NETOPEER2_SERVER_VERSION = 0.7-r2
+NETOPEER2_SERVER_SOURCE = netopeer2-$(NETOPEER2_SERVER_VERSION).tar.gz
+NETOPEER2_SERVER_SITE = $(call github,CESNET,Netopeer2,v$(NETOPEER2_SERVER_VERSION))
+NETOPEER2_SERVER_DL_SUBDIR = netopeer2
+NETOPEER2_SERVER_LICENSE = BSD-3-Clause
+NETOPEER2_SERVER_LICENSE_FILES = LICENSE
+NETOPEER2_SERVER_SUBDIR = server
+NETOPEER2_SERVER_DEPENDENCIES = libyang sysrepo
+
+NETOPEER2_SERVER_CONF_OPTS = \
+	-DENABLE_CONFIGURATION=ON \
+	-DKEYSTORED_KEYS_DIR=/etc/keystored/keys
+
+define NETOPEER2_SERVER_INSTALL_INIT_SYSV
+	$(INSTALL) -m 755 -D package/netopeer2-server/S52netopeer2-server \
+		$(TARGET_DIR)/etc/init.d/S52netopeer2-server
+endef
+
+define NETOPEER2_SERVER_PERMISSIONS
+	/etc/sysrepo/data/ietf-netconf-server.persist f 600 0 0 - - - - -
+	/etc/sysrepo/data/ietf-netconf-server.running f 600 0 0 - - - - -
+	/etc/sysrepo/data/ietf-netconf-server.running.lock f 600 0 0 - - - - -
+	/etc/sysrepo/data/ietf-netconf-server.startup f 600 0 0 - - - - -
+	/etc/sysrepo/data/ietf-netconf-server.startup.lock f 600 0 0 - - - - -
+endef
+
+$(eval $(cmake-package))
Signature · 1 line
2.20.1
#7 lore raw

PATCH v5 5/5 package/netopeer2-cli: add package

In reply to Heiko Thiery

From: Heiko Thiery <[email protected]>

netopeer2 CLI - simple command line interface to connect to a NETCONF server (device).

---
 DEVELOPERS                               |  1 +
 package/Config.in                        |  1 +
 package/netopeer2-cli/Config.in          | 21 +++++++++++++++++++++
 package/netopeer2-cli/netopeer2-cli.hash |  1 +
 package/netopeer2-cli/netopeer2-cli.mk   | 17 +++++++++++++++++
 5 files changed, 41 insertions(+)
 create mode 100644 package/netopeer2-cli/Config.in
 create mode 120000 package/netopeer2-cli/netopeer2-cli.hash
 create mode 100644 package/netopeer2-cli/netopeer2-cli.mk
DEVELOPERS +1 -0
index 217d044930..d70985393b 100644
@@ -1048,6 +1048,7 @@ F:	package/python-sip/
 N:	Heiko Thiery <[email protected]>
 F:	package/libnetconf2/
 F:	package/libyang/
+F:	package/netopeer2-cli/
 F:	package/netopeer2-keystored/
 F:	package/netopeer2-server/
 F:	package/sysrepo/
package/Config.in +1 -0
index aaecef433f..3048ecd8ed 100644
@@ -1659,6 +1659,7 @@ menu "Networking"
 	source "package/mongoose/Config.in"
 	source "package/nanomsg/Config.in"
 	source "package/neon/Config.in"
+	source "package/netopeer2-cli/Config.in"
 	source "package/netopeer2-keystored/Config.in"
 	source "package/netopeer2-server/Config.in"
 	source "package/nghttp2/Config.in"
package/netopeer2-cli/Config.in new file +21 -0
new file mode 100644
index 0000000000..9c3a302a1d
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_NETOPEER2_CLI
+	bool "netopeer2-cli"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_STATIC_LIBS
+	select BR2_PACKAGE_LIBYANG
+	select BR2_PACKAGE_LIBNETCONF2
+	select BR2_PACKAGE_LIBSSH
+	select BR2_PACKAGE_LIBSSH_SERVER
+	select BR2_PACKAGE_PCRE # libyang
+	select BR2_PACKAGE_PCRE_UCP # libyang
+	select BR2_PACKAGE_SYSREPO
+	help
+	  Netopeer2 is a set of tools implementing network
+	  configuration tools based on the NETCONF Protocol.
+
+	  This is the CLI client part.
+
+	  https://github.com/CESNET/Netopeer2
+
+comment "netopeer2cli needs a toolchain w/ threads, dynamic libraray"
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
package/netopeer2-cli/netopeer2-cli.hash new file +1 -0
new file mode 120000
index 0000000000..47bb47d7e3
@@ -0,0 +1 @@
+../netopeer2-keystored/netopeer2-keystored.hash
\ No newline at end of file
package/netopeer2-cli/netopeer2-cli.mk new file +17 -0
new file mode 100644
index 0000000000..9adc8226de
@@ -0,0 +1,17 @@
+################################################################################
+#
+# netopeer2-cli
+#
+################################################################################
+
+NETOPEER2_CLI_VERSION = 0.7-r2
+NETOPEER2_CLI_SOURCE = netopeer2-$(NETOPEER2_CLI_VERSION).tar.gz
+NETOPEER2_CLI_SITE = $(call github,CESNET,Netopeer2,v$(NETOPEER2_CLI_VERSION))
+NETOPEER2_CLI_DL_SUBDIR = netopeer2
+NETOPEER2_CLI_LICENSE = BSD-3-Clause
+NETOPEER2_CLI_LICENSE_FILES = LICENSE
+NETOPEER2_CLI_SUBDIR = cli
+NETOPEER2_CLI_INSTALL_STAGING = YES
+NETOPEER2_CLI_DEPENDENCIES = libnetconf2 libyang sysrepo
+
+$(eval $(cmake-package))
Signature · 1 line
2.20.1