From b5132ef7804f3f85b9956ae73e1ab4e15b4a98f5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 15 Jul 2019 15:27:38 -0700 Subject: [PATCH 1/4] libnetconf2: Update to 0.12-r2 Cleaned up Makefile slightly. The removed CMAKE_OPTIONS are defaults from cmake.mk Removed Upstreamed patches. Rebased and added .patch to the remaining one. Added -Wformat-security patch. Signed-off-by: Rosen Penev --- libs/libnetconf2/Makefile | 12 +- ...read-error => 001-fix-pthread-error.patch} | 31 ++-- libs/libnetconf2/patches/010-fix-format.patch | 11 ++ .../patches/010-remove-engine.patch | 33 ---- .../patches/020-openssl-deprecated.patch | 160 ------------------ 5 files changed, 26 insertions(+), 221 deletions(-) rename libs/libnetconf2/patches/{001-fix-pthread-error => 001-fix-pthread-error.patch} (54%) create mode 100644 libs/libnetconf2/patches/010-fix-format.patch delete mode 100644 libs/libnetconf2/patches/010-remove-engine.patch delete mode 100644 libs/libnetconf2/patches/020-openssl-deprecated.patch diff --git a/libs/libnetconf2/Makefile b/libs/libnetconf2/Makefile index e6830314a..4005e60e6 100644 --- a/libs/libnetconf2/Makefile +++ b/libs/libnetconf2/Makefile @@ -8,19 +8,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetconf2 -PKG_VERSION:=0.12-r1 -PKG_RELEASE:=4 +PKG_VERSION:=0.12-r2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/CESNET/libnetconf2/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=86269d3f1bc85bb17d8823d214f9a676ee3b14ee18a0b87a230380df8503e8f5 +PKG_HASH:=760061fb1c1fe87a2a068d5a9e5affcef280044c5940ef344854e9ea7ec26452 PKG_MAINTAINER:=Mislav Novakovic PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -40,10 +40,6 @@ define Package/libnetconf2/description SSH, to send and receive NETCONF messages. NETCONF datastore implementation is not included. endef -CMAKE_OPTIONS += \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DCMAKE_BUILD_TYPE:STRING=Release - define Package/libnetconf2/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetconf2.so* $(1)/usr/lib/ diff --git a/libs/libnetconf2/patches/001-fix-pthread-error b/libs/libnetconf2/patches/001-fix-pthread-error.patch similarity index 54% rename from libs/libnetconf2/patches/001-fix-pthread-error rename to libs/libnetconf2/patches/001-fix-pthread-error.patch index b15893e17..30faa03a9 100644 --- a/libs/libnetconf2/patches/001-fix-pthread-error +++ b/libs/libnetconf2/patches/001-fix-pthread-error.patch @@ -1,23 +1,16 @@ -Index: libnetconf2-0.12-r1/CMakeLists.txt -=================================================================== ---- libnetconf2-0.12-r1.orig/CMakeLists.txt -+++ libnetconf2-0.12-r1/CMakeLists.txt -@@ -172,8 +172,10 @@ target_link_libraries(netconf2 ${CMAKE_T - - # check availability for some pthread functions +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -176,6 +176,7 @@ target_link_libraries(netconf2 ${CMAKE_THREAD_LIBS_INIT}) set(CMAKE_REQUIRED_LIBRARIES pthread) -+include(CheckFunctionExists) - check_function_exists(pthread_spin_lock HAVE_SPINLOCK) + check_include_file(stdatomic.h HAVE_STDATOMIC) check_function_exists(pthread_mutex_timedlock HAVE_PTHREAD_MUTEX_TIMEDLOCK) +check_function_exists(pthread_rwlockattr_setkind_np HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP) # dependencies - openssl if(ENABLE_TLS OR ENABLE_DNSSEC OR ENABLE_SSH) -Index: libnetconf2-0.12-r1/src/config.h.in -=================================================================== ---- libnetconf2-0.12-r1.orig/src/config.h.in -+++ libnetconf2-0.12-r1/src/config.h.in -@@ -65,4 +65,7 @@ +--- a/src/config.h.in ++++ b/src/config.h.in +@@ -73,4 +73,7 @@ */ #define NC_PS_QUEUE_SIZE @MAX_PSPOLL_THREAD_COUNT@ @@ -25,11 +18,9 @@ Index: libnetconf2-0.12-r1/src/config.h.in +#cmakedefine HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP + #endif /* NC_CONFIG_H_ */ -Index: libnetconf2-0.12-r1/src/session_server.c -=================================================================== ---- libnetconf2-0.12-r1.orig/src/session_server.c -+++ libnetconf2-0.12-r1/src/session_server.c -@@ -520,6 +520,7 @@ nc_server_init(struct ly_ctx *ctx) +--- a/src/session_server.c ++++ b/src/session_server.c +@@ -560,6 +560,7 @@ nc_server_init(struct ly_ctx *ctx) errno=0; if (pthread_rwlockattr_init(&attr) == 0) { @@ -37,7 +28,7 @@ Index: libnetconf2-0.12-r1/src/session_server.c if (pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP) == 0) { if (pthread_rwlock_init(&server_opts.endpt_lock, &attr) != 0) { ERR("%s: failed to init rwlock(%s).", __FUNCTION__, strerror(errno)); -@@ -530,6 +531,7 @@ nc_server_init(struct ly_ctx *ctx) +@@ -570,6 +571,7 @@ nc_server_init(struct ly_ctx *ctx) } else { ERR("%s: failed set attribute (%s).", __FUNCTION__, strerror(errno)); } diff --git a/libs/libnetconf2/patches/010-fix-format.patch b/libs/libnetconf2/patches/010-fix-format.patch new file mode 100644 index 000000000..1f6ce2c2d --- /dev/null +++ b/libs/libnetconf2/patches/010-fix-format.patch @@ -0,0 +1,11 @@ +--- a/src/io.c ++++ b/src/io.c +@@ -62,7 +62,7 @@ nc_ssl_error_get_reasons(void) + ERRMEM; + return NULL; + } +- reason_len += sprintf(reasons + reason_len, ERR_reason_error_string(e)); ++ reason_len += sprintf(reasons + reason_len, "%s", ERR_reason_error_string(e)); + } + + return reasons; diff --git a/libs/libnetconf2/patches/010-remove-engine.patch b/libs/libnetconf2/patches/010-remove-engine.patch deleted file mode 100644 index 8e49c144d..000000000 --- a/libs/libnetconf2/patches/010-remove-engine.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 5472ebd501c0558a9434a11b309f3b6a314c2168 Mon Sep 17 00:00:00 2001 -From: Rosen Penev -Date: Wed, 7 Nov 2018 16:58:42 -0800 -Subject: [PATCH] session: Remove engine.h include - -OpenSSL's engine API is not used except for a cleanup call. ---- - src/session.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/src/session.c b/src/session.c -index edf1bb4..fe90fa9 100644 ---- a/src/session.c -+++ b/src/session.c -@@ -36,7 +36,6 @@ - - #if defined(NC_ENABLED_SSH) || defined(NC_ENABLED_TLS) - --# include - # include - # include - -@@ -1296,7 +1295,6 @@ static void - nc_ssh_destroy(void) - { - FIPS_mode_set(0); -- ENGINE_cleanup(); - CONF_modules_unload(1); - nc_thread_destroy(); - ssh_finalize(); --- -2.19.1 - diff --git a/libs/libnetconf2/patches/020-openssl-deprecated.patch b/libs/libnetconf2/patches/020-openssl-deprecated.patch deleted file mode 100644 index a8234281c..000000000 --- a/libs/libnetconf2/patches/020-openssl-deprecated.patch +++ /dev/null @@ -1,160 +0,0 @@ ---- a/src/session.c -+++ b/src/session.c -@@ -1372,11 +1372,11 @@ tls_thread_id_func(CRYPTO_THREADID *tid) - static void - nc_tls_init(void) - { -+#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - SSL_load_error_strings(); - ERR_load_BIO_strings(); - SSL_library_init(); - --#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - int i; - - tls_locks = malloc(CRYPTO_num_locks() * sizeof *tls_locks); -@@ -1400,6 +1400,7 @@ nc_tls_init(void) - static void - nc_tls_destroy(void) - { -+#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - FIPS_mode_set(0); - CRYPTO_cleanup_all_ex_data(); - nc_thread_destroy(); -@@ -1411,7 +1412,6 @@ nc_tls_destroy(void) - SSL_COMP_free_compression_methods(); - #endif - --#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - int i; - - CRYPTO_THREADID_set_callback(NULL); -@@ -1434,13 +1434,13 @@ nc_tls_destroy(void) - static void - nc_ssh_tls_init(void) - { -+#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - SSL_load_error_strings(); - ERR_load_BIO_strings(); - SSL_library_init(); - - nc_ssh_init(); - --#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - CRYPTO_set_dynlock_create_callback(tls_dyn_create_func); - CRYPTO_set_dynlock_lock_callback(tls_dyn_lock_func); - CRYPTO_set_dynlock_destroy_callback(tls_dyn_destroy_func); -@@ -1450,6 +1450,7 @@ nc_ssh_tls_init(void) - static void - nc_ssh_tls_destroy(void) - { -+#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - ERR_free_strings(); - #if OPENSSL_VERSION_NUMBER < 0x10002000L // < 1.0.2 - sk_SSL_COMP_free(SSL_COMP_get_compression_methods()); -@@ -1459,7 +1460,6 @@ nc_ssh_tls_destroy(void) - - nc_ssh_destroy(); - --#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - CRYPTO_set_dynlock_create_callback(NULL); - CRYPTO_set_dynlock_lock_callback(NULL); - CRYPTO_set_dynlock_destroy_callback(NULL); ---- a/src/session_client_tls.c -+++ b/src/session_client_tls.c -@@ -29,6 +29,10 @@ - #include "session_client_ch.h" - #include "libnetconf.h" - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#define X509_STORE_CTX_get_by_subject X509_STORE_get_by_subject -+#endif -+ - struct nc_client_context *nc_client_context_location(void); - int nc_session_new_ctx( struct nc_session *session, struct ly_ctx *ctx); - -@@ -74,7 +78,7 @@ tlsauth_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) - store_ctx = X509_STORE_CTX_new(); - obj = X509_OBJECT_new(); - X509_STORE_CTX_init(store_ctx, opts->crl_store, NULL, NULL); -- rc = X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, subject, obj); -+ rc = X509_STORE_CTX_get_by_subject(store_ctx, X509_LU_CRL, subject, obj); - X509_STORE_CTX_free(store_ctx); - crl = X509_OBJECT_get0_X509_CRL(obj); - if (rc > 0 && crl) { -@@ -113,7 +117,7 @@ tlsauth_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) - store_ctx = X509_STORE_CTX_new(); - obj = X509_OBJECT_new(); - X509_STORE_CTX_init(store_ctx, opts->crl_store, NULL, NULL); -- rc = X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, issuer, obj); -+ rc = X509_STORE_CTX_get_by_subject(store_ctx, X509_LU_CRL, issuer, obj); - X509_STORE_CTX_free(store_ctx); - crl = X509_OBJECT_get0_X509_CRL(obj); - if (rc > 0 && crl) { -@@ -169,7 +173,7 @@ tlsauth_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) - * the current certificate in order to verify it's integrity */ - memset((char *)&obj, 0, sizeof obj); - X509_STORE_CTX_init(&store_ctx, opts->crl_store, NULL, NULL); -- rc = X509_STORE_get_by_subject(&store_ctx, X509_LU_CRL, subject, &obj); -+ rc = X509_STORE_CTX_get_by_subject(&store_ctx, X509_LU_CRL, subject, &obj); - X509_STORE_CTX_cleanup(&store_ctx); - crl = obj.data.crl; - if (rc > 0 && crl) { -@@ -207,7 +211,7 @@ tlsauth_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) - * the current certificate in order to check for revocation */ - memset((char *)&obj, 0, sizeof obj); - X509_STORE_CTX_init(&store_ctx, opts->crl_store, NULL, NULL); -- rc = X509_STORE_get_by_subject(&store_ctx, X509_LU_CRL, issuer, &obj); -+ rc = X509_STORE_CTX_get_by_subject(&store_ctx, X509_LU_CRL, issuer, &obj); - X509_STORE_CTX_cleanup(&store_ctx); - crl = obj.data.crl; - if (rc > 0 && crl) { ---- a/src/session_server_tls.c -+++ b/src/session_server_tls.c -@@ -28,6 +28,10 @@ - #include "session_server_ch.h" - #include "libnetconf.h" - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#define X509_STORE_CTX_get_by_subject X509_STORE_get_by_subject -+#endif -+ - struct nc_server_tls_opts tls_ch_opts; - pthread_mutex_t tls_ch_opts_lock = PTHREAD_MUTEX_INITIALIZER; - extern struct nc_server_opts server_opts; -@@ -563,7 +567,7 @@ nc_tlsclb_verify(int preverify_ok, X509_STORE_CTX *x509_ctx) - store_ctx = X509_STORE_CTX_new(); - obj = X509_OBJECT_new(); - X509_STORE_CTX_init(store_ctx, opts->crl_store, NULL, NULL); -- rc = X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, subject, obj); -+ rc = X509_STORE_CTX_get_by_subject(store_ctx, X509_LU_CRL, subject, obj); - X509_STORE_CTX_free(store_ctx); - crl = X509_OBJECT_get0_X509_CRL(obj); - if (rc > 0 && crl) { -@@ -616,7 +620,7 @@ nc_tlsclb_verify(int preverify_ok, X509_STORE_CTX *x509_ctx) - store_ctx = X509_STORE_CTX_new(); - obj = X509_OBJECT_new(); - X509_STORE_CTX_init(store_ctx, opts->crl_store, NULL, NULL); -- rc = X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, issuer, obj); -+ rc = X509_STORE_CTX_get_by_subject(store_ctx, X509_LU_CRL, issuer, obj); - X509_STORE_CTX_free(store_ctx); - crl = X509_OBJECT_get0_X509_CRL(obj); - if (rc > 0 && crl) { -@@ -776,7 +780,7 @@ nc_tlsclb_verify(int preverify_ok, X509_STORE_CTX *x509_ctx) - * the current certificate in order to verify it's integrity */ - memset((char *)&obj, 0, sizeof(obj)); - X509_STORE_CTX_init(&store_ctx, opts->crl_store, NULL, NULL); -- rc = X509_STORE_get_by_subject(&store_ctx, X509_LU_CRL, subject, &obj); -+ rc = X509_STORE_CTX_get_by_subject(&store_ctx, X509_LU_CRL, subject, &obj); - X509_STORE_CTX_cleanup(&store_ctx); - crl = obj.data.crl; - if (rc > 0 && crl) { -@@ -828,7 +832,7 @@ nc_tlsclb_verify(int preverify_ok, X509_STORE_CTX *x509_ctx) - * the current certificate in order to check for revocation */ - memset((char *)&obj, 0, sizeof(obj)); - X509_STORE_CTX_init(&store_ctx, opts->crl_store, NULL, NULL); -- rc = X509_STORE_get_by_subject(&store_ctx, X509_LU_CRL, issuer, &obj); -+ rc = X509_STORE_CTX_get_by_subject(&store_ctx, X509_LU_CRL, issuer, &obj); - X509_STORE_CTX_cleanup(&store_ctx); - crl = obj.data.crl; - if (rc > 0 && crl) { From 98c04e04c48c6339fb6310844b5e159e83f1b81a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 15 Jul 2019 15:41:20 -0700 Subject: [PATCH 2/4] sysrepo: Update to 0.7.8 Makefile cleanups for consistency between packages. Placed libsysrepo in Libraries instead of Utilities. Removed InstallDev as it is implied by CMAKE_INSTALL. Added .patch at the end of patch files. Signed-off-by: Rosen Penev --- net/sysrepo/Makefile | 28 ++++--------------- ...> 001-add-generated-protobufc-files.patch} | 0 ...002-remove-buildtime-module-install.patch} | 8 +++--- ...t => 004-disable-sysrepod-autostart.patch} | 2 +- ...fine => 005-fix-struct-ucred-define.patch} | 6 ++-- ...06-update-generated-protobufc-files.patch} | 8 +++--- 6 files changed, 18 insertions(+), 34 deletions(-) rename net/sysrepo/patches/{001-add-generated-protobufc-files => 001-add-generated-protobufc-files.patch} (100%) rename net/sysrepo/patches/{002-remove-buildtime-module-install => 002-remove-buildtime-module-install.patch} (72%) rename net/sysrepo/patches/{004-disable-sysrepod-autostart => 004-disable-sysrepod-autostart.patch} (92%) rename net/sysrepo/patches/{005-fix-struct-ucred-define => 005-fix-struct-ucred-define.patch} (87%) rename net/sysrepo/patches/{006-update-generated-protobufc-files => 006-update-generated-protobufc-files.patch} (81%) diff --git a/net/sysrepo/Makefile b/net/sysrepo/Makefile index 9db5fd5da..a5578ef6b 100644 --- a/net/sysrepo/Makefile +++ b/net/sysrepo/Makefile @@ -8,21 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sysrepo -PKG_VERSION:=0.7.7 -PKG_RELEASE:=5 +PKG_VERSION:=0.7.8 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=2bf8cb4d810d19231eba1e549f58f3a0ce068d170a5e7b212b927396098560e4 +PKG_HASH:=d3066c1776a6727b96bbb3517eb646d0bb6037e8e1addcbe873cae590493843e PKG_MAINTAINER:=Mislav Novakovic PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE CMAKE_INSTALL:=1 - PKG_BUILD_PARALLEL:=1 -PKG_INSTALL:=1 +PKG_BUILD_DEPENDS:=SYSREPO_BINDINGS:swig/host include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -34,11 +33,9 @@ define Package/libsysrepo/config source "$(SOURCE)/Config_libsysrepo.in" endef -PKG_BUILD_DEPENDS:=SYSREPO_BINDINGS:swig/host - define Package/libsysrepo - SECTION:=utils - CATEGORY:=Utilities + 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:python-base +SYSREPO_LUA:lua @@ -74,7 +71,6 @@ Sysrepo is an YANG-based configuration and operational state data store for Unix endef CMAKE_OPTIONS += \ - -DCMAKE_BUILD_TYPE:STRING=Release \ -DUSE_AVL_LIB:BOOL=FALSE \ -DENABLE_TESTS:BOOL=FALSE \ -DBUILD_EXAMPLES:BOOL=FALSE \ @@ -83,7 +79,6 @@ CMAKE_OPTIONS += \ -DGEN_PYTHON_BINDINGS=0 \ -DGEN_LUA_BINDINGS=0 \ -DREPOSITORY_LOC:PATH=/etc/sysrepo \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DENABLE_NACM:BOOL=FALSE \ -DREQUEST_TIMEOUT=6 \ -DLONG_REQUEST_TIMEOUT=30 \ @@ -173,17 +168,6 @@ define Package/sysrepocfg/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/ endef -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsysrepo.pc $(1)/usr/lib/pkgconfig/ - - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/ - - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_BUILD_DIR)/inc/* $(1)/usr/include/ -endef - $(eval $(call BuildPackage,libsysrepo)) $(eval $(call BuildPackage,sysrepo)) $(eval $(call BuildPackage,sysrepoctl)) diff --git a/net/sysrepo/patches/001-add-generated-protobufc-files b/net/sysrepo/patches/001-add-generated-protobufc-files.patch similarity index 100% rename from net/sysrepo/patches/001-add-generated-protobufc-files rename to net/sysrepo/patches/001-add-generated-protobufc-files.patch diff --git a/net/sysrepo/patches/002-remove-buildtime-module-install b/net/sysrepo/patches/002-remove-buildtime-module-install.patch similarity index 72% rename from net/sysrepo/patches/002-remove-buildtime-module-install rename to net/sysrepo/patches/002-remove-buildtime-module-install.patch index 5ca818b2f..2a703bbe8 100644 --- a/net/sysrepo/patches/002-remove-buildtime-module-install +++ b/net/sysrepo/patches/002-remove-buildtime-module-install.patch @@ -1,15 +1,15 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -310,7 +310,7 @@ install (FILES ${INTERNAL_YANGS} DESTINA +@@ -335,7 +335,7 @@ install (FILES ${INTERNAL_YANGS} DESTINATION ${INTERNAL_SCHEMA_SEARCH_DIR}) # install NACM YANG module if(ENABLE_NACM) - INSTALL_YANG("ietf-netconf-acm" "@2018-02-14" "644") -+ #INSTALL_YANG("ietf-netconf-acm" "@2018-02-14" "644") ++# INSTALL_YANG("ietf-netconf-acm" "@2018-02-14" "644") endif(ENABLE_NACM) - find_package(PkgConfig QUIET) -@@ -334,9 +334,9 @@ if(WITH_SYSTEMD) + # generate and install pkg-config file +@@ -356,9 +356,9 @@ if(WITH_SYSTEMD) FILES_MATCHING PATTERN "*.service") endif() diff --git a/net/sysrepo/patches/004-disable-sysrepod-autostart b/net/sysrepo/patches/004-disable-sysrepod-autostart.patch similarity index 92% rename from net/sysrepo/patches/004-disable-sysrepod-autostart rename to net/sysrepo/patches/004-disable-sysrepod-autostart.patch index a70113771..255b4ad67 100644 --- a/net/sysrepo/patches/004-disable-sysrepod-autostart +++ b/net/sysrepo/patches/004-disable-sysrepod-autostart.patch @@ -1,6 +1,6 @@ --- a/src/clientlib/client_library.c +++ b/src/clientlib/client_library.c -@@ -396,13 +396,13 @@ sr_connect(const char *app_name, const s +@@ -396,13 +396,13 @@ sr_connect(const char *app_name, const sr_conn_options_t opts, sr_conn_ctx_t **c if (opts & SR_CONN_DAEMON_REQUIRED) { if ((opts & SR_CONN_DAEMON_START) && (0 == getuid())) { /* sysrepo daemon start requested and process is running under root privileges */ diff --git a/net/sysrepo/patches/005-fix-struct-ucred-define b/net/sysrepo/patches/005-fix-struct-ucred-define.patch similarity index 87% rename from net/sysrepo/patches/005-fix-struct-ucred-define rename to net/sysrepo/patches/005-fix-struct-ucred-define.patch index 9de4e2ed8..4c5966de1 100644 --- a/net/sysrepo/patches/005-fix-struct-ucred-define +++ b/net/sysrepo/patches/005-fix-struct-ucred-define.patch @@ -1,6 +1,6 @@ --- a/src/common/sr_utils.c +++ b/src/common/sr_utils.c -@@ -477,14 +477,24 @@ sr_fd_set_nonblock(int fd) +@@ -506,14 +506,24 @@ sr_fd_set_nonblock(int fd) #if defined(SO_PEERCRED) @@ -14,14 +14,14 @@ }; #endif /* !defined(SCM_CREDENTIALS) */ +#else -+#if !defined(__USE_GNU) ++#if !defined(_GNU_SOURCE) +struct ucred { + pid_t pid; /* process ID of the sending process */ + uid_t uid; /* user ID of the sending process */ + gid_t gid; /* group ID of the sending process */ +}; +/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */ -+#endif /* !defined(__USE_GNU) */ ++#endif /* !defined(__GNU_SOURCE) */ +#endif /* defined(__GLIBC__) */ int diff --git a/net/sysrepo/patches/006-update-generated-protobufc-files b/net/sysrepo/patches/006-update-generated-protobufc-files.patch similarity index 81% rename from net/sysrepo/patches/006-update-generated-protobufc-files rename to net/sysrepo/patches/006-update-generated-protobufc-files.patch index 093fc4154..dbb4288e6 100644 --- a/net/sysrepo/patches/006-update-generated-protobufc-files +++ b/net/sysrepo/patches/006-update-generated-protobufc-files.patch @@ -1,6 +1,6 @@ --- a/src/common/sysrepo.pb-c.c +++ b/src/common/sysrepo.pb-c.c -@@ -8013,7 +8013,7 @@ const ProtobufCMessageDescriptor sr__eve +@@ -8013,7 +8013,7 @@ const ProtobufCMessageDescriptor sr__event_notif_replay_resp__descriptor = (ProtobufCMessageInit) sr__event_notif_replay_resp__init, NULL,NULL,NULL /* reserved[123] */ }; @@ -9,7 +9,7 @@ { { "xpath", -@@ -8063,8 +8063,21 @@ static const ProtobufCFieldDescriptor sr +@@ -8063,8 +8063,21 @@ static const ProtobufCFieldDescriptor sr__data_provide_req__field_descriptors[4] 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, @@ -31,7 +31,7 @@ 3, /* field[3] = request_id */ 1, /* field[1] = subscriber_address */ 2, /* field[2] = subscription_id */ -@@ -8075,7 +8088,7 @@ static const ProtobufCIntRange sr__data_ +@@ -8075,7 +8088,7 @@ static const ProtobufCIntRange sr__data_provide_req__number_ranges[3 + 1] = { 1, 0 }, { 10, 1 }, { 20, 3 }, @@ -40,7 +40,7 @@ }; const ProtobufCMessageDescriptor sr__data_provide_req__descriptor = { -@@ -8085,7 +8098,7 @@ const ProtobufCMessageDescriptor sr__dat +@@ -8085,7 +8098,7 @@ const ProtobufCMessageDescriptor sr__data_provide_req__descriptor = "Sr__DataProvideReq", "sr", sizeof(Sr__DataProvideReq), From 4e23b0fcf69e06633649c9ac6c724622a9d69b6c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 15 Jul 2019 16:01:53 -0700 Subject: [PATCH 3/4] Netopeer2: Update to 0.7-r2 Small cleanups. Removed upstreamed patch. Suffixed all patches with .patch Signed-off-by: Rosen Penev --- net/Netopeer2/Makefile | 10 +++--- ...ke-build => 001-fix-for-cmake-build.patch} | 31 +++++++------------ ... => 002-fix-keystored-cross-compile.patch} | 8 ++--- .../patches/010-openssl-deprecated.patch | 14 --------- 4 files changed, 19 insertions(+), 44 deletions(-) rename net/Netopeer2/patches/{001-fix-for-cmake-build => 001-fix-for-cmake-build.patch} (58%) rename net/Netopeer2/patches/{002-fix-keystored-cross-compile => 002-fix-keystored-cross-compile.patch} (60%) delete mode 100644 net/Netopeer2/patches/010-openssl-deprecated.patch diff --git a/net/Netopeer2/Makefile b/net/Netopeer2/Makefile index 1eb1b68e1..db6fd8d46 100644 --- a/net/Netopeer2/Makefile +++ b/net/Netopeer2/Makefile @@ -10,19 +10,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=Netopeer2 -PKG_VERSION:=0.7-r1 -PKG_RELEASE:=3 +PKG_VERSION:=0.7-r2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/CESNET/Netopeer2/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=040013d1e315c62c496b704475665165578c374ffb387cbbff422cf8898d3a12 +PKG_HASH:=59688271be4fecbbee671fc7eb3dc0538b13b4baab53e923e26eaeb33e6f7ec0 PKG_MAINTAINER:=Mislav Novakovic PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -65,8 +65,6 @@ define Package/netopeer2/description endef CMAKE_OPTIONS += \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DCMAKE_BUILD_TYPE:STRING=Release \ -DKEYSTORED_KEYS_DIR:STRING=/etc/keystored/keys \ -DENABLE_CONFIGURATION:BOOL=OFF \ -DMODEL_INSTALL:BOOL=OFF \ diff --git a/net/Netopeer2/patches/001-fix-for-cmake-build b/net/Netopeer2/patches/001-fix-for-cmake-build.patch similarity index 58% rename from net/Netopeer2/patches/001-fix-for-cmake-build rename to net/Netopeer2/patches/001-fix-for-cmake-build.patch index 3dae3caa5..ce69ee3a2 100644 --- a/net/Netopeer2/patches/001-fix-for-cmake-build +++ b/net/Netopeer2/patches/001-fix-for-cmake-build.patch @@ -1,17 +1,13 @@ -Index: Netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/CMakeLists.txt -=================================================================== --- /dev/null -+++ Netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/CMakeLists.txt ++++ b/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 +--- a/cli/CMakeLists.txt ++++ b/cli/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) @@ -21,7 +17,7 @@ Index: Netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/cli/CMakeLists. project(netopeer2-cli C) include(GNUInstallDirs) -@@ -83,7 +83,7 @@ endif() +@@ -84,7 +84,7 @@ endif() install(FILES ${PROJECT_SOURCE_DIR}/doc/${PROJECT_NAME}.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) # clean cmake cache @@ -30,10 +26,8 @@ Index: Netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/cli/CMakeLists. 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 +--- a/keystored/CMakeLists.txt ++++ b/keystored/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) @@ -43,7 +37,7 @@ Index: Netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/keystored/CMake project(keystored C) include(GNUInstallDirs) -@@ -140,7 +140,7 @@ if (SSH_KEY_INSTALL) +@@ -147,7 +147,7 @@ if (SSH_KEY_INSTALL) execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ssh-key-import.sh)") endif() @@ -52,10 +46,8 @@ Index: Netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/keystored/CMake scripts/model-install.sh scripts/ssh-key-import.sh ) -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 +--- a/server/CMakeLists.txt ++++ b/server/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8.9) @@ -65,11 +57,12 @@ Index: Netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/server/CMakeLis project(netopeer2-server C) include(GNUInstallDirs) -@@ -204,7 +204,7 @@ if (ENABLE_CONFIGURATION) +@@ -208,7 +208,7 @@ if (ENABLE_CONFIGURATION) execute_process(COMMAND ${PROJECT_BINARY_DIR}/model-install.sh)") endif() - + -add_custom_target(install-scripts-ide +add_custom_target(install-scripts-ide-server ${PROJECT_BINARY_DIR}/model-install.sh ) + diff --git a/net/Netopeer2/patches/002-fix-keystored-cross-compile b/net/Netopeer2/patches/002-fix-keystored-cross-compile.patch similarity index 60% rename from net/Netopeer2/patches/002-fix-keystored-cross-compile rename to net/Netopeer2/patches/002-fix-keystored-cross-compile.patch index 11301e768..db30cd421 100644 --- a/net/Netopeer2/patches/002-fix-keystored-cross-compile +++ b/net/Netopeer2/patches/002-fix-keystored-cross-compile.patch @@ -1,7 +1,5 @@ -Index: Netopeer2-0.6-r1/keystored/CMakeLists.txt -=================================================================== ---- Netopeer2-0.6-r1.orig/keystored/CMakeLists.txt -+++ Netopeer2-0.6-r1/keystored/CMakeLists.txt +--- a/keystored/CMakeLists.txt ++++ b/keystored/CMakeLists.txt @@ -69,6 +69,8 @@ find_package(SYSREPO REQUIRED) target_link_libraries(keystored ${SYSREPO_LIBRARIES}) include_directories(${SYSREPO_INCLUDE_DIRS}) @@ -11,7 +9,7 @@ Index: Netopeer2-0.6-r1/keystored/CMakeLists.txt # get sysrepo plugins directory if (NOT SR_PLUGINS_DIR) if (PKG_CONFIG_FOUND) -@@ -154,3 +156,4 @@ add_custom_target(install-scripts-ide-ke +@@ -154,3 +156,4 @@ add_custom_target(install-scripts-ide # plugins should be installed into sysrepo plugins dir install(TARGETS keystored DESTINATION ${SR_PLUGINS_DIR}) diff --git a/net/Netopeer2/patches/010-openssl-deprecated.patch b/net/Netopeer2/patches/010-openssl-deprecated.patch deleted file mode 100644 index b0a9f4f06..000000000 --- a/net/Netopeer2/patches/010-openssl-deprecated.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/cli/commands.c -+++ b/cli/commands.c -@@ -1659,7 +1659,11 @@ parse_cert(const char *name, const char *path) - BIO_printf(bio_out, "\n"); - - BIO_printf(bio_out, "Valid until: "); -+#if OPENSSL_VERSION_NUMBER < 0x10100000L // < 1.1.0 - ASN1_TIME_print(bio_out, X509_get_notAfter(cert)); -+#else -+ ASN1_TIME_print(bio_out, X509_get0_notAfter(cert)); -+#endif - BIO_printf(bio_out, "\n"); - - has_san = 0; From c6cf2dadc0c81b78b1a737c32ff67f0e7ca383a1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 4 Nov 2019 12:24:07 -0800 Subject: [PATCH 4/4] sysrepo: Switch to Python 3 Python 2 will be EOL by the end of the year. Switch to Python 3 as there is already support for it. Signed-off-by: Rosen Penev --- net/sysrepo/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/sysrepo/Makefile b/net/sysrepo/Makefile index a5578ef6b..c5ef604f3 100644 --- a/net/sysrepo/Makefile +++ b/net/sysrepo/Makefile @@ -26,7 +26,7 @@ PKG_BUILD_DEPENDS:=SYSREPO_BINDINGS:swig/host include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk ifeq ($(CONFIG_SYSREPO_PYTHON),y) -$(call include_mk, python-package.mk) +$(call include_mk, python3-package.mk) endif define Package/libsysrepo/config @@ -38,7 +38,7 @@ define Package/libsysrepo 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:python-base +SYSREPO_LUA:lua + DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +libpthread +SYSREPO_BINDINGS:libstdcpp +SYSREPO_PYTHON:python3-base +SYSREPO_LUA:lua MENU:=1 endef @@ -98,7 +98,8 @@ endif ifeq ($(CONFIG_SYSREPO_PYTHON),y) CMAKE_OPTIONS += \ -DGEN_PYTHON_BINDINGS:BOOL=TRUE \ - -DGEN_PYTHON_VERSION=2 + -DGEN_PYTHON_VERSION=3 \ + -DGEN_PYTHON3_TESTS:BOOL=FALSE endif ifeq ($(CONFIG_SYSREPO_BINDINGS),y) @@ -136,8 +137,8 @@ ifeq ($(CONFIG_SYSREPO_PYTHON),y) $(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/python2/libsysrepoPython2.py $(1)$(PYTHON_PKG_DIR) - $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python2/_libsysrepoPython2.so $(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)