From cf6e7a099680dd76bd87421fbf8b4b8cbf32bc58b373edb750b0775a6cb08c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 3 Jan 2017 00:00:33 +0000 Subject: [PATCH] - Split the completion to separate subpackage and build it in obs not during post OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/mpv?expand=0&rev=73 --- mpv.changes | 6 +++++ mpv.spec | 66 ++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 54 insertions(+), 18 deletions(-) diff --git a/mpv.changes b/mpv.changes index e4fd958..1098b63 100644 --- a/mpv.changes +++ b/mpv.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 2 23:59:18 UTC 2017 - tchvatal@suse.com + +- Split the completion to separate subpackage and build it in obs not + during post + ------------------------------------------------------------------- Mon Jan 2 21:19:27 UTC 2017 - aloisio@gmx.com diff --git a/mpv.spec b/mpv.spec index 1acad82..ede73d8 100644 --- a/mpv.spec +++ b/mpv.spec @@ -26,9 +26,9 @@ Name: mpv Version: 0.23.0 Release: 0 Summary: Advanced general-purpose multimedia player +# waf is licensed with BSD-3-Clause License: GPL-2.0+ and BSD-3-Clause and GPL-3.0+ Group: Productivity/Multimedia/Video/Players -# waf is licensed with BSD-3-Clause Url: http://mpv.io/ Source: http://github.com/mpv-player/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # Can't use system one as it breaks quite often with updates @@ -38,20 +38,17 @@ Source2: %{name}.changes Source3: https://github.com/2ion/mpv-bash-completion/archive/%{_mbc_ver}.tar.gz#/mpv-bash-completion-%{_mbc_ver}.tar.gz # PATCH-FIX-OPENSUSE do not require equal libav versions, obs rebuilds as needed Patch0: mpv-make-ffmpeg-version-check-non-fatal.patch +BuildRequires: bash BuildRequires: hicolor-icon-theme -Requires: hicolor-icon-theme -Requires(post): hicolor-icon-theme -Requires(post): update-desktop-files -Requires(postun): hicolor-icon-theme -Requires(postun): update-desktop-files BuildRequires: ladspa-devel BuildRequires: libjpeg-devel BuildRequires: libmng-devel BuildRequires: linux-kernel-headers BuildRequires: lirc-devel +BuildRequires: lua BuildRequires: ncurses-devel BuildRequires: perl -BuildRequires: pkg-config +BuildRequires: pkgconfig BuildRequires: python-docutils BuildRequires: update-desktop-files BuildRequires: yasm @@ -97,9 +94,11 @@ BuildRequires: pkgconfig(xscrnsaver) BuildRequires: pkgconfig(xv) BuildRequires: pkgconfig(xxf86vm) BuildRequires: pkgconfig(zlib) -Requires: bash >= 4.0 -Requires: bash-completion -Requires: lua +Requires: hicolor-icon-theme +Requires(post): hicolor-icon-theme +Requires(post): update-desktop-files +Requires(postun): hicolor-icon-theme +Requires(postun): update-desktop-files Recommends: xrandr # Used via LUA scripts Recommends: youtube-dl @@ -111,7 +110,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build # JIT for lua. %if 0%{?suse_version} > 1320 BuildRequires: python-rst2pdf -%ifarch %ix86 x86_64 +%ifarch %{ix86} x86_64 BuildRequires: pkgconfig(luajit) %endif %endif @@ -135,6 +134,27 @@ BuildRequires: pkgconfig(xkbcommon) >= 0.3.0 mpv is a movie player based on MPlayer and mplayer2. It supports a wide variety of video file formats, audio and video codecs, and subtitle types. +%package bash-completion +Summary: Bash Completion for %{name} +Group: Productivity/Multimedia/Video/Players +Requires: %{name} = %{version} +Requires: bash-completion +Supplements: packageand(mpv:bash) +BuildArch: noarch + +%description bash-completion +Bash command line completion support for %{name}. + +%package zsh-completion +Summary: ZSH Completion for %{name} +Group: Productivity/Multimedia/Video/Players +Requires: %{name} = %{version} +Supplements: packageand(mpv:zsh) +BuildArch: noarch + +%description zsh-completion +ZSH command line completion support for %{name}. + %package devel Summary: A library to link together with mpv player Group: Development/Libraries/C and C++ @@ -198,24 +218,30 @@ export CCFLAGS="%{optflags}" ./waf build --verbose %{?_smp_mflags} +pushd mpv-bash-completion-%{_mbc_ver} +export MPV_BASHCOMPGEN_MPV_CMD=../build/mpv +make %{?_smp_mflags} +popd + %install ./waf --destdir=%{buildroot} install +pushd mpv-bash-completion-%{_mbc_ver} +%make_install +popd + install -D -m 0644 etc/input.conf %{buildroot}%{_sysconfdir}/%{name}/input.conf install -D -m 0644 etc/mpv.conf %{buildroot}%{_sysconfdir}/%{name}/mpv.conf -install -D -m755 mpv-bash-completion-%{_mbc_ver}/gen.lua %{buildroot}%{_libexecdir}/mpv-bash-completion/gen.lua %post %desktop_database_post %icon_theme_cache_post -/bin/bash -c '%{_libexecdir}/mpv-bash-completion/gen.lua >%{_sysconfdir}/bash_completion.d/mpv' %postun %desktop_database_postun %icon_theme_cache_postun %post -n %{lname} -p /sbin/ldconfig - %postun -n %{lname} -p /sbin/ldconfig %files @@ -231,11 +257,15 @@ install -D -m755 mpv-bash-completion-%{_mbc_ver}/gen.lua %{buildroot}%{_libexecd %{_bindir}/%{name} %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor -#zsh completion -%{_datadir}/zsh/site-functions/_mpv %{_mandir}/man?/%{name}.?%{?ext_man} -%{_libexecdir}/mpv-bash-completion -%ghost %{_sysconfdir}/bash_completion.d/mpv + +%files zsh-completion +%defattr(-,root,root) +%{_datadir}/zsh/site-functions/_mpv + +%files bash-completion +%defattr(-,root,root) +%{_datadir}/bash-completion/completions/mpv %files -n %{lname} %defattr(-,root,root)