File virglrenderer.spec of Package virglrenderer

#
# spec file for package virglrenderer
#
# Copyright (c) 2017 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         libname lib%{name}0
Name:           virglrenderer
Version:        0.5.0
Release:        0
Summary:        Virgl Rendering library
License:        MIT
Group:          Development/Libraries/C and C++
Url:            https://virgil3d.github.io/
Source0:        %{name}-%{version}.tar.bz2
BuildRequires:  Mesa-devel
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  python
BuildRequires:  zlib-devel
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(epoxy)
BuildRequires:  pkgconfig(gbm)
BuildRequires:  pkgconfig(lbxutil)
BuildRequires:  pkgconfig(libdrm) >= 2.4.50
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xorg-macros) >= 1.8

#Upstream patches:
Patch0001:      0001-48f67f60-renderer-fix-NULL-pointer-deref-in-vrend_clear.patch
Patch0002:      0002-40b0e781-renderer-fix-a-leak-in-resource-attach.patch
Patch0003:      0003-6eb13f7a-vrend-fix-memory-leak-in-int-blit-context.patch
Patch0004:      0004-114688c5-renderer-fix-heap-overflow-in-vertex-elements-state-.patch
Patch0005:      0005-926b9b34-vrend-fix-a-stack-overflow-in-set-framebuffer-state.patch
Patch0006:      0006-747a293-vrend-fix-a-leak-in-context-create-internal.patch
Patch0007:      0007-a5ac4994-vrend-add-sanity-check-for-vertext-buffer-index.patch
Patch0008:      0008-28894a30-gallium-tgsi-fix-oob-access-in-parse-instruction.patch
Patch0009:      0009-e534b51c-gallium-tgsi-fix-overflow-in-parse-property.patch
Patch0010:      0010-0a5dff15-vrend-never-destroy-context-0-in-vrend_renderer_cont.patch
Patch0011:      0011-93761787-renderer-fix-integer-overflow-in-create-shader.patch
Patch0012:      0012-737c3350-renderer-fix-memory-leak-in-vertex-elements-state-cr.patch
Patch0013:      0013-a2f12a1b-fix-memory-leak-in-add-shader-program.patch

# Our patches:
Patch2001:      2001-avoid-memory-leak-for-a5ac4994.patch

%description
The virgil3d rendering library is a library used by
qemu to implement 3D GPU support for the virtio GPU.

%package -n %{libname}
Summary:        Virgil3D renderer
Group:          Development/Libraries/C and C++

%description -n %{libname}
The virgil3d rendering library is a library used by
qemu to implement 3D GPU support for the virtio GPU.

%package devel
Summary:        Virgil3D renderer development files
Group:          Development/Libraries/C and C++

Requires:       %{libname} = %version

%description devel
The virgil3d rendering library is a library used by
qemu to implement 3D GPU support for the virtio GPU.
This package contains the virgil3d renderer development
files.

%package test-server
Summary:        Virgil3D renderer development files
Group:          Development/Libraries/C and C++

Requires:       %{libname} = %version

%description test-server
The virgil3d rendering library is a library used by
qemu to implement 3D GPU support for the virtio GPU.
This package contains a server to test virgl rendering
without GL.

%prep
%setup -q -n %{name}-%{version}
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
%patch0005 -p1
%patch0006 -p1
%patch0007 -p1
%patch0008 -p1
%patch2001 -p1
%patch0009 -p1
%patch0010 -p1
%patch0011 -p1
%patch0012 -p1
%patch0013 -p1

%build
sed -i -e 's|@CODE_COVERAGE_RULES@| |g' Makefile.am
autoreconf -fi
%configure
make %{?_smp_mflags}

%install
make DESTDIR="%{buildroot}" install
rm -f %{buildroot}%{_libdir}/libvirglrenderer.la

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/lib*.so.*
%doc COPYING

%files devel
%defattr(-,root,root)
%dir %{_includedir}/virgl/
%{_includedir}/virgl/*
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc

%files test-server
%defattr(-,root,root)
%{_bindir}/virgl_test_server

%changelog
openSUSE Build Service is sponsored by