File glamor.spec of Package glamor

#
# spec file for package glamor
#
# Copyright (c) 2014 SUSE LINUX Products 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/
#


Name:           glamor
Version:        0.6.0
Release:        0
Summary:        Open-source X.org graphics common driver based on GL library
License:        MIT
Group:          System/X11/Servers/XF86_4
Url:            http://www.freedesktop.org/wiki/Software/Glamor
Source:         http://xorg.freedesktop.org/releases/individual/driver/%{name}-egl-%{version}.tar.bz2

BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(dri2proto) >= 2.6
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(gbm)
BuildRequires:  pkgconfig(gl) >= 7.1.0
BuildRequires:  pkgconfig(glesv2)
BuildRequires:  pkgconfig(libdrm) >= 2.4.23
BuildRequires:  pkgconfig(xorg-server) >= 1.10
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExcludeArch:    s390 s390x
# make sure we rebuild when Mesa changes
%requires_eq    Mesa-libGL1

%description
The glamor module is an open-source 2D graphics common driver for the X Window
System as implemented by X.org. It supports a variety of graphics chipsets which
have OpenGL/EGL/GBM supports.

It’s a GL-based rendering acceleration library for X server:

  * It uses GL functions and shader to complete the 2D graphics operations.
  * It uses normal texture to represent a drawable pixmap if possible.
  * It calls GL functions to render to the texture directly.

It’s somehow hardware independently. And could be a building block of any
X server’s DDX driver:

  * Xorg’s DDX driver could leverage glamor-egl package to create an egl context
    without any native X system. Now the xf86-intel-video driver uses glamor as
    one of its option. When you build it with --enable-glamor, then it will use
    glamor as its rendering enginee.

This package can support every platform which has OpenGL and gbm and drm libraries.

%package devel
Summary:        Development files for %{name}
Group:          Development/Languages/C and C++
Requires:       %{name} = %{version}

%description devel
Development files for %{name}

%prep
%setup -q -n %{name}-egl-%{version}

%build
autoreconf -fi
%configure \
 --disable-static \
 --with-xorg-conf-dir=%{_sysconfdir}/X11/xorg.conf.d
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}
# No longer required with current radeon drivers; also it harms
# when being used together with fglrx driver
rm %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/glamor.conf
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d/
cat <<EOF >%{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf
%{_libdir}/xorg/modules
EOF

%post   -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING README ChangeLog
%{_sysconfdir}/ld.so.conf.d/%{name}.conf
%{_libdir}/libglamor.so.*
%{_libdir}/xorg/modules/libglamor*.so

%files devel
%defattr(-,root,root)
%{_libdir}/libglamor.so
%exclude %{_libdir}/libglamor.la
%{_libdir}/pkgconfig/%{name}*.pc
%{_includedir}/xorg/glamor.h
%exclude %{_libdir}/xorg/modules/*.la

%changelog