File gstreamer-plugins-vaapi.spec of Package gstreamer-plugins-vaapi

#
# spec file for package gstreamer-plugins-vaapi
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define package_version 0.5.10

%if 0%{suse_version} > 1230
%bcond_without wayland
%else
%bcond_with wayland
%endif

Name:           gstreamer-plugins-vaapi
BuildRequires:  Mesa-devel
BuildRequires:  gtk-doc
BuildRequires:  libtool
BuildRequires:  libva-devel
BuildRequires:  pkgconfig
BuildRequires:  yasm
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-bad-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xrender)
%if %{with wayland}
BuildRequires:  pkgconfig(wayland-client) >= 1.0.0
%endif
Summary:        Gstreamer VA-API plugins
License:        LGPL-2.1+
Group:          Productivity/Multimedia/Other
Version:        0.5.10
Release:        0
Source0:        gstreamer-vaapi-%{package_version}.tar.bz2
Url:            http://gitorious.org/vaapi/gstreamer-vaapi
ExclusiveArch:  %ix86 x86_64
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that allow hardware accelerated video decoding through VA-API.

%package devel
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
%if %{with wayland}
Requires:       libgstvaapi-wayland-1_4-1 = %{version}
%endif

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

%package -n libgstvaapi-1_4-1
Summary:        Gstreamer VA-API plugins
Group:          System/Libraries

%description -n libgstvaapi-1_4-1
gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that allow hardware accelerated video decoding through VA-API.

%package -n libgstcodecparsers_vpx0
Summary:        Gstreamer VA-API plugins
Group:          System/Libraries

%description -n libgstcodecparsers_vpx0
gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that allow hardware accelerated video decoding through VA-API.

%package -n libgstvaapi-glx-1_4-1
Summary:        Gstreamer GLX VA-API plugins
Group:          System/Libraries

%description -n libgstvaapi-glx-1_4-1
gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that allow hardware accelerated video decoding through VA-API.

%package -n libgstvaapi-x11-1_4-1
Summary:        Gstreamer X11 VA-API plugins
Group:          System/Libraries

%description -n libgstvaapi-x11-1_4-1
gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that allow hardware accelerated video decoding through VA-API.

%if %{suse_version} >= 1230
%package -n libgstvaapi-drm-1_4-1
Summary:        Gstreamer DRM VA-API plugins
Group:          System/Libraries

%description -n libgstvaapi-drm-1_4-1
gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that allow hardware accelerated video decoding through VA-API.
%endif

%if %{with wayland}
%package -n libgstvaapi-wayland-1_4-1
Summary:        Gstreamer WAYLAND VA-API plugins
Group:          System/Libraries

%description -n libgstvaapi-wayland-1_4-1
gstreamer-vaapi is a collection of GStreamer plugins and helper libraries that allow hardware accelerated video decoding through VA-API.
%endif

%prep
%if 0%{?build_from_git}
%setup -q -n gstreamer-vaapi
%else
%setup -q -n gstreamer-vaapi-%{version}
%endif

%build
%if 0%{?build_from_git}
./autogen.sh
%endif
%configure --disable-static \
	--enable-glx \
	--with-gstreamer-api=1.0
make %{?_smp_mflags} V=1

%install
%makeinstall
find %{buildroot}%{_libdir} -name '*.la' -delete -print

%post -n libgstvaapi-1_4-1 -p /sbin/ldconfig
%postun -n libgstvaapi-1_4-1 -p /sbin/ldconfig

%post -n libgstcodecparsers_vpx0 -p /sbin/ldconfig
%postun -n libgstcodecparsers_vpx0 -p /sbin/ldconfig

%post -n libgstvaapi-glx-1_4-1 -p /sbin/ldconfig
%postun -n libgstvaapi-glx-1_4-1 -p /sbin/ldconfig

%post -n libgstvaapi-x11-1_4-1 -p /sbin/ldconfig
%postun -n libgstvaapi-x11-1_4-1 -p /sbin/ldconfig

%if %{suse_version} >= 1230
%post -n libgstvaapi-drm-1_4-1 -p /sbin/ldconfig
%postun -n libgstvaapi-drm-1_4-1 -p /sbin/ldconfig
%endif

%if %{with wayland}
%post -n libgstvaapi-wayland-1_4-1 -p /sbin/ldconfig
%postun -n libgstvaapi-wayland-1_4-1 -p /sbin/ldconfig
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,0755)
%doc AUTHORS COPYING.LIB NEWS README
%{_libdir}/gstreamer-*/*.so

%files -n libgstcodecparsers_vpx0
%defattr(-,root,root,0755)
%{_libdir}/libgstcodecparsers_vpx.so.*

%files -n libgstvaapi-1_4-1
%defattr(-,root,root,0755)
%{_libdir}/libgstvaapi-1.4.so.*

%files -n libgstvaapi-glx-1_4-1
%defattr(-,root,root,0755)
%{_libdir}/libgstvaapi-glx-1.4.so.*

%files -n libgstvaapi-x11-1_4-1
%defattr(-,root,root,0755)
%{_libdir}/libgstvaapi-x11-1.4.so.*

%if %{suse_version} >= 1230
%files -n libgstvaapi-drm-1_4-1
%defattr(-,root,root,0755)
%{_libdir}/libgstvaapi-drm-1.4.so.*
%endif

%if %{with wayland}
%files -n libgstvaapi-wayland-1_4-1
%defattr(-,root,root)
%{_libdir}/libgstvaapi-wayland-1.4.so.*
%endif

%files devel
%defattr(-,root,root,0755)
%{_includedir}/gstreamer-1.0/gst/vaapi
%{_libdir}/libgst*.so
%{_libdir}/pkgconfig/*.pc

%changelog
openSUSE Build Service is sponsored by