commit f090b97d526195598caab9fb3d3acdddf0f74670
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Tue Feb 20 00:56:35 2018 +0000
Fix one GCC 8 warning
Build simple_web_server with rpm CFLAGS
Better ifdefs scriptlets
smplayer.spec | 23 +++++++++++++++--------
webserver.patch | 14 +++++++++++++-
2 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/smplayer.spec b/smplayer.spec
index f7c6147..23c9788 100644
--- a/smplayer.spec
+++ b/smplayer.spec
@@ -3,7 +3,7 @@ Version: 18.2.2
%global smtube_ver 18.1.0
%global smplayer_themes_ver 17.3.0
%global smplayer_skins_ver 15.2.0
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A graphical frontend for mplayer and mpv
Group: Applications/Multimedia
@@ -42,12 +42,11 @@ BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(Qt5WebKit)
Requires: hicolor-icon-theme
# smplayer without mplayer is quite useless
-%if 0%{?fedora}
+%if 0%{?fedora} || 0%{?rhel} > 7
Recommends: smtube
-Recommends: mplayer
Requires: mplayer-backend
-%endif
-%if 0%{?rhel}
+Suggests: mplayer
+%else
Requires: mplayer
%endif
@@ -71,10 +70,9 @@ Summary: YouTube browser for SMPlayer
Group: Applications/Multimedia
License: GPLv2+
URL:
http://www.smtube.org
-%if 0%{?fedora}
+%if 0%{?fedora} || 0%{?rhel} > 7
Recommends: smplayer
-%endif
-%if 0%{?rhel}
+%else
Requires: smplayer
%endif
@@ -144,6 +142,10 @@ pushd smplayer-skins-%{smplayer_skins_ver}
mv Changelog Changelog-skins.txt
%make_build
popd
+pushd webserver
+export CFLAGS_EXTRA="%{__global_compiler_flags}"
+%make_build
+popd
%install
%make_install PREFIX=%{_prefix} DOC_PATH=%{_docdir}/%{name}
@@ -210,6 +212,11 @@ fi
%{_datadir}/smplayer/themes/
%changelog
+* Tue Feb 20 2018 Sérgio Basto <sergio(a)serjux.com> - 18.2.2-3
+- Fix one GCC 8 warning
+- Build simple_web_server with rpm CFLAGS
+- Better ifdefs scriptlets
+
* Mon Feb 19 2018 Sérgio Basto <sergio(a)serjux.com> - 18.2.2-2
- Mute GCC 8 warnings
diff --git a/webserver.patch b/webserver.patch
index b8df1da..5607502 100644
--- a/webserver.patch
+++ b/webserver.patch
@@ -6,7 +6,19 @@ diff -rup smplayer-18.2.0/webserver/Makefile
smplayer-18.2.2/webserver/Makefile
SOURCES = main.c mongoose.c
-CFLAGS = -O2 -W -Wall -Werror -Wno-unused-function $(CFLAGS_EXTRA) $(MODULE_CFLAGS)
-+CFLAGS = -O2 -W -Wall -Werror -Wno-unused-function -Wno-format-truncation
-Wno-stringop-truncation $(CFLAGS_EXTRA) $(MODULE_CFLAGS)
++CFLAGS = -O2 -W -Wall -Werror -Wno-unused-function -Wno-format-truncation
$(CFLAGS_EXTRA) $(MODULE_CFLAGS)
ifeq ($(OS), Windows_NT)
CFLAGS += -lws2_32
+diff -rup smplayer-18.2.2/webserver/mongoose.c smplayer-18.2.0/webserver/mongoose.c
+--- smplayer-18.2.2/webserver/mongoose.c 2017-01-10 18:06:03.000000000 +0000
++++ smplayer-18.2.0/webserver/mongoose.c 2018-02-19 05:41:51.135640350 +0000
+@@ -10789,6 +11655,8 @@ int mg_resolve_async_opt(struct mg_mgr *
+ }
+
+ strncpy(req->name, name, sizeof(req->name));
++ req->name[sizeof(req->name) - 1] = '\0';
++
+ req->query = query;
+ req->callback = cb;
+ req->data = data;