#
# Conditional build:
%bcond_without motif # build static libGLw without Motif interface
+%bcond_with multigl # package libGL in a way allowing concurrent install with nvidia/fglrx drivers
#
Summary: Free OpenGL implementation
Summary(pl.UTF-8): Wolnodostępna implementacja standardu OpenGL
Name: Mesa
Version: 7.0.1
-Release: 2
+Release: 2%{?with_multigl:.mgl}
License: MIT (core), SGI (GLU,libGLw) and others - see COPYRIGHT file
Group: X11/Libraries
Source0: http://dl.sourceforge.net/mesa3d/%{name}Lib-%{version}.tar.bz2
BuildRequires: xorg-util-makedepend
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _sysconfdir /etc/X11
-
%description
Mesa is a 3-D graphics library with an API which is very similar to
that of OpenGL(R). To the extent that Mesa utilizes the OpenGL command
rm -rf progs && mv -f progs.org progs
rm -rf $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*/{.deps,CVS,Makefile.{BeOS*,win,cygnus,DJ,dja}}
+%if %{with multigl}
+install -d $RPM_BUILD_ROOT{%{_libdir}/Mesa,%{_sysconfdir}/ld.so.conf.d}
+
+mv -f $RPM_BUILD_ROOT%{_libdir}/libGL.so.* $RPM_BUILD_ROOT%{_libdir}/Mesa
+ln -sf Mesa/libGL.so.1 $RPM_BUILD_ROOT%{_libdir}/libGL.so
+
+echo %{_libdir}/Mesa >$RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d/Mesa.conf
+%endif
+
%clean
rm -rf $RPM_BUILD_ROOT
%files libGL
%defattr(644,root,root,755)
%doc docs/{*.html,README.{3DFX,GGI,MITS,QUAKE,THREADS},RELNOTES*}
+%if %{with multigl}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ld.so.conf.d/Mesa.conf
+%dir %{_libdir}/Mesa
+%attr(755,root,root) %{_libdir}/Mesa/libGL.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/Mesa/libGL.so.1
+%else
%attr(755,root,root) %{_libdir}/libGL.so.*.*
%attr(755,root,root) %ghost %{_libdir}/libGL.so.1
# symlink for binary apps which fail to conform Linux OpenGL ABI
# (and dlopen libGL.so instead of libGL.so.1)
%attr(755,root,root) %{_libdir}/libGL.so
+%endif
%files libGL-devel
%defattr(644,root,root,755)
%{_includedir}/GL/xmesa.h
%{_includedir}/GL/xmesa_x.h
%{_includedir}/GL/xmesa_xf86.h
+%if %{with multigl}
+%attr(755,root,root) %{_libdir}/libGL.so
+%endif
%files libGL-static
%defattr(644,root,root,755)