Update to openwsman-2.6.5

This commit is contained in:
Vitezslav Crhonek 2018-01-23 13:47:32 +01:00
parent e348d774bc
commit 84d17f67f3
9 changed files with 82 additions and 377 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/openwsmand.8.gz
/openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b.tar.gz
/v2.6.5.tar.gz

View File

@ -6,7 +6,7 @@ diff -up openwsman-2.4.12/bindings/ruby/extconf.rb.orig openwsman-2.4.12/binding
major, minor, path = RUBY_VERSION.split(".")
-raise "SWIG failed to run" unless system("#{swig} -ruby -autorename -DRUBY_VERSION=#{major}#{minor} -I. -I/usr/include/openwsman -o openwsman_wrap.c openwsman.i")
+raise "SWIG failed to run" unless system("#{swig} -ruby -autorename -DRUBY_VERSION=#{major}#{minor} -I. -I/usr/include/openwsman -I/builddir/build/BUILD/openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/include/ -o openwsman_wrap.c openwsman.i")
+raise "SWIG failed to run" unless system("#{swig} -ruby -autorename -DRUBY_VERSION=#{major}#{minor} -I. -I/usr/include/openwsman -I/builddir/build/BUILD/openwsman-2.6.5/include/ -o openwsman_wrap.c openwsman.i")
$CPPFLAGS = "-I/usr/include/openwsman -I.."

View File

