From 3902f29b69271048ab1f70c6fc44c5a849779f92 Mon Sep 17 00:00:00 2001 From: Mislav Novakovic Date: Thu, 21 Dec 2017 12:41:02 +0100 Subject: [PATCH] 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 --- net/netopeer2/Makefile | 43 ++++---------- .../files/netopeer2-keystored-keygen.default | 4 +- .../files/netopeer2-keystored.default | 4 +- net/netopeer2/files/netopeer2-server.default | 24 ++++---- net/netopeer2/patches/002-fix-for-cmake-build | 58 +++++++++++++++++++ 5 files changed, 84 insertions(+), 49 deletions(-) create mode 100644 net/netopeer2/patches/002-fix-for-cmake-build diff --git a/net/netopeer2/Makefile b/net/netopeer2/Makefile index 25da6cc1da..b9f2968669 100644 --- a/net/netopeer2/Makefile +++ b/net/netopeer2/Makefile @@ -14,11 +14,11 @@ PKG_NAME:=netopeer2 PKG_LICENSE:=BSD-3-Clause PKG_MAINTAINER:=Mislav Novakovic -PKG_VERSION:=0.4.3 +PKG_VERSION:=0.4.13 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_URL:=https://github.com/CESNET/Netopeer2.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION) @@ -76,40 +76,17 @@ CMAKE_OPTIONS += \ -DCMAKE_BUILD_TYPE:STRING=Release \ -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 $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) $(PKG_BUILD_ROOT)/server/netopeer2-server $(1)/bin/ $(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_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_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 diff --git a/net/netopeer2/files/netopeer2-keystored-keygen.default b/net/netopeer2/files/netopeer2-keystored-keygen.default index 6c9c10559d..df28081c7d 100644 --- a/net/netopeer2/files/netopeer2-keystored-keygen.default +++ b/net/netopeer2/files/netopeer2-keystored-keygen.default @@ -3,9 +3,9 @@ # Warning, problems can occur if the device restarts in the middle of this uci-default script if [ -x /bin/sysrepoctl ]; then - match=$(sysrepoctl -l | grep "ietf-keystore\ ") + match=$(sysrepoctl -l | grep "ietf-keystore ") 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 sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore rm /usr/share/netopeer2-keystored/stock_key_config.xml diff --git a/net/netopeer2/files/netopeer2-keystored.default b/net/netopeer2/files/netopeer2-keystored.default index 9faeedc221..dda6f4517b 100644 --- a/net/netopeer2/files/netopeer2-keystored.default +++ b/net/netopeer2/files/netopeer2-keystored.default @@ -3,9 +3,9 @@ # Warning, problems can occur if the device restarts in the middle of this uci-default script if [ -x /bin/sysrepoctl ]; then - match=$(sysrepoctl -l | grep "ietf-keystore\ ") + match=$(sysrepoctl -l | grep "ietf-keystore ") 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 sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore rm /usr/share/netopeer2-keystored/stock_key_config.xml diff --git a/net/netopeer2/files/netopeer2-server.default b/net/netopeer2/files/netopeer2-server.default index d2a699bb13..8a7b7fe7e1 100644 --- a/net/netopeer2/files/netopeer2-server.default +++ b/net/netopeer2/files/netopeer2-server.default @@ -3,29 +3,29 @@ # Warning, problems can occur if the device restarts in the middle of this uci-default script if [ -x /bin/sysrepoctl ]; then - match=$(sysrepoctl -l | grep "ietf-ssh-server\ ") + match=$(sysrepoctl -l | grep "ietf-ssh-server ") 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 - match=$(sysrepoctl -l | grep "ietf-tls-server\ ") + match=$(sysrepoctl -l | grep "ietf-tls-server ") 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 - match=$(sysrepoctl -l | grep "iana-crypt-hash\ ") + match=$(sysrepoctl -l | grep "iana-crypt-hash ") 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 - match=$(sysrepoctl -l | grep "ietf-x509-cert-to-name\ ") + match=$(sysrepoctl -l | grep "ietf-x509-cert-to-name ") 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 - match=$(sysrepoctl -l | grep "ietf-netconf-server\ ") + match=$(sysrepoctl -l | grep "ietf-netconf-server ") 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 ssh-listen if [ -x /bin/sysrepocfg ]; then @@ -34,9 +34,9 @@ if [ -x /bin/sysrepoctl ]; then fi fi - match=$(sysrepoctl -l | grep "ietf-system\ ") + match=$(sysrepoctl -l | grep "ietf-system ") 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 local-users fi diff --git a/net/netopeer2/patches/002-fix-for-cmake-build b/net/netopeer2/patches/002-fix-for-cmake-build new file mode 100644 index 0000000000..bd29d4d7d1 --- /dev/null +++ b/net/netopeer2/patches/002-fix-for-cmake-build @@ -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) -- 2.30.2