## This macro activates/deactivates debug option
%bcond_with debug
%global pname osd2web
%global rname vdr-plugin-osd2web
%global __provides_exclude_from ^%{vdr_plugindir}/.*\\.so.*$
Name: vdr-%{pname}
Version: 0.2.48
Release: 2%{?dist}
Summary: VDR skin interface for the browser
License: GPLv2+
URL: https://github.com/horchi/vdr-plugin-osd2web
Source0: https://github.com/horchi/vdr-plugin-osd2web/archive/%{version}/%{name}-%{version}.tgz
Patch0: vdr-osd2web-makefile.patch
Source1: %{name}.conf
BuildRequires: gcc-c++
BuildRequires: vdr-devel >= 2.2.0
BuildRequires: libwebsockets-devel
BuildRequires: zlib-devel
BuildRequires: tinyxml2-devel
BuildRequires: openssl-devel
BuildRequires: jansson-devel
BuildRequires: libexif-devel
BuildRequires: libuuid-devel
Requires: vdr(abi)%{?_isa} = %{vdr_apiversion}
%description
osd2web is a VDR skin interface for the browser, which displays the OSD
and allows all interactions which are possible on the OSD.
%prep
%setup -q -n %{rname}-%{version}
%patch0 -p1
## Optimization flags in 'Make.config' file
sed -i \
-e 's|PREFIX = /usr/local|PREFIX = %{_prefix}|' \
-e 's|CXXFLAGS += -O3|CXXFLAGS += %{optflags}|' \
-e 's|@@OPTFLAGS | %{optflags}|' \
Make.config
%if %{without debug}
sed -i -e 's|DEBUG = 1||' Make.config
%endif
%build
%make_build
%install
%make_install
install -Dpm 644 %{SOURCE1} \
%{buildroot}%{_sysconfdir}/sysconfig/vdr-plugins.d/%{name}.conf
# fix the perm due W: unstripped-binary-or-object
chmod 0755 %{buildroot}/%{vdr_plugindir}/libvdr-*.so.%{vdr_apiversion}
# install executable to %%{vdr_plugindir} due E: executable-marked-as-config-file
rm -rf %{buildroot}/%{vdr_configdir}/plugins/osd2web/startBrowser.sh
install -Dpm 755 scripts/startBrowser.sh %{buildroot}%{vdr_plugindir}/bin/startBrowser.sh
%find_lang %{name}
%files -f %{name}.lang
%license LICENSE COPYING
%doc README
%dir %{vdr_configdir}/plugins/osd2web/
%config(noreplace) %{_sysconfdir}/sysconfig/vdr-plugins.d/%{name}.conf
%{vdr_plugindir}/libvdr-%{pname}.so.%{vdr_apiversion}
%config(noreplace) %{vdr_configdir}/plugins/osd2web/*
%{vdr_plugindir}/bin/startBrowser.sh
%changelog
* Fri Nov 09 2018 Martin Gansser <martinkg@fedoraproject.org> - 0.2.48-2
- Use %%{version] for SOURCE tag
- Use %%bcond_with/without for debugging flag
- Mark COPYING as %%license file
- Use korrekt license GPLv2+
- take ownership of unowned directory %%{vdr_configdir}/plugins/osd2web/
* Wed Nov 07 2018 Martin Gansser <martinkg@fedoraproject.org> - 0.2.48-1
- Initial build