From 43a3d273643a4c1254b398b23de6e5314b96fac84abf882fc19d8cb00e633195 Mon Sep 17 00:00:00 2001 From: Paolo Stivanin Date: Mon, 5 Dec 2022 08:27:48 +0000 Subject: [PATCH 1/2] - Add 2759.patch: fix tests execution issues. - Remove disable-test.patch OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/gerbera?expand=0&rev=45 --- 2759.patch | 126 +++++++++++++++++++++++++++++++++++++++++++++ disable-test.patch | 33 ------------ gerbera.changes | 6 +++ gerbera.spec | 4 +- 4 files changed, 134 insertions(+), 35 deletions(-) create mode 100644 2759.patch delete mode 100644 disable-test.patch diff --git a/2759.patch b/2759.patch new file mode 100644 index 0000000..d01f298 --- /dev/null +++ b/2759.patch @@ -0,0 +1,126 @@ +From aa0d7bb8fff560734fc80369728740df46dc33bf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Karl=20Strau=C3=9Fberger?= +Date: Thu, 1 Dec 2022 19:09:41 +0100 +Subject: [PATCH] openSuSE: Fix test and inits + +--- + doc/config-import.rst | 15 ++++++++++----- + src/util/grb_net.cc | 23 +++++++++++++++++------ + test/core/test_searchhandler.cc | 2 +- + 3 files changed, 28 insertions(+), 12 deletions(-) + +diff --git a/doc/config-import.rst b/doc/config-import.rst +index 3278383c4..f6aca38d8 100644 +--- a/doc/config-import.rst ++++ b/doc/config-import.rst +@@ -668,11 +668,11 @@ You can set up your correct fanart file by yourself, if no image is embedded in + + :: + +- ++ + + * Optional + +- Set up container images. Drop your artists' images or logos for default containers here and they are displayed as thumbnail when browsing with a compatible client. ++ Set up container images. The fanart of a media file is added automatically as a thumbnail to the container (e.g. the album container). + + :: + +@@ -681,7 +681,8 @@ You can set up your correct fanart file by yourself, if no image is embedded in + * Optional + + Path to the directory containing the images to load. Relative paths are assumed to be under the server's home. +- If the image is not found in that location, it is also searched in the physical folder itself ++ Drop your artists' images or logos for default containers here and they are displayed as thumbnail when browsing with a compatible client. ++ If the image is not found in that location, it is also searched in the physical folder itself. + + :: + +@@ -689,7 +690,10 @@ You can set up your correct fanart file by yourself, if no image is embedded in + + * Optional + +- Number of level which the fanart of a media file can be propagated upwards. ++ This setting allows to increase the number of levels which the fanart of a media file can be propagated upwards (examples refer to basic layout /Root/Audio/Artist/Album/song). ++ A value of 1 adds the fanart only to the direct parent container when a media file is added (e.g. the Album container). ++ A value of 2 means you propagate that image to the parent container as well (e.g. the Artist container). ++ A value of 0 blocks propagation completely. + + :: + +@@ -697,7 +701,8 @@ You can set up your correct fanart file by yourself, if no image is embedded in + + * Optional + +- Minimum number of path elements for container using fanart from media files. ++ Depending on the virtual layout propagating thumbnails can reach containers like Video or Audio. This settings forces a minimal depth for propagation to apply. ++ It is setting the minimum number of path elements for container using fanart from media files (e.g. /Root/Audio/Artist has level 3 so the image can be set). + + + ``add-file`` +diff --git a/src/util/grb_net.cc b/src/util/grb_net.cc +index 3ea5fefd4..b1c2a018f 100644 +--- a/src/util/grb_net.cc ++++ b/src/util/grb_net.cc +@@ -145,22 +145,33 @@ std::string GrbNet::getHostName() + return hostName; + + auto addr = reinterpret_cast(&sockAddr); +- char hoststr[NI_MAXHOST]; +- char portstr[NI_MAXSERV]; ++ char hoststr[NI_MAXHOST] = ""; ++ char portstr[NI_MAXSERV] = ""; + int len = addr->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in); + int ret = getnameinfo(addr, len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NOFQDN); + if (ret != 0) { +- log_debug("could not determine getnameinfo: {}", std::strerror(errno)); ++ log_warning("Could not determine getnameinfo: {}", std::strerror(errno)); ++ hoststr[0] = '\0'; + } + hostName = hoststr; ++ if (hostName.empty()) { ++ ret = getnameinfo(addr, len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST); ++ if (ret != 0) { ++ log_warning("Could not determine getnameinfo: {}", std::strerror(errno)); ++ hoststr[0] = '\0'; ++ return hostName; ++ } ++ hostName = hoststr; ++ } ++ + return hoststr; + } + + std::string GrbNet::getNameInfo(bool withPort) const + { + auto addr = reinterpret_cast(&sockAddr); +- char hoststr[NI_MAXHOST]; +- char portstr[NI_MAXSERV]; ++ char hoststr[NI_MAXHOST] = ""; ++ char portstr[NI_MAXSERV] = ""; + int len = addr->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in); + int ret = getnameinfo(addr, len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); + if (ret != 0) { +@@ -181,7 +192,7 @@ std::string GrbNet::ipToInterface(std::string_view ip) + + struct ifaddrs* ifaddr; + int family, s; +- char host[NI_MAXHOST]; ++ char host[NI_MAXHOST] = ""; + + if (getifaddrs(&ifaddr) == -1) { + log_error("Could not getifaddrs: {}", std::strerror(errno)); +diff --git a/test/core/test_searchhandler.cc b/test/core/test_searchhandler.cc +index 836c6c49c..85467457f 100644 +--- a/test/core/test_searchhandler.cc ++++ b/test/core/test_searchhandler.cc +@@ -505,7 +505,7 @@ TEST_F(ParserTest, SortCriteriaError) + + TEST_F(ParserTest, SortTrackNumber) + { +- EXPECT_EQ(OTN, "unknown"); ++ EXPECT_TRUE(OTN == "unknown" || OTN == "upnp:originalTrackNumber"); + EXPECT_EQ(otn, "upnp:originalTrackNumber"); + EXPECT_EQ(MetadataHandler::getMetaFieldName(M_TRACKNUMBER), "upnp:originalTrackNumber"); + EXPECT_TRUE(executeSortParserTest("+upnp:originalTrackNumber", diff --git a/disable-test.patch b/disable-test.patch deleted file mode 100644 index b37dd57..0000000 --- a/disable-test.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- gerbera-1.12.0/test/util/test_upnp_clients.cc.orig 2022-11-29 17:34:42.902179228 +0100 -+++ gerbera-1.12.0/test/util/test_upnp_clients.cc 2022-11-29 17:34:48.322206084 +0100 -@@ -163,16 +163,6 @@ - EXPECT_EQ(pInfo->flags, 456); - } - --TEST_F(UpnpClientsTest, getHostName) --{ -- auto addr = std::make_shared("192.168.99.100"); -- auto hostname = addr->getHostName(); -- EXPECT_EQ(hostname, "192.168.99.100"); -- addr->setHostName("Wombat"); -- hostname = addr->getHostName(); -- EXPECT_EQ(hostname, "Wombat"); --} -- - TEST_F(UpnpClientsTest, netmask4) - { - auto addr = GrbNet("192.168.2.100"); ---- gerbera-1.12.0/test/core/test_searchhandler.cc.orig 2022-11-29 17:42:07.064382208 +0100 -+++ gerbera-1.12.0/test/core/test_searchhandler.cc 2022-11-29 17:42:11.748405460 +0100 -@@ -503,11 +503,3 @@ - "_t_._id_ ASC, _t_._property_value_ ASC")); - } - --TEST_F(ParserTest, SortTrackNumber) --{ -- EXPECT_EQ(OTN, "unknown"); -- EXPECT_EQ(otn, "upnp:originalTrackNumber"); -- EXPECT_EQ(MetadataHandler::getMetaFieldName(M_TRACKNUMBER), "upnp:originalTrackNumber"); -- EXPECT_TRUE(executeSortParserTest("+upnp:originalTrackNumber", -- "_t_._number1_ ASC, _t_._number2_ ASC")); --} diff --git a/gerbera.changes b/gerbera.changes index 7aa5a98..9e8712c 100644 --- a/gerbera.changes +++ b/gerbera.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Dec 5 08:25:00 UTC 2022 - Paolo Stivanin + +- Add 2759.patch: fix tests execution issues. +- Remove disable-test.patch + ------------------------------------------------------------------- Tue Nov 29 14:19:26 UTC 2022 - Paolo Stivanin diff --git a/gerbera.spec b/gerbera.spec index fd9c901..ea655ee 100644 --- a/gerbera.spec +++ b/gerbera.spec @@ -27,8 +27,8 @@ Source0: https://github.com/gerbera/gerbera/archive/v%{version}.tar.gz#/% Source1: config.xml Source2: gerbera.sysusers.in Patch0: harden_gerbera.service.patch -# PATCH-FIX-UPSTREAM https://github.com/gerbera/gerbera/issues/2755 -Patch1: disable-test.patch +# PATCH-FIX-UPSTREAM https://github.com/gerbera/gerbera/pull/2759 +Patch1: 2759.patch BuildRequires: ccache BuildRequires: cmake >= 3.13 BuildRequires: fdupes From 766153fd175311063dc5643eab474b5c09abd7120bb2f14733b2417acf971767 Mon Sep 17 00:00:00 2001 From: Paolo Stivanin Date: Fri, 6 Jan 2023 08:08:21 +0000 Subject: [PATCH 2/2] - Update to 1.12.1: * Debug options for specialized messages * Configure offset of lastPlayedPosition (aka Samsung bookmark) * Calling null IOHandler * Encoding of ticks ' as ' for Bose * ffmpeg and transcoding in docker container * Tests failing on openSuSE > 15.3 and others - Drop 2759.patch OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/gerbera?expand=0&rev=46 --- 2759.patch | 126 ------------------------------------------ gerbera-1.12.0.tar.gz | 3 - gerbera-1.12.1.tar.gz | 3 + gerbera.changes | 12 ++++ gerbera.spec | 6 +- 5 files changed, 17 insertions(+), 133 deletions(-) delete mode 100644 2759.patch delete mode 100644 gerbera-1.12.0.tar.gz create mode 100644 gerbera-1.12.1.tar.gz diff --git a/2759.patch b/2759.patch deleted file mode 100644 index d01f298..0000000 --- a/2759.patch +++ /dev/null @@ -1,126 +0,0 @@ -From aa0d7bb8fff560734fc80369728740df46dc33bf Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Karl=20Strau=C3=9Fberger?= -Date: Thu, 1 Dec 2022 19:09:41 +0100 -Subject: [PATCH] openSuSE: Fix test and inits - ---- - doc/config-import.rst | 15 ++++++++++----- - src/util/grb_net.cc | 23 +++++++++++++++++------ - test/core/test_searchhandler.cc | 2 +- - 3 files changed, 28 insertions(+), 12 deletions(-) - -diff --git a/doc/config-import.rst b/doc/config-import.rst -index 3278383c4..f6aca38d8 100644 ---- a/doc/config-import.rst -+++ b/doc/config-import.rst -@@ -668,11 +668,11 @@ You can set up your correct fanart file by yourself, if no image is embedded in - - :: - -- -+ - - * Optional - -- Set up container images. Drop your artists' images or logos for default containers here and they are displayed as thumbnail when browsing with a compatible client. -+ Set up container images. The fanart of a media file is added automatically as a thumbnail to the container (e.g. the album container). - - :: - -@@ -681,7 +681,8 @@ You can set up your correct fanart file by yourself, if no image is embedded in - * Optional - - Path to the directory containing the images to load. Relative paths are assumed to be under the server's home. -- If the image is not found in that location, it is also searched in the physical folder itself -+ Drop your artists' images or logos for default containers here and they are displayed as thumbnail when browsing with a compatible client. -+ If the image is not found in that location, it is also searched in the physical folder itself. - - :: - -@@ -689,7 +690,10 @@ You can set up your correct fanart file by yourself, if no image is embedded in - - * Optional - -- Number of level which the fanart of a media file can be propagated upwards. -+ This setting allows to increase the number of levels which the fanart of a media file can be propagated upwards (examples refer to basic layout /Root/Audio/Artist/Album/song). -+ A value of 1 adds the fanart only to the direct parent container when a media file is added (e.g. the Album container). -+ A value of 2 means you propagate that image to the parent container as well (e.g. the Artist container). -+ A value of 0 blocks propagation completely. - - :: - -@@ -697,7 +701,8 @@ You can set up your correct fanart file by yourself, if no image is embedded in - - * Optional - -- Minimum number of path elements for container using fanart from media files. -+ Depending on the virtual layout propagating thumbnails can reach containers like Video or Audio. This settings forces a minimal depth for propagation to apply. -+ It is setting the minimum number of path elements for container using fanart from media files (e.g. /Root/Audio/Artist has level 3 so the image can be set). - - - ``add-file`` -diff --git a/src/util/grb_net.cc b/src/util/grb_net.cc -index 3ea5fefd4..b1c2a018f 100644 ---- a/src/util/grb_net.cc -+++ b/src/util/grb_net.cc -@@ -145,22 +145,33 @@ std::string GrbNet::getHostName() - return hostName; - - auto addr = reinterpret_cast(&sockAddr); -- char hoststr[NI_MAXHOST]; -- char portstr[NI_MAXSERV]; -+ char hoststr[NI_MAXHOST] = ""; -+ char portstr[NI_MAXSERV] = ""; - int len = addr->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in); - int ret = getnameinfo(addr, len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NOFQDN); - if (ret != 0) { -- log_debug("could not determine getnameinfo: {}", std::strerror(errno)); -+ log_warning("Could not determine getnameinfo: {}", std::strerror(errno)); -+ hoststr[0] = '\0'; - } - hostName = hoststr; -+ if (hostName.empty()) { -+ ret = getnameinfo(addr, len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST); -+ if (ret != 0) { -+ log_warning("Could not determine getnameinfo: {}", std::strerror(errno)); -+ hoststr[0] = '\0'; -+ return hostName; -+ } -+ hostName = hoststr; -+ } -+ - return hoststr; - } - - std::string GrbNet::getNameInfo(bool withPort) const - { - auto addr = reinterpret_cast(&sockAddr); -- char hoststr[NI_MAXHOST]; -- char portstr[NI_MAXSERV]; -+ char hoststr[NI_MAXHOST] = ""; -+ char portstr[NI_MAXSERV] = ""; - int len = addr->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in); - int ret = getnameinfo(addr, len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); - if (ret != 0) { -@@ -181,7 +192,7 @@ std::string GrbNet::ipToInterface(std::string_view ip) - - struct ifaddrs* ifaddr; - int family, s; -- char host[NI_MAXHOST]; -+ char host[NI_MAXHOST] = ""; - - if (getifaddrs(&ifaddr) == -1) { - log_error("Could not getifaddrs: {}", std::strerror(errno)); -diff --git a/test/core/test_searchhandler.cc b/test/core/test_searchhandler.cc -index 836c6c49c..85467457f 100644 ---- a/test/core/test_searchhandler.cc -+++ b/test/core/test_searchhandler.cc -@@ -505,7 +505,7 @@ TEST_F(ParserTest, SortCriteriaError) - - TEST_F(ParserTest, SortTrackNumber) - { -- EXPECT_EQ(OTN, "unknown"); -+ EXPECT_TRUE(OTN == "unknown" || OTN == "upnp:originalTrackNumber"); - EXPECT_EQ(otn, "upnp:originalTrackNumber"); - EXPECT_EQ(MetadataHandler::getMetaFieldName(M_TRACKNUMBER), "upnp:originalTrackNumber"); - EXPECT_TRUE(executeSortParserTest("+upnp:originalTrackNumber", diff --git a/gerbera-1.12.0.tar.gz b/gerbera-1.12.0.tar.gz deleted file mode 100644 index b2c0fc6..0000000 --- a/gerbera-1.12.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bb04a4e4432b8ae149bdd5ea7f33f3af39cb226d3d52ec0aed3f8273023f1edd -size 4363130 diff --git a/gerbera-1.12.1.tar.gz b/gerbera-1.12.1.tar.gz new file mode 100644 index 0000000..5c88830 --- /dev/null +++ b/gerbera-1.12.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2144a7c4a13e8b43aa0c911fbeae65f05e2c42254ddd03be5c41f5fcf103a93c +size 4368573 diff --git a/gerbera.changes b/gerbera.changes index 9e8712c..a801efc 100644 --- a/gerbera.changes +++ b/gerbera.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Jan 6 08:07:12 UTC 2023 - Paolo Stivanin + +- Update to 1.12.1: + * Debug options for specialized messages + * Configure offset of lastPlayedPosition (aka Samsung bookmark) + * Calling null IOHandler + * Encoding of ticks ' as ' for Bose + * ffmpeg and transcoding in docker container + * Tests failing on openSuSE > 15.3 and others +- Drop 2759.patch + ------------------------------------------------------------------- Mon Dec 5 08:25:00 UTC 2022 - Paolo Stivanin diff --git a/gerbera.spec b/gerbera.spec index ea655ee..57ef714 100644 --- a/gerbera.spec +++ b/gerbera.spec @@ -1,7 +1,7 @@ # # spec file for package gerbera # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: gerbera -Version: 1.12.0 +Version: 1.12.1 Release: 0 Summary: UPnP Media Server License: GPL-2.0-only @@ -27,8 +27,6 @@ Source0: https://github.com/gerbera/gerbera/archive/v%{version}.tar.gz#/% Source1: config.xml Source2: gerbera.sysusers.in Patch0: harden_gerbera.service.patch -# PATCH-FIX-UPSTREAM https://github.com/gerbera/gerbera/pull/2759 -Patch1: 2759.patch BuildRequires: ccache BuildRequires: cmake >= 3.13 BuildRequires: fdupes