File xorg-x11-drv-psb.spec of Package xorg-x11-drv-psb

%global tarball		xserver-xorg-video-psb
%global moduledir	%(pkg-config xorg-server --variable=moduledir )
%global driverdir	%{moduledir}/drivers

Summary:	Intel GMA500 (Poulsbo) video driver
Name:		xorg-x11-drv-psb
Version:	0.31.0
Release:	11%{?dist}.2
URL:		http://ppa.launchpad.net/ubuntu-mobile/ubuntu/pool/main/x/xserver-xorg-video-psb/
Source0:	http://ppa.launchpad.net/ubuntu-mobile/ubuntu/pool/main/x/xserver-xorg-video-psb/%{tarball}_%{version}.orig.tar.gz
# Causes psb module to be loaded when a GMA500 adapter PCI ID is found
# because the freaking module's too broken to include its own modalias
Source1:	poulsbo-modprobe.conf
Source2:        psb-xorg.conf
# Look for the variant libdrm in the right place
Patch0:		xorg-x11-drv-psb-0.31.0-libdrm.patch
# Don't do ACPI detection by default
Patch1:		xorg-x11-drv-psb-0.31.0-ignoreacpi.patch
Patch2:         0001-Fix-up-buildservice-warnings.patch
License:	MIT
Group:		User Interface/X Hardware Support
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?fedora} > 11
ExclusiveArch:  i686
%else %if 0%{?fedora} > 10
ExclusiveArch:  i586
%else
ExclusiveArch:  i386
%endif

BuildRequires:	pkgconfig
BuildRequires:	autoconf
BuildRequires:	automake
BuildRequires:	libtool
BuildRequires:	xorg-x11-server-sdk
BuildRequires:	xorg-x11-proto-devel
BuildRequires:	libdrm-poulsbo-devel
%if 0%{?suse_version}
BuildRequires:  Mesa-devel
%else
BuildRequires:	mesa-libGL-devel
%endif
BuildRequires:	freeglut-devel

Requires:	xorg-x11-server%{!?suse_version:-Xorg} >= 1.1.0
Requires:	psb-firmware
Requires:	xpsb-glx
Requires:	libdrm-poulsbo
%if 0%{?suse_version}
Provides:	psb-kmp
%else
Provides:	psb-kmod-common
%endif

%description 
Video driver for the Intel GMA500 video chipset, also known as Poulsbo.
Note this driver depends on several proprietary pieces (and an
obsolete version of libdrm) to work, and is hence inappropriate for
submission to the main Fedora repositories.

%prep
%setup -q -n %{tarball}-%{version}
%patch0 -p1 -b .libdrm
%patch1 -p1 -b .ignoreacpi
%patch2 -p1 -b .osc

iconv -f iso-8859-15 -t utf-8 -o man/psb.man.utf8 man/psb.man && mv man/psb.man.utf8 man/psb.man

%build
autoreconf -i
%configure --disable-static
make

%install
rm -rf %{buildroot}
%makeinstall mandir=%{_mandir} DESTDIR=%{buildroot}

# FIXME: Remove all libtool archives (*.la) from modules directory.  This
# should be fixed in upstream Makefile.am or whatever.
find %{buildroot} -regex ".*\.la$" | xargs rm -f --

mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d
install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/modprobe.d/poulsbo.conf

mkdir -p %{buildroot}%{_sysconfdir}/X11
install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/X11/xorg.conf

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%dir %{driverdir}
%{driverdir}/psb_drv.so
%{driverdir}/libmm.so
%config(noreplace) %{_sysconfdir}/X11/xorg.conf
%config %{_sysconfdir}/modprobe.d/poulsbo.conf
%{_mandir}/man4/*.4*

%changelog
* Sat Dec 12 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.31.0-11.2
- Make buildservice happy

* Sun Nov 08 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.31.0-11.1
- Remove livna integration
- Provide xorg.conf
- Adjust dependencies for OpenSUSE

* Mon Aug 24 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-11
- correct exclusivearch for rpmfusion buildsystem

* Thu Aug 20 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-10
- exclusivearch ix86 (there's no 64-bit poulsbo hardware)
- mark config file as config
- fix nvidia reference in comments of init script

* Wed Aug 19 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-9
- add another PCI ID to the modprobe config file

* Wed Aug 19 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-8
- fix up manpage character set

* Wed Aug 19 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-7
- drop greedy.patch as it doesn't seem to work (can't work out why)
- add xorg.conf handling initscript and script based on the ones used
  in NVIDIA and ATI packages, including setting migration heuristic
  in xorg.conf since the patch didn't work

* Fri Aug 14 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-6
- add greedy.patch: default to greedy migration heuristic (gives
  better performance for multiple testers)
- add ignoreacpi.patch: default to ignoreACPI (required to avoid X
  crashing for multiple testers)

* Tue Aug 11 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-5
- patch build to find newly relocated libdrm-poulsbo

* Mon Aug 10 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-4
- add a modprobe config file to make the kernel module auto-load (in
  this package as it's doing the job of psb-kmod-common)

* Mon Aug 10 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-3
- Require akmod-psb not kmod-psb so I don't have to keep rebuilding

* Mon Aug 10 2009 Adam Williamson <awilliam@redhat.com> - 0.31.0-2
- Begin changelog tracking

openSUSE Build Service is sponsored by