%define oname DirectFB
%define libver 1.1-0

Summary:	Hardware graphics acceleration library
Name:		directfb
Version:	1.1.1
Release:	2%{?_dist_release}
License:	GPL
Group:		System Environment/Libraries
Source0:	http://www.directfb.org/download/%{name}/%{oname}-%{version}.tar.gz
Patch0:		%{oname}-%{version}_ppc.patch
URL:		http://www.directfb.org/
BuildRequires:	libpng-devel >= 1.2.0
BuildRequires:	zlib-devel >= 1.1.3
BuildRequires:	libjpeg-devel >= 6b
BuildRequires:	freetype2-devel >= 2.0.2
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

Vendor:       Project Vine
Distribution: Vine Linux

%description
DirectFB hardware graphics acceleration - libraries.


%package -n lib%{name}
Summary:        Shared library part of %oname
Group:		System Environment/Libraries

%description -n lib%{name}
DirectFB hardware graphics acceleration - libraries.

This package contains the %oname shared library and interface modules.
It's required for running apps based on %oname.

#'
%package -n lib%{name}-devel
Group:		Development/Libraries
Summary:	Header files for compiling DirectFB applications
Requires:	lib%{name} = %{version}-%{release}
Provides:	%{oname}-devel = %{version}-%{release}

%description -n lib%{name}-devel
DirectFB header files for building applications based on %oname. 

%package doc
Summary:	DirectFB - documentation
Group:		Applications/Documentation

%description doc
DirectFB documentation and examples.

%prep
%setup  -q -n %{oname}-%{version}
%patch0 -p1

%build
%configure \
	--enable-multi \
	--enable-shared \
        --with-gfxdrivers=ati128,i810,i830,mach64,nvidia,radeon,savage,sis315,vmware 

make

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;

# we don't ship dfbg ATM
rm -f $RPM_BUILD_ROOT%{_bindir}/dfbg
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/dfbg.1

%clean
rm -rf $RPM_BUILD_ROOT

%post -n lib%{name} -p /sbin/ldconfig

%postun -n lib%{name} -p /sbin/ldconfig


%files -n lib%{name}
%defattr(644,root,root,755)
%doc README* AUTHORS ChangeLog NEWS TODO
%{_bindir}/dfbdump
%{_bindir}/dfbfx
%{_bindir}/dfbinfo
%{_bindir}/dfbinput
%{_bindir}/dfblayer
%{_bindir}/dfbscreen
%{_bindir}/dfbpenmount
%{_bindir}/mkdfiff
%{_bindir}/mkdgiff
%{_libdir}/lib*.so.*
%dir %{_libdir}/directfb-%{libver}
%dir %{_libdir}/directfb-%{libver}/gfxdrivers
%dir %{_libdir}/directfb-%{libver}/inputdrivers
%dir %{_libdir}/directfb-%{libver}/interfaces
%dir %{_libdir}/directfb-%{libver}/systems
%dir %{_libdir}/directfb-%{libver}/wm
%{_libdir}/directfb-%{libver}/gfxdrivers/*.so
%{_libdir}/directfb-%{libver}/inputdrivers/*.so
%{_libdir}/directfb-%{libver}/interfaces/*/*.so
%{_libdir}/directfb-%{libver}/systems/*.so
%{_libdir}/directfb-%{libver}/wm/*.so
#{_libdir}/directfb-%{libver}/*.so
%{_datadir}/directfb-%{version}
%{_mandir}/man5/directfbrc.5*

%files -n lib%{name}-devel
%defattr(644,root,root,755)
%{_bindir}/directfb-config
%{_bindir}/directfb-csource
%{_includedir}/*
%{_libdir}/pkgconfig/*.pc
#{_libdir}/*.la
%{_libdir}/*.so
%{_mandir}/man1/directfb-csource.1*

%files doc
%defattr(644,root,root,755)
%doc docs/html/*

%changelog
* Sun May 25 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.1.1-2
- add Patch0 to fix ppc build problem (with newer kernels)

* Fri May  2 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.1.1-1
- new upstream release

* Mon Dec 25 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.16-2vl2
- changed doc Group to Applications/Documentation

* Fri Nov 26 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.16-2vl1
- changed packages Group:
- cleaned spec file (a little bit!)

* Fri Feb 28 2003 Kazuhisa TAKEI <takei@vinelinux.org> 0.9.16-2vl0
- new upstream version
- convert to Vine Linux

* Fri Dec 27 2002 Götz Waschk <waschk@linux-mandrake.com> 0.9.15-2mdk
- rebuild

* Wed Nov 13 2002 Götz Waschk <waschk@linux-mandrake.com> 0.9.15-1mdk
- new version

* Tue Oct 29 2002 Götz Waschk <waschk@linux-mandrake.com> 0.9.14-1mdk
- fix group of doc package
- new version

* Fri Aug 23 2002 Götz Waschk <waschk@linux-mandrake.com> 0.9.13-1mdk
- add directfb-csource and man page
- 0.9.13

* Thu Jul 11 2002 Götz Waschk <waschk@linux-mandrake.com> 0.9.12-1mdk
- initial package based on PLD effort

