Name:           mesa-demos
Version:        8.3.0
Release:        14
Summary:        Demo applications for testing Mesa
License:        MIT
URL:            http://www.mesa3d.org
Source0:        %{name}-20171027.tar.bz2
Source1:        http://www.x.org/pub/individual/app/xdriinfo-1.0.4.tar.bz2
Source2:        mesad-git-snapshot.sh

Patch0000:      mesa-demos-8.0.1-legal.patch
Patch0001:      mesa-demos-as-needed.patch
Patch0002:      xdriinfo-1.0.4-glvnd.patch

BuildRequires:  gcc-c++ pkgconfig autoconf automake libtool glew-devel
BuildRequires:  freeglut-devel mesa-libGL-devel mesa-libEGL-devel
BuildRequires:  mesa-libGLES-devel mesa-libgbm-devel libGLU-devel
BuildRequires:  libXext-devel

Provides:       glxinfo glxinfo%{?__isa_bits} eglinfo es2_info
Provides:       glx-utils = %{version}-%{release} egl-utils = %{version}-%{release}
Obsoletes:      glx-utils < %{version}-%{release} egl-utils < %{version}-%{release}

%description
This package provides some demo applications for testing Mesa.
It also provides the glxinfo, glxgears, eglinfo and es2_info utilities.

%package help
Summary:        Help package for %{name}
Requires:       %{name} = %{version}-%{release}

%description help
This package contains some man files for %{name}.

%prep
%setup -q -n %{name}-20171027 -b1
%patch0 -p1
%patch1 -p1

cd ../xdriinfo-1.0.4
%patch2 -p1
cd -

rm -f src/demos/{pointblast.c,spriteblast.c}

%build
autoreconf -vfi
%configure --bindir=%{_libdir}/mesa --with-system-data-files
%make_build

cd ../xdriinfo-1.0.4
%configure
%make_build
cd -

%install
%make_install

cd ../xdriinfo-1.0.4
%make_install
cd -

install -m755 src/xdemos/{glxgears,glxinfo} %{buildroot}%{_bindir}
install -m755 src/egl/{opengl/eglinfo,opengles2/es2_info} %{buildroot}%{_bindir}

%if 0%{?__isa_bits} != 0
install -m755 src/xdemos/glxinfo %{buildroot}%{_bindir}/glxinfo%{?__isa_bits}
%endif

%files
%{_libdir}/mesa
%{_bindir}/*
%{_datadir}/%{name}/

%files help
%{_datadir}/man/man1/xdriinfo.1*

%changelog
* Fri Aug 07 2020 zhangjiapeng <zhangjiapeng9@huawei.com> - 8.3.0-14
- Add compilation dependency to solve compilation failure

* Wed Oct 23 2019 huzhiyu <huzhiyu1@huawei.com> - 8.3.0-13
- Package init
