From 45fd53e60c48c726d35dcca116efcbb08d5e6760 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Mon, 2 Aug 2021 08:48:03 -0500 Subject: [PATCH] Fix FTBFS. --- 334.patch | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ libupnp.spec | 8 ++++++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 334.patch diff --git a/334.patch b/334.patch new file mode 100644 index 0000000..1282e8d --- /dev/null +++ b/334.patch @@ -0,0 +1,68 @@ +From 3968f7725a2eab6e579055ee44420f44c4a0be73 Mon Sep 17 00:00:00 2001 +From: Marcelo Roberto Jimenez +Date: Sun, 1 Aug 2021 20:44:13 -0300 +Subject: [PATCH] ithread: Remove references to + pthread_mutexattr_{g,s}etkind_np + +--- + upnp/inc/ithread.h | 33 ++++++++++++++------------------- + 1 file changed, 14 insertions(+), 19 deletions(-) + +diff --git a/upnp/inc/ithread.h b/upnp/inc/ithread.h +index f6800ea9..2087466b 100644 +--- a/upnp/inc/ithread.h ++++ b/upnp/inc/ithread.h +@@ -304,11 +304,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void) + * Returns EINVAL if the kind is not supported. + * See man page for pthread_mutexattr_setkind_np + *****************************************************************************/ +-#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__) +- #define ithread_mutexattr_setkind_np pthread_mutexattr_settype +-#else +- #define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np +-#endif /* UPNP_USE_RWLOCK */ ++#define ithread_mutexattr_setkind_np pthread_mutexattr_settype ++#define ithread_mutexattr_settype pthread_mutexattr_settype + + /**************************************************************************** + * Function: ithread_mutexattr_getkind_np +@@ -329,11 +326,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void) + * Always returns 0. + * See man page for pthread_mutexattr_getkind_np + *****************************************************************************/ +-#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__) +- #define ithread_mutexattr_getkind_np pthread_mutexattr_gettype +-#else +- #define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np +-#endif /* UPNP_USE_RWLOCK */ ++#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype ++#define ithread_mutexattr_gettype pthread_mutexattr_gettype + + /**************************************************************************** + * Function: ithread_mutex_init +@@ -898,15 +892,16 @@ static UPNP_INLINE int ithread_cleanup_thread(void) + #ifdef _WIN32 + #define imillisleep Sleep + #else +-#if _POSIX_C_SOURCE < 200809L +- #define imillisleep(x) usleep(1000 * x) +-#else +- #define imillisleep(x) \ +- do { \ +- const struct timespec req = {0, x * 1000 * 1000}; \ +- nanosleep(&req, NULL); \ +- } while(0) +-#endif ++ #if _POSIX_C_SOURCE < 200809L ++ #define imillisleep(x) usleep(1000 * x) ++ #else ++ #define imillisleep(x) \ ++ do { \ ++ const struct timespec req = { \ ++ 0, x * 1000 * 1000}; \ ++ nanosleep(&req, NULL); \ ++ } while (0) ++ #endif + #endif + + #if !defined(PTHREAD_MUTEX_RECURSIVE) && !defined(__DragonFly__) && \ diff --git a/libupnp.spec b/libupnp.spec index e3e2f6b..5100ea7 100644 --- a/libupnp.spec +++ b/libupnp.spec @@ -1,10 +1,11 @@ Version: 1.14.7 Summary: Universal Plug and Play (UPnP) SDK Name: libupnp -Release: 2%{?dist} +Release: 3%{?dist} License: BSD URL: https://sourceforge.net/projects/pupnp Source: https://downloads.sourceforge.net/pupnp/%{name}-%{version}.tar.bz2 +Patch0: 334.patch BuildRequires: gcc BuildRequires: make @@ -26,6 +27,8 @@ the UPnP SDK libraries. %prep %setup -q +%patch0 -p1 + %build %configure \ --enable-static=no \ @@ -57,6 +60,9 @@ sed -i.rpath 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool %{_libdir}/pkgconfig/libupnp.pc %changelog +* Mon Aug 02 2021 Gwyn Ciesla - 1.14.7-3 +- Upstream patch to fix FTBFS. + * Thu Jul 22 2021 Fedora Release Engineering - 1.14.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild