File DirectFB.spec of Package DirectFB

#
# spec file for package DirectFB
#
# Copyright (c) 2012 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/
#


%define directfbdir %{_libdir}/directfb-1.6-0

Name:           DirectFB
Version:        1.6.2
Release:        0
Summary:        Graphics Library for Framebuffer Devices
License:        LGPL-2.1+
Group:          System/Libraries
%define lname	libdirectfb-1_6-0
Url:            http://www.directfb.org/
Source:         %{name}-%{version}.tar.bz2
Source2:        baselibs.conf
# PATCH-FIX-UPSTREAM
Patch2:         DirectFB-0.9.24-matroxi2c.diff
# PATCH-FIX-UPSTREAM
Patch3:         DirectFB-1.2.9-headers.patch
# PATCH-FIX-UPSTREAM
Patch4:         DirectFB-cc-cflags.patch
# PATCH-FIX-UPSTREAM
Patch5:         DirectFB-int.patch
# PATCH-FIX-UPSTREAM
Patch6:         DirectFB-0.9.24-warning.patch
# PATCH-FIX-UPSTREAM
Patch11:        DirectFB-1.2.9-ignore-fbmodes.patch
# PATCH-FIX-UPSTREAM pngtoico-libpng15.patch -- pgajdos@suse.com; build with libpng15; sent today to andi@directfb.org
# build against libpng14 should not be affected, otherwise please let me know
Patch12:        DirectFB-1.5.3-fix_v4l1.patch
# PATCH-FIX-UPSTREAM
Patch13:        DirectFB-1.6.1-lm.patch
# PATCH-FIX-UPSTREAM
Patch14:        DirectFB-1.6.1-gcc-atomics-on-arm.patch
# PATCH-FIX-UPSTREAM
Patch15:        DirectFB-1.5.3-add-missing-davinci-files.patch
# PATCH-FIX-UPSTREAM
Patch16:        DirectFB-1.5.3-vdpau.patch
# PATCH-FIX-UPSTREAM
Patch18:        DirectFB-1.6.1-mesa-libgbm-stridefix.patch
# PATCH-FIX-UPSTREAM
Patch19:        DirectFB-1.6.1-FusionID-fix-git21c3684.patch
# PATCH-FIX-OPENSUSE DirectFB-setregion.patch -- dvaleev@suse.com; fixes cyber5k and readeon drivers build on powerpc
Patch20:        DirectFB-setregion.patch 
BuildRequires:  LibVNCServer-devel
BuildRequires:  SDL-devel
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libstdc++-devel
BuildRequires:  libv4l-devel
BuildRequires:  sysfsutils-devel
BuildRequires:  udev
BuildRequires:  xorg-x11-libX11-devel
BuildRequires:  xorg-x11-libXext-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%ifnarch s390 s390x
BuildRequires:  i2c-tools
%endif
# bug437293
%ifarch ppc64
Obsoletes:      DirectFB-64bit
%endif

%description
DirectFB is a thin library that provides hardware graphics
acceleration, input device handling and abstraction, an integrated
windowing system with support for translucent windows, and multiple
display layers on top of the Linux framebuffer device. It is a complete
hardware abstraction layer with software fallbacks for every graphics
operation that is not supported by the underlying hardware. DirectFB
adds graphical power to embedded systems and sets a new standard for
graphics under Linux.

%package -n %lname
Summary:        Graphics Library for Framebuffer Devices
Group:          System/Libraries

%description -n %lname
DirectFB is a thin library that provides hardware graphics
acceleration, input device handling and abstraction, an integrated
windowing system with support for translucent windows, and multiple
display layers on top of the Linux framebuffer device. It is a
complete hardware abstraction layer with software fallbacks for every
graphics operation that is not supported by the underlying hardware.
DirectFB adds graphical power to embedded systems and sets a new
standard for graphics under Linux.

%package devel
Summary:        Graphics Library for Framebuffer Devices
Group:          Development/Libraries/C and C++
Requires:       %lname = %{version}
Requires:       /bin/sh
Requires:       glibc-devel
Requires:       zlib-devel

%description devel
DirectFB is a thin library that provides hardware graphics
acceleration, input device handling and abstraction, an integrated
windowing system with support for translucent windows, and multiple
display layers on top of the Linux framebuffer device. It is a complete
hardware abstraction layer with software fallbacks for every graphics
operation that is not supported by the underlying hardware. DirectFB
adds graphical power to embedded systems and sets a new standard for
graphics under Linux.

%package doc
Summary:        Graphics Library for Framebuffer Devices Documentation
Group:          System/Libraries

%description doc
Graphics Library for Framebuffer Devices Documentation in html form.

%package libSDL
Summary:        SDL backend of Graphics Library for Framebuffer Devices
Group:          System/Libraries
Supplements:    packageand(%{name}:libSDL)

%description libSDL
SDL backend of Graphics Library for Framebuffer Devices:
 * gfxdrivers/libdirectfb_sdlgraphics.so
 * inputdrivers/libdirectfb_sdlinput.so
 * systems/libdirectfb_sdl.so

%package Mesa
Summary:        Mesa backend of Graphics Library for Framebuffer Devices
Group:          System/Libraries
Supplements:    packageand(%{name}:Mesa)

%description Mesa
Mesa backend of Graphics Library for Framebuffer Devices:
 * gfxdrivers/libdirectfb_gl.so
 * systems/libdirectfb_x11.so

