- 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
This commit is contained in:
Tomáš Chvátal 2017-01-03 00:00:33 +00:00 committed by Git OBS Bridge
parent 7ea605fb66
commit cf6e7a0996
2 changed files with 54 additions and 18 deletions

View File

@ -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

View File

@ -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)