diff --git a/15c4f144a3783d9f1f2c976acf9f4d85988fd466.patch b/15c4f144a3783d9f1f2c976acf9f4d85988fd466.patch new file mode 100644 index 0000000..b8edd35 --- /dev/null +++ b/15c4f144a3783d9f1f2c976acf9f4d85988fd466.patch @@ -0,0 +1,25 @@ +From 15c4f144a3783d9f1f2c976acf9f4d85988fd466 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Sun, 5 Jan 2020 19:56:57 +0100 +Subject: [PATCH] rfbShutdownServer: Call rfbClientConnectionGone if no + backgroundLoop + +Otherwise the servers that don't use rfbRunEventLoop don't get +notified of client disconnections +--- + libvncserver/main.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libvncserver/main.c b/libvncserver/main.c +index b51f0ab6..738a501d 100644 +--- a/libvncserver/main.c ++++ b/libvncserver/main.c +@@ -1152,6 +1152,8 @@ void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool disconnectClients) { + write(currentCl->pipe_notify_client_thread[1], "\x00", 1); + /* And wait for it to finish. */ + pthread_join(currentCl->client_thread, NULL); ++ } else { ++ rfbClientConnectionGone(currentCl); + } + #else + rfbClientConnectionGone(currentCl); diff --git a/3348a7e42e86dfb98dd7458ad29def476cf6096f.patch b/3348a7e42e86dfb98dd7458ad29def476cf6096f.patch new file mode 100644 index 0000000..9adde95 --- /dev/null +++ b/3348a7e42e86dfb98dd7458ad29def476cf6096f.patch @@ -0,0 +1,42 @@ +From 3348a7e42e86dfb98dd7458ad29def476cf6096f Mon Sep 17 00:00:00 2001 +From: Christian Beier +Date: Sat, 9 Feb 2019 13:23:26 +0100 +Subject: [PATCH] CMake: replace hardcoded 'lib' with ${CMAKE_INSTALL_LIBDIR} + +Closes #281 +--- + CMakeLists.txt | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 873cc7b5..55f7e650 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,6 +9,7 @@ include(CheckTypeSize) + include(TestBigEndian) + include(CheckCSourceCompiles) + include(CheckCSourceRuns) ++include(GNUInstallDirs) + + enable_testing() + +@@ -666,8 +667,8 @@ get_link_libraries(PRIVATE_LIBS vncclient) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libvncclient.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/libvncclient.pc @ONLY) + + +-install_targets(/lib vncserver) +-install_targets(/lib vncclient) ++install_targets(/${CMAKE_INSTALL_LIBDIR} vncserver) ++install_targets(/${CMAKE_INSTALL_LIBDIR} vncclient) + install_files(/include/rfb FILES + rfb/keysym.h + rfb/rfb.h +@@ -677,7 +678,7 @@ install_files(/include/rfb FILES + rfb/rfbregion.h + ) + +-install_files(/lib/pkgconfig FILES ++install_files(/${CMAKE_INSTALL_LIBDIR}/pkgconfig FILES + libvncserver.pc + libvncclient.pc + ) diff --git a/36a71279ed5b10effecd879caf6c3791842ca713.patch b/36a71279ed5b10effecd879caf6c3791842ca713.patch new file mode 100644 index 0000000..c72b80e --- /dev/null +++ b/36a71279ed5b10effecd879caf6c3791842ca713.patch @@ -0,0 +1,38 @@ +From 36a71279ed5b10effecd879caf6c3791842ca713 Mon Sep 17 00:00:00 2001 +From: Christian Beier +Date: Thu, 28 Mar 2019 21:06:36 +0100 +Subject: [PATCH] CMake: replace 'lib' with ${CMAKE_INSTALL_LIBDIR} for + pkgconfig files as well + +Thanks to https://github.com/ikelos for spotting this ;-) + +Closes #290 +--- + libvncclient.pc.cmakein | 2 +- + libvncserver.pc.cmakein | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libvncclient.pc.cmakein b/libvncclient.pc.cmakein +index 169a8b7c..445f7e74 100644 +--- a/libvncclient.pc.cmakein ++++ b/libvncclient.pc.cmakein +@@ -1,6 +1,6 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=@CMAKE_INSTALL_PREFIX@ +-libdir=@CMAKE_INSTALL_PREFIX@/lib ++libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ + includedir=@CMAKE_INSTALL_PREFIX@/include + + Name: LibVNCClient +diff --git a/libvncserver.pc.cmakein b/libvncserver.pc.cmakein +index f38d74fe..c6898061 100644 +--- a/libvncserver.pc.cmakein ++++ b/libvncserver.pc.cmakein +@@ -1,6 +1,6 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=@CMAKE_INSTALL_PREFIX@ +-libdir=@CMAKE_INSTALL_PREFIX@/lib ++libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ + includedir=@CMAKE_INSTALL_PREFIX@/include + + Name: LibVNCServer diff --git a/CMakeLists.txt.patch b/CMakeLists.txt.patch deleted file mode 100644 index f0ebe0b..0000000 --- a/CMakeLists.txt.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ./CMakeLists.txt.orig 2020-02-10 05:29:48.921993426 +0000 -+++ ./CMakeLists.txt 2020-02-10 19:27:27.762744228 +0000 -@@ -666,8 +666,8 @@ get_link_libraries(PRIVATE_LIBS vncclien - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libvncclient.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/libvncclient.pc @ONLY) - - --install_targets(/lib vncserver) --install_targets(/lib vncclient) -+install_targets(/lib64 vncserver) -+install_targets(/lib64 vncclient) - install_files(/include/rfb FILES - rfb/keysym.h - rfb/rfb.h -@@ -677,7 +677,7 @@ install_files(/include/rfb FILES - rfb/rfbregion.h - ) - --install_files(/lib/pkgconfig FILES -+install_files(/lib64/pkgconfig FILES - libvncserver.pc - libvncclient.pc - ) diff --git a/d0a76539835d11c0f4723499f8be4bc9c7724eb9.patch b/d0a76539835d11c0f4723499f8be4bc9c7724eb9.patch new file mode 100644 index 0000000..7192b6f --- /dev/null +++ b/d0a76539835d11c0f4723499f8be4bc9c7724eb9.patch @@ -0,0 +1,32 @@ +From d0a76539835d11c0f4723499f8be4bc9c7724eb9 Mon Sep 17 00:00:00 2001 +From: Rajesh Sahoo +Date: Tue, 11 Jun 2019 15:13:04 +0530 +Subject: [PATCH] avoid pthread_join if backgroundLoop is FALSE + +client_thread is created depending upon backgroundLoop, but joining +without checking for same condition. so we are trying to join a garbage +thread_id. +--- + libvncserver/main.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libvncserver/main.c b/libvncserver/main.c +index d3cd9b1e..772fb18f 100644 +--- a/libvncserver/main.c ++++ b/libvncserver/main.c +@@ -1112,6 +1112,7 @@ void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool disconnectClients) { + } + + #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD ++ if(currentCl->screen->backgroundLoop) { + /* + Notify the thread. This simply writes a NULL byte to the notify pipe in order to get past the select() + in clientInput(), the loop in there will then break because the rfbCloseClient() above has set +@@ -1120,6 +1121,7 @@ void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool disconnectClients) { + write(currentCl->pipe_notify_client_thread[1], "\x00", 1); + /* And wait for it to finish. */ + pthread_join(currentCl->client_thread, NULL); ++ } + #else + rfbClientConnectionGone(currentCl); + #endif diff --git a/libvncserver.spec b/libvncserver.spec index b967d89..13f1138 100644 --- a/libvncserver.spec +++ b/libvncserver.spec @@ -8,7 +8,11 @@ License: GPLv2+ URL: http://libvnc.github.io/ Source0: https://github.com/LibVNC/libvncserver/archive/LibVNCServer-%{version}.tar.gz -Patch1: CMakeLists.txt.patch +Patch1: 3348a7e42e86dfb98dd7458ad29def476cf6096f.patch +Patch2: 36a71279ed5b10effecd879caf6c3791842ca713.patch +Patch3: d0a76539835d11c0f4723499f8be4bc9c7724eb9.patch +Patch4: 15c4f144a3783d9f1f2c976acf9f4d85988fd466.patch + ## TLS security type enablement patches # https://github.com/LibVNC/libvncserver/pull/234 @@ -84,9 +88,10 @@ developing applications that use %{name}. %prep %setup -q -n %{name}-LibVNCServer-%{version} -%if "%{_libdir}" == "/usr/lib64" %patch1 -p1 -%endif +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %patch10 -p1 %patch11 -p1