Browse Source

netopeer2: bump to latest version

This patch add's a new cmakefile which builds other cmakefiles and
simplifies the Makefile, also it renames the yang files so
sysrepoctl does not create duplicates.

Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
lilik-openwrt-22.03
Mislav Novakovic 7 years ago
parent
commit
3902f29b69
5 changed files with 84 additions and 49 deletions
  1. +10
    -33
      net/netopeer2/Makefile
  2. +2
    -2
      net/netopeer2/files/netopeer2-keystored-keygen.default
  3. +2
    -2
      net/netopeer2/files/netopeer2-keystored.default
  4. +12
    -12
      net/netopeer2/files/netopeer2-server.default
  5. +58
    -0
      net/netopeer2/patches/002-fix-for-cmake-build

+ 10
- 33
net/netopeer2/Makefile View File

@ -14,11 +14,11 @@ PKG_NAME:=netopeer2
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr> PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_VERSION:=0.4.3
PKG_VERSION:=0.4.13
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e7c821cde14df31a03d23293f84e0aed9cb1a457
PKG_MIRROR_HASH:=88a4c06e9cdb81879de7311138acbfe9fe5207db14fbb93c5ba4d6947d616aec
PKG_SOURCE_VERSION:=ae560bef2e70d274f6d028b59e3cb398ea2a621d
PKG_MIRROR_HASH:=43b7f9c436afc76de539a7426b1462249326318b9b836f1d49282106a730a6b8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/CESNET/Netopeer2.git PKG_SOURCE_URL:=https://github.com/CESNET/Netopeer2.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
@ -76,40 +76,17 @@ CMAKE_OPTIONS += \
-DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_BUILD_TYPE:STRING=Release \
-DKEYSTORED_KEYS_DIR:STRING=/etc/keystored/keys -DKEYSTORED_KEYS_DIR:STRING=/etc/keystored/keys
define Build/Configure
$(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/server)
$(call Build/Configure/Default)
$(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/cli)
$(call Build/Configure/Default)
$(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/keystored)
$(call Build/Configure/Default)
endef
define Build/Compile
$(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/server)
$(call Build/Compile/Default)
$(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/cli)
$(call Build/Compile/Default)
$(eval PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)/keystored)
$(call Build/Compile/Default)
endef
define Package/netopeer2-server/install define Package/netopeer2-server/install
$(INSTALL_DIR) $(1)/bin $(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_ROOT)/server/netopeer2-server $(1)/bin/ $(INSTALL_BIN) $(PKG_BUILD_ROOT)/server/netopeer2-server $(1)/bin/
$(INSTALL_DIR) $(1)/etc/sysrepo/yang $(INSTALL_DIR) $(1)/etc/sysrepo/yang
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-ssh-server.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-tls-server.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/iana-crypt-hash.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-x509-cert-to-name.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-netconf-server.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-netconf-server.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-system.yang $(1)/etc/sysrepo/yang/
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-ssh-server.yang $(1)/etc/sysrepo/yang/ietf-ssh-server@2016-11-02.yang
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-tls-server.yang $(1)/etc/sysrepo/yang/ietf-tls-server@2016-11-02.yang
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/iana-crypt-hash.yang $(1)/etc/sysrepo/yang/iana-crypt-hash@2014-08-06.yang
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-x509-cert-to-name.yang $(1)/etc/sysrepo/yang/ietf-x509-cert-to-name@2014-12-10.yang
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-netconf-server.yang $(1)/etc/sysrepo/yang/ietf-netconf-server@2016-11-02.yang
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-system.yang $(1)/etc/sysrepo/yang/ietf-system@2014-08-06.yang
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/netopeer2-server.default $(1)/etc/uci-defaults/99_netopeer2-server $(INSTALL_BIN) ./files/netopeer2-server.default $(1)/etc/uci-defaults/99_netopeer2-server
@ -131,7 +108,7 @@ define Package/netopeer2-keystored/install
$(INSTALL_BIN) $(PKG_BUILD_ROOT)/keystored/libkeystored.so $(1)/usr/lib/sysrepo/plugins/ $(INSTALL_BIN) $(PKG_BUILD_ROOT)/keystored/libkeystored.so $(1)/usr/lib/sysrepo/plugins/
$(INSTALL_DIR) $(1)/etc/sysrepo/yang $(INSTALL_DIR) $(1)/etc/sysrepo/yang
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-keystore.yang $(1)/etc/sysrepo/yang
$(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-keystore.yang $(1)/etc/sysrepo/yang/ietf-keystore@2016-10-31.yang
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults


+ 2
- 2
net/netopeer2/files/netopeer2-keystored-keygen.default View File

@ -3,9 +3,9 @@
# Warning, problems can occur if the device restarts in the middle of this uci-default script # Warning, problems can occur if the device restarts in the middle of this uci-default script
if [ -x /bin/sysrepoctl ]; then if [ -x /bin/sysrepoctl ]; then
match=$(sysrepoctl -l | grep "ietf-keystore\ ")
match=$(sysrepoctl -l | grep "ietf-keystore ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore.yang -o root:root -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore@2016-10-31.yang -o root:root -p 600
if [ -x /bin/sysrepocfg ]; then if [ -x /bin/sysrepocfg ]; then
sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
rm /usr/share/netopeer2-keystored/stock_key_config.xml rm /usr/share/netopeer2-keystored/stock_key_config.xml


+ 2
- 2
net/netopeer2/files/netopeer2-keystored.default View File

@ -3,9 +3,9 @@
# Warning, problems can occur if the device restarts in the middle of this uci-default script # Warning, problems can occur if the device restarts in the middle of this uci-default script
if [ -x /bin/sysrepoctl ]; then if [ -x /bin/sysrepoctl ]; then
match=$(sysrepoctl -l | grep "ietf-keystore\ ")
match=$(sysrepoctl -l | grep "ietf-keystore ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore.yang -o root:root -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore@2016-10-31.yang -o root:root -p 600
if [ -x /bin/sysrepocfg ]; then if [ -x /bin/sysrepocfg ]; then
sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
rm /usr/share/netopeer2-keystored/stock_key_config.xml rm /usr/share/netopeer2-keystored/stock_key_config.xml


+ 12
- 12
net/netopeer2/files/netopeer2-server.default View File

@ -3,29 +3,29 @@
# Warning, problems can occur if the device restarts in the middle of this uci-default script # Warning, problems can occur if the device restarts in the middle of this uci-default script
if [ -x /bin/sysrepoctl ]; then if [ -x /bin/sysrepoctl ]; then
match=$(sysrepoctl -l | grep "ietf-ssh-server\ ")
match=$(sysrepoctl -l | grep "ietf-ssh-server ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-ssh-server.yang -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-ssh-server@2016-11-02.yang -p 600
fi fi
match=$(sysrepoctl -l | grep "ietf-tls-server\ ")
match=$(sysrepoctl -l | grep "ietf-tls-server ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-tls-server.yang -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-tls-server@2016-11-02.yang -p 600
fi fi
match=$(sysrepoctl -l | grep "iana-crypt-hash\ ")
match=$(sysrepoctl -l | grep "iana-crypt-hash ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/iana-crypt-hash.yang -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/iana-crypt-hash@2014-08-06.yang -p 600
fi fi
match=$(sysrepoctl -l | grep "ietf-x509-cert-to-name\ ")
match=$(sysrepoctl -l | grep "ietf-x509-cert-to-name ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-x509-cert-to-name.yang -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-x509-cert-to-name@2014-12-10.yang -p 600
fi fi
match=$(sysrepoctl -l | grep "ietf-netconf-server\ ")
match=$(sysrepoctl -l | grep "ietf-netconf-server ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-server.yang -o root:root -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-server@2016-11-02.yang -o root:root -p 600
sysrepoctl -m ietf-netconf-server -e listen sysrepoctl -m ietf-netconf-server -e listen
sysrepoctl -m ietf-netconf-server -e ssh-listen sysrepoctl -m ietf-netconf-server -e ssh-listen
if [ -x /bin/sysrepocfg ]; then if [ -x /bin/sysrepocfg ]; then
@ -34,9 +34,9 @@ if [ -x /bin/sysrepoctl ]; then
fi fi
fi fi
match=$(sysrepoctl -l | grep "ietf-system\ ")
match=$(sysrepoctl -l | grep "ietf-system ")
if [ ! "$match" ]; then if [ ! "$match" ]; then
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-system.yang -o root:root -p 600
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-system@2014-08-06.yang -o root:root -p 600
sysrepoctl -m ietf-system -e authentication sysrepoctl -m ietf-system -e authentication
sysrepoctl -m ietf-system -e local-users sysrepoctl -m ietf-system -e local-users
fi fi


+ 58
- 0
net/netopeer2/patches/002-fix-for-cmake-build View File

@ -0,0 +1,58 @@
Index: netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/CMakeLists.txt
===================================================================
--- /dev/null
+++ netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.6)
+
+add_subdirectory(server)
+add_subdirectory(cli)
+add_subdirectory(keystored)
Index: netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/cli/CMakeLists.txt
===================================================================
--- netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d.orig/cli/CMakeLists.txt
+++ netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/cli/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.6)
# include custom Modules
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../CMakeModules/")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
project(netopeer2-cli C)
include(GNUInstallDirs)
@@ -83,7 +83,7 @@ endif()
install(FILES ${PROJECT_SOURCE_DIR}/doc/${PROJECT_NAME}.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# clean cmake cache
-add_custom_target(cleancache
+add_custom_target(cleancache_cli
COMMAND make clean
COMMAND find . -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} +
COMMAND rm -rf Makefile Doxyfile
Index: netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/keystored/CMakeLists.txt
===================================================================
--- netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d.orig/keystored/CMakeLists.txt
+++ netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/keystored/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.6)
# include custom Modules
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../CMakeModules/")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
project(keystored C)
include(GNUInstallDirs)
Index: netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/server/CMakeLists.txt
===================================================================
--- netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d.orig/server/CMakeLists.txt
+++ netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/server/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8.9)
# include custom Modules
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../CMakeModules/")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
project(netopeer2-server C)
include(GNUInstallDirs)

Loading…
Cancel
Save