@ -1,34 +0,0 @@
From 86f06c1e30b2fddeac6be8f8508ac225ebd0d4e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Fri, 24 Nov 2017 16:39:22 +0100
Subject: [PATCH 06/20] Find Ruby 2.5
---
cmake/modules/FindRuby.cmake | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/modules/FindRuby.cmake b/cmake/modules/FindRuby.cmake
index 1671f029..bc6d48d4 100644
--- a/cmake/modules/FindRuby.cmake
+++ b/cmake/modules/FindRuby.cmake
@@ -21,7 +21,7 @@ endif (RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
# RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'`
# RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
-FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby22 ruby21 ruby20 ruby19 ruby1.8 ruby18 )
+FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby.ruby2.5 ruby.ruby2.4 ruby.ruby2.3 ruby.ruby2.2 ruby ruby22 ruby21 ruby20 ruby19 ruby1.8 ruby18 )
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['MAJOR']"
OUTPUT_VARIABLE RUBY_VERSION_MAJOR)
@@ -91,7 +91,7 @@ FIND_PATH(RUBY_INCLUDE_PATH
/usr/lib/ruby/1.8/i586-linux-gnu/ )
FIND_LIBRARY(RUBY_LIBRARY
- NAMES ruby ruby1.9 ruby1.8
+ NAMES ruby2.5 ruby2.4 ruby2.3 ruby2.2 ruby2.1 ruby ruby1.9 ruby1.8
PATHS
${RUBY_POSSIBLE_LIB_PATH}
${RUBY_RUBY_LIB_PATH}
--
2.15.1

View File

@ -1,58 +0,0 @@
From 0082a57f47aafb4ba3def4754602bdc0750ead6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Fri, 24 Nov 2017 16:40:07 +0100
Subject: [PATCH 08/20] Make ruby_parser_swig Ruby2.5-aware
---
bindings/ruby/rdoc_parser_swig.rb | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/bindings/ruby/rdoc_parser_swig.rb b/bindings/ruby/rdoc_parser_swig.rb
index 6f72f791..0c5bd415 100644
--- a/bindings/ruby/rdoc_parser_swig.rb
+++ b/bindings/ruby/rdoc_parser_swig.rb
@@ -364,11 +364,17 @@ class RDoc::Parser::SWIG < RDoc::Parser
#meth_obj.params = params
meth_obj.start_collecting_tokens
- tk = RDoc::RubyToken::Token.new nil, 1, 1
- tk.set_text body
+ begin
+ RDoc::const_get "RubyToken"
+ tk = RDoc::RubyToken::Token.new nil, 1, 1
+ tk.set_text body
+ meth_obj.offset = offset
+ rescue NameError
+ # rdoc 2.5
+ tk = { :line_no => 1, :char_no => 1, :text => body }
+ end
meth_obj.add_token tk
meth_obj.comment = strip_stars comment
- meth_obj.offset = offset
meth_obj.line = file_content[0, offset].count("\n") + 1
body
@@ -381,11 +387,17 @@ class RDoc::Parser::SWIG < RDoc::Parser
find_modifiers comment, meth_obj
meth_obj.start_collecting_tokens
- tk = RDoc::RubyToken::Token.new nil, 1, 1
- tk.set_text body
+ begin
+ RDoc::const_get "RubyToken"
+ tk = RDoc::RubyToken::Token.new nil, 1, 1
+ tk.set_text body
+ meth_obj.offset = offset
+ rescue NameError
+ # rdoc 2.5
+ tk = { :line_no => 1, :char_no => 1, :text => body }
+ end
meth_obj.add_token tk
meth_obj.comment = strip_stars(comment) + meth_obj.comment.to_s
- meth_obj.offset = offset
meth_obj.line = file_content[0, offset].count("\n") + 1
body
--
2.15.1

View File

@ -1,6 +1,6 @@
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/lib/wsman-curl-client-transport.c.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/lib/wsman-curl-client-transport.c
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/lib/wsman-curl-client-transport.c.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/lib/wsman-curl-client-transport.c 2017-09-12 12:56:51.720463095 +0200
diff -up openwsman-2.6.5/src/lib/wsman-curl-client-transport.c.orig openwsman-2.6.5/src/lib/wsman-curl-client-transport.c
--- openwsman-2.6.5/src/lib/wsman-curl-client-transport.c.orig 2017-11-28 09:32:15.000000000 +0100
+++ openwsman-2.6.5/src/lib/wsman-curl-client-transport.c 2018-01-23 13:14:59.357153453 +0100
@@ -241,12 +241,20 @@ write_handler( void *ptr, size_t size, s
static int ssl_certificate_thumbprint_verify_callback(X509_STORE_CTX *ctx, void *arg)
{
@ -23,53 +23,23 @@ diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/lib/wsman-curl-c
if ( X509_digest(cert, tempDigest, tempFingerprint, &tempFingerprintLen ) <= 0)
return 0;
if(!memcmp(tempFingerprint, thumbprint, tempFingerprintLen))
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/compat_unix.h.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/compat_unix.h
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/compat_unix.h.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/compat_unix.h 2017-09-12 12:56:51.720463095 +0200
@@ -27,7 +27,6 @@
diff -up openwsman-2.6.5/src/server/shttpd/compat_unix.h.orig openwsman-2.6.5/src/server/shttpd/compat_unix.h
--- openwsman-2.6.5/src/server/shttpd/compat_unix.h.orig 2017-11-28 09:32:15.000000000 +0100
+++ openwsman-2.6.5/src/server/shttpd/compat_unix.h 2018-01-23 13:14:59.357153453 +0100
@@ -27,10 +27,6 @@
pthread_create(&tid, NULL, (void *(*)(void *))a, c); } while (0)
#endif /* !NO_THREADS */
-#ifndef SSL_LIB
-#define SSL_LIB "libssl.so"
-#endif
-
#define DIRSEP '/'
#define IS_DIRSEP_CHAR(c) ((c) == '/')
#define O_BINARY 0
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/config.h.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/config.h
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/config.h.orig 2017-09-12 12:56:51.720463095 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/config.h 2017-09-12 12:56:51.720463095 +0200
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com>
+ * All rights reserved
+ *
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * Sergey Lyubka wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return.
+ */
+
+#ifndef CONFIG_HEADER_DEFINED
+#define CONFIG_HEADER_DEFINED
+
+#define SHTTPD_VERSION "1.42" /* Version */
+#define CONFIG_FILE "shttpd.conf" /* Configuration file */
+#define HTPASSWD ".htpasswd" /* Passwords file name */
+#define URI_MAX 16384 /* Default max request size */
+#define LISTENING_PORTS "80" /* Default listening ports */
+#define INDEX_FILES "index.html,index.htm,index.php,index.cgi"
+#define CGI_EXT "cgi,pl,php" /* Default CGI extensions */
+#define SSI_EXT "shtml,shtm" /* Default SSI extensions */
+#define REALM "mydomain.com" /* Default authentication realm */
+#define DELIM_CHARS "," /* Separators for lists */
+#define EXPIRE_TIME 3600 /* Expiration time, seconds */
+#define ENV_MAX 4096 /* Size of environment block */
+#define CGI_ENV_VARS 64 /* Maximum vars passed to CGI */
+#define SERVICE_NAME "SHTTPD " VERSION /* NT service name */
+
+#endif /* CONFIG_HEADER_DEFINED */
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/io_ssl.c.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/io_ssl.c
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/io_ssl.c.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/io_ssl.c 2017-09-12 12:56:51.720463095 +0200
diff -up openwsman-2.6.5/src/server/shttpd/io_ssl.c.orig openwsman-2.6.5/src/server/shttpd/io_ssl.c
--- openwsman-2.6.5/src/server/shttpd/io_ssl.c.orig 2017-11-28 09:32:15.000000000 +0100
+++ openwsman-2.6.5/src/server/shttpd/io_ssl.c 2018-01-23 13:14:59.357153453 +0100
@@ -11,23 +11,6 @@
#include "defs.h"
@ -94,12 +64,12 @@ diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/io
void
_shttpd_ssl_handshake(struct stream *stream)
{
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/shttpd.c.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/shttpd.c
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/shttpd.c.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/shttpd.c 2017-09-12 12:58:20.132254340 +0200
@@ -1474,20 +1474,14 @@ set_ssl(struct shttpd_ctx *ctx, const ch
char *ssl_disabled_protocols = wsmand_options_get_ssl_disabled_protocols();
diff -up openwsman-2.6.5/src/server/shttpd/shttpd.c.orig openwsman-2.6.5/src/server/shttpd/shttpd.c
--- openwsman-2.6.5/src/server/shttpd/shttpd.c.orig 2017-11-28 09:32:15.000000000 +0100
+++ openwsman-2.6.5/src/server/shttpd/shttpd.c 2018-01-23 13:16:13.738228773 +0100
@@ -1476,20 +1476,14 @@ set_ssl(struct shttpd_ctx *ctx, const ch
int retval = FALSE;
EC_KEY* key;
- /* Load SSL library dynamically */
- if ((lib = dlopen(SSL_LIB, RTLD_LAZY)) == NULL) {
@ -124,7 +94,7 @@ diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/sh
if ((CTX = SSL_CTX_new(SSLv23_server_method())) == NULL)
_shttpd_elog(E_LOG, NULL, "SSL_CTX_new error");
@@ -1523,7 +1517,11 @@ set_ssl(struct shttpd_ctx *ctx, const ch
@@ -1532,7 +1526,11 @@ set_ssl(struct shttpd_ctx *ctx, const ch
if (strncasecmp(protocols[idx].name, ssl_disabled_protocols, blank_ptr-ssl_disabled_protocols) == 0) {
//_shttpd_elog(E_LOG, NULL, "SSL: disable %s protocol", protocols[idx].name);
debug("SSL: disable %s protocol", protocols[idx].name);
@ -136,9 +106,9 @@ diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/sh
break;
}
}
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/ssl.h.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/ssl.h
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/ssl.h.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/shttpd/ssl.h 2017-09-12 12:56:51.721463093 +0200
diff -up openwsman-2.6.5/src/server/shttpd/ssl.h.orig openwsman-2.6.5/src/server/shttpd/ssl.h
--- openwsman-2.6.5/src/server/shttpd/ssl.h.orig 2017-11-28 09:32:15.000000000 +0100
+++ openwsman-2.6.5/src/server/shttpd/ssl.h 2018-01-23 13:14:59.358153454 +0100
@@ -12,50 +12,4 @@
#include <openssl/ssl.h>

View File

@ -1,179 +0,0 @@
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/CMakeLists.txt.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/CMakeLists.txt
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/CMakeLists.txt.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/CMakeLists.txt 2017-01-16 14:08:53.201529586 +0100
@@ -10,6 +10,7 @@ include_directories(${CMAKE_BINARY_DIR})
IF( BUILD_PYTHON )
add_subdirectory(python)
+add_subdirectory(python3)
ENDIF( BUILD_PYTHON )
IF( BUILD_RUBY )
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/python3/CMakeLists.txt.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/python3/CMakeLists.txt
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/python3/CMakeLists.txt.orig 2017-01-16 14:08:09.000000000 +0100
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/python3/CMakeLists.txt 2017-01-16 14:10:48.945480021 +0100
@@ -12,11 +12,28 @@ enable_testing()
add_subdirectory(tests)
-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))" OUTPUT_VARIABLE PYTHON_LIB_DIR)
-STRING(REPLACE "\n" "" PYTHON_LIB_DIR "${PYTHON_LIB_DIR}")
+MESSAGE(STATUS "Python3 build:")
+unset(Python_ADDITIONAL_VERSIONS)
+set(Python_ADDITIONAL_VERSIONS 3.5)
+FIND_PACKAGE(PythonLibs)
+IF (PYTHON_LIBRARY)
+ FIND_PACKAGE(PythonInterp REQUIRED)
+ #MESSAGE(STATUS "Found PythonLibs...")
+ FIND_PACKAGE(PythonLinkLibs)
+ #IF (PYTHON_LINK_LIBS)
+ # MESSAGE(STATUS "Building Python...")
+ #ENDIF (PYTHON_LINK_LIBS)
+ENDIF (PYTHON_LIBRARY)
+
+set(PYTHON3_EXECUTABLE "${PYTHON_EXECUTABLE}")
+set(PYTHON3_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}")
+set({PYTHON3_INCLUDE_PATH "${PYTHON_INCLUDE_PATH}")
-MESSAGE(STATUS "Python executable: ${PYTHON_EXECUTABLE}")
-MESSAGE(STATUS "Python lib dir: ${PYTHON_LIB_DIR}")
+EXECUTE_PROCESS(COMMAND ${PYTHON3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))" OUTPUT_VARIABLE PYTHON3_LIB_DIR)
+STRING(REPLACE "\n" "" PYTHON3_LIB_DIR "${PYTHON3_LIB_DIR}")
+
+MESSAGE(STATUS "Python executable: ${PYTHON3_EXECUTABLE}")
+MESSAGE(STATUS "Python lib dir: ${PYTHON3_LIB_DIR}")
SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/openwsman_wrap.c" )
@@ -36,14 +53,14 @@ SET(pywsman_SRCS ${SWIG_OUTPUT} ${CMAKE_
ADD_LIBRARY( pywsman SHARED ${pywsman_SRCS} )
SET_TARGET_PROPERTIES( pywsman PROPERTIES PREFIX "_" )
-INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} )
+INCLUDE_DIRECTORIES( ${PYTHON3_INCLUDE_DIRS} )
# RHEL5 needs this:
-INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} )
+INCLUDE_DIRECTORIES( ${PYTHON3_INCLUDE_PATH} )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/bindings ${CMAKE_SOURCE_DIR}/include )
TARGET_LINK_LIBRARIES( pywsman wsman )
TARGET_LINK_LIBRARIES( pywsman wsman_client )
-INSTALL(TARGETS pywsman LIBRARY DESTINATION ${PYTHON_LIB_DIR})
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pywsman.py DESTINATION ${PYTHON_LIB_DIR} )
+INSTALL(TARGETS pywsman LIBRARY DESTINATION ${PYTHON3_LIB_DIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pywsman.py DESTINATION ${PYTHON3_LIB_DIR} )
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/python/CMakeLists.txt.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/python/CMakeLists.txt
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/python/CMakeLists.txt.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/bindings/python/CMakeLists.txt 2017-01-16 14:12:51.954427345 +0100
@@ -12,11 +12,52 @@ enable_testing()
add_subdirectory(tests)
-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))" OUTPUT_VARIABLE PYTHON_LIB_DIR)
-STRING(REPLACE "\n" "" PYTHON_LIB_DIR "${PYTHON_LIB_DIR}")
+MESSAGE(STATUS "Python2 build:")
+set(Python_ADDITIONAL_VERSIONS 2.7)
+FIND_PACKAGE(PythonLibs)
+IF (PYTHON_LIBRARY)
+ FIND_PACKAGE(PythonInterp REQUIRED)
+ #MESSAGE(STATUS "Found PythonLibs...")
+ FIND_PACKAGE(PythonLinkLibs)
+ #IF (PYTHON_LINK_LIBS)
+ # MESSAGE(STATUS "Building Python...")
+ #ENDIF (PYTHON_LINK_LIBS)
+ENDIF (PYTHON_LIBRARY)
+
+set(PYTHON2_EXECUTABLE "${PYTHON_EXECUTABLE}")
+set(PYTHON2_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}")
+set(PYTHON2_INCLUDE_PATH "${PYTHON_INCLUDE_PATH}")
+
+# clear FIND_PACKAGE(PythonLibs) side effects
+unset(PYTHONLIBS_FOUND)
+unset(PYTHON_LIBRARIES)
+unset(PYTHON_INCLUDE_PATH)
+unset(PYTHON_INCLUDE_DIRS)
+unset(PYTHON_DEBUG_LIBRARIES)
+unset(PYTHONLIBS_VERSION_STRING)
+unset(PYTHON_DEBUG_LIBRARY CACHE)
+unset(PYTHON_LIBRARY)
+unset(PYTHON_LIBRARY_DEBUG)
+unset(PYTHON_LIBRARY_RELEASE)
+unset(PYTHON_LIBRARY CACHE)
+unset(PYTHON_LIBRARY_DEBUG CACHE)
+unset(PYTHON_LIBRARY_RELEASE CACHE)
+unset(PYTHON_INCLUDE_DIR CACHE)
+unset(PYTHON_INCLUDE_DIR2 CACHE)
+
+# clear FIND_PACKAGE(PythonInterp) side effects
+unset(PYTHONINTERP_FOUND)
+unset(PYTHON_EXECUTABLE CACHE)
+unset(PYTHON_VERSION_STRING)
+unset(PYTHON_VERSION_MAJOR)
+unset(PYTHON_VERSION_MINOR)
+unset(PYTHON_VERSION_PATCH)
-MESSAGE(STATUS "Python executable: ${PYTHON_EXECUTABLE}")
-MESSAGE(STATUS "Python lib dir: ${PYTHON_LIB_DIR}")
+EXECUTE_PROCESS(COMMAND ${PYTHON2_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" OUTPUT_VARIABLE PYTHON2_LIB_DIR)
+STRING(REPLACE "\n" "" PYTHON2_LIB_DIR "${PYTHON2_LIB_DIR}")
+
+MESSAGE(STATUS "Python executable: ${PYTHON2_EXECUTABLE}")
+MESSAGE(STATUS "Python lib dir: ${PYTHON2_LIB_DIR}")
SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/openwsman_wrap.c" )
@@ -36,14 +77,14 @@ SET(pywsman_SRCS ${SWIG_OUTPUT} ${CMAKE_
ADD_LIBRARY( pywsman SHARED ${pywsman_SRCS} )
SET_TARGET_PROPERTIES( pywsman PROPERTIES PREFIX "_" )
-INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} )
+INCLUDE_DIRECTORIES( ${PYTHON2_INCLUDE_DIRS} )
# RHEL5 needs this:
-INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} )
+INCLUDE_DIRECTORIES( ${PYTHON2_INCLUDE_PATH} )
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/bindings ${CMAKE_SOURCE_DIR}/include )
TARGET_LINK_LIBRARIES( pywsman wsman )
TARGET_LINK_LIBRARIES( pywsman wsman_client )
-INSTALL(TARGETS pywsman LIBRARY DESTINATION ${PYTHON_LIB_DIR})
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pywsman.py DESTINATION ${PYTHON_LIB_DIR} )
+INSTALL(TARGETS pywsman LIBRARY DESTINATION ${PYTHON2_LIB_DIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pywsman.py DESTINATION ${PYTHON2_LIB_DIR} )
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/CMakeLists.txt.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/CMakeLists.txt
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/CMakeLists.txt.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/CMakeLists.txt 2017-01-16 14:13:37.300407926 +0100
@@ -175,30 +175,6 @@ MESSAGE(STATUS "Building Ruby bindings"
ENDIF(NOT RUBY_INCLUDE_PATH )
ENDIF( BUILD_RUBY )
-IF( BUILD_PYTHON )
- MESSAGE(STATUS "Building Python bindings" )
- FIND_PACKAGE(PythonLibs 2.6 REQUIRED)
- IF (PYTHON_LIBRARY)
- FIND_PACKAGE(PythonInterp 2.6 REQUIRED)
- MESSAGE(STATUS "Found PythonLibs...")
- FIND_PACKAGE(PythonLinkLibs)
- IF (PYTHON_LINK_LIBS)
- MESSAGE(STATUS "Building Python...")
- ENDIF (PYTHON_LINK_LIBS)
- ENDIF (PYTHON_LIBRARY)
- IF(NOT PYTHON_INCLUDE_DIRS )
- # fallback for older versions of cmake
- SET(PYTHON_INCLUDE_DIRS PYTHON_INCLUDE_PATH)
- ENDIF(NOT PYTHON_INCLUDE_DIRS )
- IF(NOT PYTHON_INCLUDE_DIRS )
- IF(BUILD_PYTHON_EXPLICIT)
- NO_HEADERS_WARNING_EXPL(BUILD_PYTHON Python)
- ELSE(BUILD_PYTHON_EXPLICIT)
- NO_HEADERS_WARNING(BUILD_PYTHON Python)
- ENDIF(BUILD_PYTHON_EXPLICIT)
- ENDIF(NOT PYTHON_INCLUDE_DIRS )
-ENDIF( BUILD_PYTHON )
-
IF( BUILD_PERL )
INCLUDE(FindPerl)
IF(PERL_EXECUTABLE)

View File

@ -0,0 +1,39 @@
diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/wsmand-listener.c.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/wsmand-listener.c
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/wsmand-listener.c.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/wsmand-listener.c 2018-01-22 13:05:04.478923300 +0100
@@ -344,6 +344,35 @@ DONE:
if (fault_reason == NULL) {
// this is a way to segfault, investigate
//fault_reason = shttpd_reason_phrase(status);
+ // ugly workaround follows...
+ switch (status) {
+ case 200:
+ fault_reason = "OK";
+ break;
+ case 400:
+ fault_reason = "Bad request";
+ break;
+ case 401:
+ fault_reason = "Unauthorized";
+ break;
+ case 403:
+ fault_reason = "Forbidden";
+ break;
+ case 404:
+ fault_reason = "Not found";
+ break;
+ case 500:
+ fault_reason = "Internal Error";
+ break;
+ case 501:
+ fault_reason = "Not implemented";
+ break;
+ case 415:
+ fault_reason = "Unsupported Media Type";
+ break;
+ default:
+ fault_reason = "";
+ }
}
debug("Response status=%d (%s)", status, fault_reason);

View File

@ -1,22 +1,14 @@
# RubyGems's macros expect gem_name to exist.
%global gem_name %{name}
%global commit 4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: openwsman
Version: 2.6.3
Release: 11.git%{shortcommit}%{?dist}
Version: 2.6.5
Release: 1%{?dist}
Summary: Open source Implementation of WS-Management
License: BSD
URL: http://www.openwsman.org/
# The source for this package was pulled from upstream's vcs. Use the
# following commands to generate the tarball:
# git clone https://github.com/Openwsman/openwsman.git; cd openwsman
# git archive --format tar --prefix openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/ \
# 4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b | gzip > openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b.tar.gz
Source0: %{name}-%{commit}.tar.gz
Source0: https://github.com/Openwsman/openwsman/archive/v%{version}.tar.gz
# help2man generated manpage for openwsmand binary
Source1: openwsmand.8.gz
# service file for systemd
@ -25,14 +17,11 @@ Source2: openwsmand.service
Source3: owsmantestcert.sh
Patch1: openwsman-2.4.0-pamsetup.patch
Patch2: openwsman-2.4.12-ruby-binding-build.patch
Patch3: openwsman-2.6.2-python3.patch
Patch4: openwsman-2.6.2-openssl-1.1-fix.patch
# Patch5, 6 are github backport fixes for ruby 2.5
Patch5: openwsman-2.6.2-0006-Find-Ruby-2.5.patch
Patch6: openwsman-2.6.2-0008-Make-ruby_parser_swig-Ruby2.5-aware.patch
Patch3: openwsman-2.6.2-openssl-1.1-fix.patch
Patch4: openwsman-2.6.5-http-status-line.patch
BuildRequires: swig
BuildRequires: libcurl-devel libxml2-devel pam-devel sblim-sfcc-devel
BuildRequires: python3 python3-devel python2 python2-devel ruby ruby-devel rubygems-devel perl-interpreter
BuildRequires: python3 python3-devel ruby ruby-devel rubygems-devel perl-interpreter
BuildRequires: perl-devel perl-generators pkgconfig openssl-devel
BuildRequires: cmake
BuildRequires: systemd-units
@ -84,25 +73,12 @@ Requires: libwsman1 = %{version}-%{release}
%description server
Openwsman Server and service libraries.
%package -n python2-openwsman
%{?python_provide:%python_provide python2-openwsman}
# Remove before F30
Provides: %{name}-python = %{version}-%{release}
Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python < %{version}-%{release}
License: BSD
Summary: Python bindings for openwsman client API
Requires: python2
Requires: libwsman1 = %{version}-%{release}
%description -n python2-openwsman
This package provides Python2 bindings to access the openwsman client API.
%package python3
License: BSD
Summary: Python bindings for openwsman client API
Requires: python3
Requires: libwsman1 = %{version}-%{release}
%{?python_provide:%python_provide python3-openwsman}
%description python3
This package provides Python3 bindings to access the openwsman client API.
@ -142,19 +118,12 @@ This is a command line tool for the Windows Remote Shell protocol.
You can use it to send shell commands to a remote Windows hosts.
%prep
%setup -q -n %{name}-%{commit}
# support python3
pushd bindings
cp -r python python3
popd
%setup -q
%patch1 -p1 -b .pamsetup
%patch2 -p1 -b .ruby-binding-build
%patch3 -p1 -b .python3
%patch4 -p1 -b .openssl-1.1-fix
%patch5 -p1 -b .ruby25_1
%patch6 -p1 -b .ruby25_2
%patch3 -p1 -b .openssl-1.1-fix
%patch4 -p1 -b .http-status-line
%build
# Removing executable permissions on .c and .h files to fix rpmlint warnings.
@ -182,9 +151,9 @@ make
# Make the freshly build openwsman libraries available to build the gem's
# binary extension.
export LIBRARY_PATH=%{_builddir}/%{name}-%{commit}/build/src/lib
export CPATH=%{_builddir}/%{name}-%{commit}/include/
export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{commit}/build/src/lib/
export LIBRARY_PATH=%{_builddir}/%{name}-%{version}/build/src/lib
export CPATH=%{_builddir}/%{name}-%{version}/include/
export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/build/src/lib/
%gem_install -n ./bindings/ruby/%{name}-%{version}.gem
@ -257,13 +226,6 @@ rm -f /var/log/wsmand.log
%{_libdir}/pkgconfig/*
%{_libdir}/*.so
%files -n python2-openwsman
%doc AUTHORS COPYING ChangeLog README.md
%{python2_sitearch}/*.so
%{python2_sitearch}/*.py
%{python2_sitearch}/*.pyc
%{python2_sitearch}/*.pyo
%files python3
%doc AUTHORS COPYING ChangeLog README.md
%{python3_sitearch}/*.so
@ -317,6 +279,11 @@ rm -f /var/log/wsmand.log
%{_bindir}/winrs
%changelog
* Tue Jan 23 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.6.5-1
- Update to openwsman-2.6.5
- Simplify python binding build and drop python2 subpackage
- Fix malformed HTTP 200 status line
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 2.6.3-11.git4391e5c
- Rebuilt for switch to libxcrypt

View File

@ -1,2 +1,2 @@
SHA512 (openwsmand.8.gz) = 751c40060781e8b5a847e09aee94833ed1e4fbe966f052e5023cb209361acc312078d0d75c0806bd9990da061d3048566418135d3670dd620c6b809e5d0e594c
SHA512 (openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b.tar.gz) = 9126053fb65457662e7a6275afe16b6fa6aaf978c2909aff97bca3d7dd3c8c1e7378e86ced97de42f86dd1060f2c7246ac3b1ecc4bf3d853606cc9d2d60d8eed
SHA512 (v2.6.5.tar.gz) = dff103d50ddf974aa90db5be74761dd83944e64e1bab65161ee2941949c46af57c5d53d011ccbf1ef21002c825f4a2be8d6431c83610dd930b5ac4352fd0762b