%package libvncclient
Summary:        Mesa backend of Graphics Library for Framebuffer Devices
Group:          System/Libraries
Supplements:    packageand(%{name}:libvncclient)

%description libvncclient
Mesa backend of Graphics Library for Framebuffer Devices:
 * systems/libdirectfb_vnc.so

%prep
%setup -q
%patch2 -p1
%patch3
%patch4 -p1
%patch5 -p1
%patch6
#%patch8
%patch11 -p1
%patch12 -p1 -b .fix_v4l1
%patch13 -p1 -b .lm
%patch14 -p1 -b .arm-atomics
%patch15 -p1 -b .davinci
%patch16 -p1 -b .vdpau
%if 0%{?suse_version} > 1220
%patch18 -p1 -b .stride
%endif
%patch19 -p1 -b .fusionID
%patch20 -p1
#Disable ppc asm since compilation fails (and it seems better to use glibc)
sed -i.noppcasm -e 's/want_ppcasm=yes/want_ppcasm=no/'g configure.in configure
# Fix file-not-utf8
for i in ChangeLog README NEWS AUTHORS ; do
cp -pr $i $i.not-utf8
iconv -f ISO_8859-1 -t UTF8 $i.not-utf8 > $i
touch -r $i.not-utf8 $i
rm $i.not-utf8
done
#Remove old headers
rm interfaces/IDirectFBVideoProvider/{videodev.h,videodev2.h}

%build
%ifarch s390 s390x
	sed 's/-O3/-Os/' configure >c;chmod +x c;mv c configure;
%endif
%{configure} --enable-sdl --with-pic --enable-video4linux2 \
        --enable-zlib \
        --enable-rgb332 \
%ifarch x86_64
	--enable-mmx \
        --enable-sse \
%endif
%ifarch ppc64 ppc
	--with-gfxdrivers="ati128 cle266 cyber5k gl i810 mach64 matrox neomagic nsc nvidia pxa3xx radeon sis315 tdfx unichrome" \
%endif
%ifarch s390 s390x
	--with-gfxdrivers=none --with-inputdrivers=none --disable-video4linux --disable-fbdev \
%endif
%ifarch %arm
	--with-gfxdrivers="gl nvidia" \
%endif
	--enable-linux-input \
        --enable-x11 \
        --enable-unique \
        --with-smooth-scaling \
	--disable-gettid
# Remove rpath for 64bit
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install
find %{buildroot} -name '*.la' -type f -delete
#Fix some relative fonts for dfbinspector.c
# ln -s ../fonts/dejavu/DejaVuSans.ttf %{buildroot}%{_datadir}/%{name}-%{version}/decker.ttf

%check
make check %{?_smp_mflags}

%post -n %lname -p /sbin/ldconfig

%postun -n %lname -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%{_datadir}/directfb-%{version}
%{_bindir}/dfbg
%{_bindir}/dfbdump
%{_bindir}/dfbinfo
%{_bindir}/dfblayer
%{_bindir}/directfb-csource
%{_bindir}/dfbscreen
%{_bindir}/dfbinspector
%{_bindir}/dfbmaster
%{_bindir}/dfbfx
%{_bindir}/uwmdump
%{_bindir}/dfbinput
%{_bindir}/dfbpenmount
%{_bindir}/directfb-config
%{_bindir}/mkdgifft
%ifnarch %arm s390 s390x
%{_bindir}/pxa3xx_dump
%endif
%{_bindir}/mkd*iff
%doc %{_mandir}/man1/dfbg.1.gz
%doc %{_mandir}/man1/directfb-csource.1.gz
%doc %{_mandir}/man5/directfbrc.5.gz

%files -n %lname
%defattr(-,root,root)
%{_libdir}/libdirect*.so.*
%{_libdir}/libfusion*.so.*
%{_libdir}/libuniquewm*.so.*
%{directfbdir}
%exclude %{directfbdir}/gfxdrivers/libdirectfb_sdlgraphics.so
%exclude %{directfbdir}/inputdrivers/libdirectfb_sdlinput.so
%exclude %{directfbdir}/systems/libdirectfb_sdl.so
%ifnarch s390 s390x
%exclude %{directfbdir}/gfxdrivers/libdirectfb_gl.so
%endif
%exclude %{directfbdir}/systems/libdirectfb_x11.so
%exclude %{directfbdir}/systems/libdirectfb_vnc.so

%files devel
%defattr(-,root,root)
%{_libdir}/libdirect*.so
%{_libdir}/libfusion*.so
%{_libdir}/libuniquewm*.so
%{_includedir}/directfb-internal
%{_includedir}/directfb
%{_libdir}/pkgconfig/*

%files doc
%defattr(-,root,root)
%doc docs/html/*.html
%doc docs/html/*.png

%files libSDL
%defattr(-,root,root)
%{directfbdir}/gfxdrivers/libdirectfb_sdlgraphics.so
%{directfbdir}/inputdrivers/libdirectfb_sdlinput.so
%{directfbdir}/systems/libdirectfb_sdl.so

%files Mesa
%defattr(-,root,root)
%ifnarch s390 s390x
%{directfbdir}/gfxdrivers/libdirectfb_gl.so
%endif
%{directfbdir}/systems/libdirectfb_x11.so

%files libvncclient
%defattr(-,root,root)
%{directfbdir}/systems/libdirectfb_vnc.so

%changelog
openSUSE Build Service is sponsored by