%define tarball xf86-video-ati
%define moduledir %(pkg-config xorg-server --variable=moduledir )
%define driverdir	%{moduledir}/drivers

Summary:   Xorg X11 ati video driver
Summary(ja):   Xorg X11 ati ビデオドライバ
Name:      xorg-x11-drv-ati
Version:   6.14.6
Release:   1%{?_dist_release}
URL:       http://www.x.org
License:   MIT
Group:     User Interface/X Hardware Support

Source0:   ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2
Source1:   mkxinf.ati

Patch0:     xf86-video-ati-6.14.6-revert-libdrm.patch

Patch10:    radeon-6.9.0-bgnr-enable.patch	
Patch11:    radeon-6.12.2-lvds-default-modes.patch
Patch12:    fix-default-modes.patch


BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
ExcludeArch: s390 s390x
BuildRequires: xorg-x11-server-sdk >= 1.6
BuildRequires: mesa-libGL-devel
BuildRequires: libdrm-devel >= 2.4.33
BuildRequires: automake autoconf libtool pkgconfig
BuildRequires: xorg-x11-util-macros
BuildRequires: libudev-devel
Requires:  hwdata
Requires:  xorg-x11-server-Xorg

Vendor: Project Vine
Distribution: Vine Linux

%description 
X.Org X11 ati video driver.

%prep
%setup -q -n %{tarball}-%{version}
%patch0 -p1 -b .drm
%patch10 -p1 -b .bgnr
%patch11 -p1 -b .lvds
%patch12 -p1 -b .def

%build
libtoolize --copy --force
autoreconf -iv
%configure --disable-static
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT%{_datadir}/hwdata/videoaliases
%{SOURCE1} src/pcidb/ati_pciids.csv > $RPM_BUILD_ROOT%{_datadir}/hwdata/videoaliases/radeon.xinf

find $RPM_BUILD_ROOT -regex ".*\.la$" | xargs rm -f --

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc README
%{driverdir}/ati_drv.so
%{driverdir}/radeon_drv.so
%{_datadir}/hwdata/videoaliases/radeon.xinf
%{moduledir}/multimedia/theatre200_drv.so
%{moduledir}/multimedia/theatre_detect_drv.so
%{moduledir}/multimedia/theatre_drv.so
%{_mandir}/man4/ati.4*
%{_mandir}/man4/radeon.4*

%changelog
* Wed Jul 11 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.6-1
- new upstream release
- update Patch0 (xf86-video-ati-6.14.6-revert-libdrm.patch)

* Sat Jun 09 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.5-1
- new upstream release
- replace Patch0 (xf86-video-ati-6.14.5-revert-libdrm.patch)

* Wed Jun 06 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.4-2
- add Patch0 (xf86-video-ati-6.14.4-git20120606.patch)

* Sun Apr 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.4-1
- new upstream release

* Wed Nov 02 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.3-1
- new upstream release
- remove Patch101

* Sun Aug 14 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.2-2
- add Patch0 (radeon-6.9.0-bgnr-enable.patch)
- add Patch1 (radeon-6.12.2-lvds-default-modes.patch)
- add Patch2 (fix-default-modes.patch)
- add Patch101 (xf86-video-ati-git20110803.patch)

* Sat May 28 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.2-1
- new upstream release

* Sat Mar 19 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.1-1
- new upstream release
- delete Patch0

* Mon Feb 28 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.0-2
- rebuild with xserver-1.10.0
- add Patch0 (xf86-video-ati-xserver-1.10.patch)

* Sat Feb 05 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.14.0-1
- new upstream release

* Sun Nov 07 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.13.2-3
- rebuild with xserver-1.9.2

* Fri Oct 22 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 6.13.2-2
- remove pre-generated radeon.xinf and ati.xinf
- add mkxinf.ati to generate radeon.xinf from source.

* Sun Oct 17 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.13.2-1
- new upstream release
- add BuildRequires: libudev-devel

* Sun Jul 18 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.13.1-1
- new upstream release

* Fri Apr 09 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 6.13.0-1
- new upstream release

* Sun Mar 28 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.12.6-3
- rebuild with xserver-1.8rc (x86_64)

* Wed Mar 24 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 6.12.6-2
- rebuild with xserver-1.8rc

* Sun Mar 21 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.12.6-1
- new upstream release

* Sun Mar 07 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 6.12.5-1
- new upstream release

* Thu Nov 19 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 6.12.4-1
- new upstream release

* Fri Jul 24 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 6.12.2-4
- rebuild with libdrm-2.4.12

* Tue May 12 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 6.12.2-3
- drop Patch1,7 (current kernel does not support kms)
- add Patch10: use EXA by default
- add Patch11: fix several dmps issue.
- add Patch12: Fix DVI output on some rs690 cards.

* Mon Apr 20 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 6.12.2-2
- add Patch1, update for radeon modeset driver
- add Patch7 to fix fb size on R600+ w/o kms

* Mon Apr 13 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 6.12.2-1
- new upstream release

* Mon Mar 23 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 6.12.0-1
- new upstream release

* Mon Jan 12 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 6.10.0-1
- new upstream release

* Fri Jul 04 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 6.9.0-1
- new upstream release
- r128 and mach64 drivers are now splitted to individual package.

* Mon May 12 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 6.8.0-1
- initial build for Vine Linux

* Thu Apr 24 2008 Dave Airlie <airlied@redhat.com> 6.8.0-12
- not so much faster as kill my Apple MAC DDC - next time do this upstream first

* Thu Apr 24 2008 Dave Airlie <airlied@redhat.com> 6.8.0-11
- fix r128 bios size issue (#439022)

* Sun Apr 06 2008 Dave Airlie <airlied@redhat.com> 6.8.0-10
- attempt to fix VT switch and X restart hangs

* Wed Apr 02 2008 Dave Airlie <airlied@redhat.com> 6.8.0-9
- attempt to fix dualhead and rotation at the same time.

* Mon Mar 31 2008 Dave Airlie <airlied@redhat.com> 6.8.0-8
- Hopefully fix quirks not applying on radeon LVDS (#435126)
- quirk connector table from (#428515)
- fix rotate on r500 cards

* Sun Mar 30 2008 Dave Airlie <airlied@redhat.com> 6.8.0-7
- Major upstream fixes backported - render accel, xv etc.
- This is done with a separate patch as upstream has split mach64/r128 already

* Fri Mar 28 2008 Adam Jackson <ajax@redhat.com> 6.8.0-6
- radeon.xinf: :1,$s/radeon_tp/radeon/

* Wed Mar 26 2008 Dave Airlie <airlied@redhat.com> 6.8.0-5
- Fix mach64 on ia64 with 16k pagesize (#438947)

* Tue Mar 11 2008 Adam Jackson <ajax@redhat.com> 6.8.0-4
- r500-dual-link-love.patch: Make R300+ max CRTC size guess big enough
  for a 30" monitor.

* Mon Mar 03 2008 Dave Airlie <airlied@redhat.com> 6.8.0-3
- rebuild for upstream ABI breakage

* Tue Feb 26 2008 Dave Airlie <airlied@redhat.com> 6.8.0-2
- rebase to upstream 6.8.0 release + git fixes

* Tue Feb 19 2008 Dave Airlie <airlied@redhat.com> 6.8.0-1
- rebase to upstream 6.8.0 release.

* Mon Feb 18 2008 Dave Airlie <airlied@redhat.com> 6.7.197-3
- rebase to upstream git master - lots of r600 fixes

* Fri Feb 08 2008 Dave Airlie <airlied@redhat.com> 6.7.197-2
- rebase to upstream git master - add rv67x ids

* Mon Feb 04 2008 Dave Airlie <airlied@redhat.com> 6.7.197-1
- rebase to upstream git master
- add r5xx and r6xx pci ids to xinf

* Thu Jan 17 2008 Dave Airlie <airlied@redhat.com> 6.7.196-7
- fix up IGPs from upstream fix.

* Wed Jan 09 2008 Adam Jackson <ajax@redhat.com> 6.7.196-6
- Rebuild for new server ABI.

* Wed Jan 02 2008 Adam Jackson <ajax@redhat.com> 6.7.196-5
- r128-6.7.196-pciaccess.patch: Fix some preprocessor dumbness.

* Wed Jan 02 2008 Adam Jackson <ajax@redhat.com> 6.7.196-4
- r128-6.7.196-pciaccess.patch: Port r128 to libpciaccess.

* Wed Dec 19 2007 Dave Airlie <airlied@redhat.com> 6.7.196-3
- radeon-git-upstream-fixes.patch - update for latest git master
- radeon-6.7.196-atombios-support.patch - update for r500/r600

* Mon Dec 17 2007 Adam Jackson <ajax@redhat.com> 6.7.196-2
- *-6.7.196-alloca.patch: Fix ALLOCATE_LOCAL failures.

* Wed Nov 14 2007 Adam Jackson <ajax@redhat.com> 6.7.196-1
- xf86-video-ati 6.7.196

* Tue Nov 13 2007 Adam Jackson <ajax@redhat.com> 6.7.195-5
- Require xserver 1.4.99.1

* Thu Nov 08 2007 Adam Jackson <ajax@redhat.com> 6.7.195-4
- radeon-6.7.195-faster-ddc.patch: Speed up X startup by assuming the
  monitor doesn't need a dead chicken waved over it to get DDC.

* Tue Oct 16 2007 Dave Airlie <airlied@redhat.com> 6.7.195-3
- upstream fixes including previous patches + attempted mac detection

* Tue Oct 09 2007 Adam Jackson <ajax@redhat.com> 6.7.195-2
- DDC and LVDS patches from git.

* Sat Oct 06 2007 Adam Jackson <ajax@redhat.com> 6.7.195-1
- xf86-video-ati 6.7.195

* Fri Oct 5 2007 Dave Airlie <airlied@redhat.com> 6.7.194-3
- radeon-6.7.194-upstream-fixes - Upstream LVDS fixes
  improve chances of working on more panels.

* Fri Sep 28 2007 Dave Airlie <airlied@redhat.com> 6.7.194-2
- radeon-6.7.194-disable-rc410-dri.patch - Disable DRI on
  RC410 by default as it seems to need some more work.

* Mon Sep 24 2007 Dave Airlie <airlied@redhat.com> 6.7.194-1
- xf86-video-ati 6.7.194

* Thu Sep 20 2007 Dave Airlie <airlied@redhat.com> 6.7.193-1
- xf86-video-ati 6.7.193

* Mon Aug 27 2007 Adam Jackson <ajax@redhat.com> 6.7.192-1
- xf86-video-ati 6.7.192

* Mon Aug 27 2007 Dave Airlie <airlied@redhat.com> 6.7.191-2
- radeon-6.7.191-git-master.patch - upgrade to git head
  f36720377737210c985b196d9a988efdd767f1c7

* Tue Aug 23 2007 Dave Airlie <airlied@redhat.com> 6.7.191-1
- xf86-video-ati 6.7.191. - Add a pre-release of radeon randr code
  This will break old zaphod mode further than the current 6.6.193
  driver, and will probably break mergedfb configs, however it will
  work with randr-1.2 properly and is the more supported codebase going
  forward.

* Tue Aug 21 2007 Adam Jackson <ajax@redhat.com> - 6.6.193-3
- Rebuild for build id

* Wed Aug 08 2007 Dave Airlie <airlied@redhat.com> 6.6.193-2
- xf86-video-ati 6.6.193. - remove dotclock workaround for now
  It causes crashes bug 251051

* Sat Aug 04 2007 Dave Airlie <airlied@redhat.com> 6.6.193-1
- xf86-video-ati 6.6.193.

* Wed Jun 27 2007 Adam Jackson <ajax@redhat.com> 6.6.192-1
- xf86-video-ati 6.6.192.

* Tue Jun 19 2007 Adam Jackson <ajax@redhat.com> 6.6.3-4
- radeon-6.6.3-renderaccel-buglet.patch: Fix OpenOffice font corruption
  when RenderAccel is disabled. (#244675)

* Mon Jun 18 2007 Adam Jackson <ajax@redhat.com> 6.6.3-3
- Update Requires and BuildRequires.  Disown the module directories.  Add
  Requires: hwdata.

* Thu Feb 15 2007 Adam Jackson <ajax@redhat.com> 6.6.3-2
- ExclusiveArch -> ExcludeArch

* Tue Nov 7 2006 Adam Jackson <ajackson@redhat.com> 6.6.3-1.fc7
- Update to 6.6.3.

* Mon Oct 2 2006 Adam Jackson <ajackson@redhat.com> 6.6.2-4
- ati-prefer-radeon-then-r128.patch: When loading through the 'ati' wrapper,
  prefer radeon to rage128 to mach{64,32,16,8,4,2,1}. 
- r128-fp-dpms.patch: Hook up DPMS for Rage128 DFPs. (#197436)
- radeon-6.6.2-dac-fix.patch: Even though we turn DACs on for probing, don't
  turn them off.  Fixes black screen of death post-rhgb.  (#208610)
- radeon-6.6.2-pmac-bios.patch: Be more suspicious of ROMs before interpreting
  their content.  (#208694)
- radeon-6.6.2-usefbdev-patch.patch: Use the framebuffer stride from fbdev,
  instead of making up numbers.  (#208694)

* Sun Oct 01 2006 Jesse Keating <jkeating@redhat.com> - 6.6.2-3
- rebuilt for unwind info generation, broken in gcc-4.1.1-21

* Thu Sep 21 2006 Adam Jackson <ajackson@redhat.com> 6.6.2-2.fc6
- radeon-6.6.2-dac-fix.patch: Backport 25fa71... from git.  Turn on the DAC
  before doing CRT connection probe, otherwise we might incorrectly detect
  a CRT where there isn't one. (#202240 and others)

* Tue Aug 29 2006 Adam Jackson <ajackson@redhat.com> 6.6.2-1.fc6
- Update to 6.6.2 from upstream:
  - Mach64 stability and correctness fixes
  - Mach64 EXA support.
  - Misc bugfixes for radeon.

* Thu Aug 24 2006 Adam Jackson <ajackson@redhat.com> 6.6.1-11.fc6
- radeon-6.6.1-use-mtdriver.patch: Only flag modes with M_T_PREFERRED if
  the EDID blocks says to.

* Fri Aug 18 2006 Adam Jackson <ajackson@redhat.com> 6.6.1-10.fc6
- radeon-6.6.1-use-mtdriver.patch: Use new M_T_DRIVER mode type for mode
  synthesis.
- Bump Requires to match.

* Fri Aug 18 2006 Adam Jackson <ajackson@redhat.com> 6.6.1-9.fc6
- mach64-cpio-for-ia64.patch: Enable CPIO for mach64 on ia64. (#203017)

* Thu Aug 10 2006 Adam Jackson <ajackson@redhat.com> 6.6.1-8.fc6
- radeon-6.6.1-xpress-200.patch: Also disable DRI on xpress200, known broken.

* Wed Aug  2 2006 Adam Jackson <ajackson@redhat.com> 6.6.1-7.fc6
- Make sure DRI and Render accel are disabled on RN50.

* Sat Jul 29 2006 Kristian H淡gsberg <krh@redhat.com> 6.6.1-6.fc5.aiglx
- Build for fc5 aiglx repo.

* Thu Jul 27 2006 Adam Jackson <ajackson@redhat.com> 6.6.1-6.fc6
- Updated radeon.xinf: comments, a handful of new devices.

* Mon Jul 24 2006 Mike A. Harris <mharris@redhat.com> 6.6.1-5.fc6
- Added r128-missing-xf86ForceHWCursor-symbol-bug168753.patch to fix (#168753)
- Add {?dist} tag to Release field

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> 6.6.1-4.1
- rebuild

* Wed Jun 28 2006 Mike A. Harris <mharris@@redhat.com> 6.6.1-4
- Added "BuildRequires: xorg-x11-server-sdk >= 1.1.0-12" to fix the same
  problem at build time as were added in 6.6.1-2 to fix it at runtime.

* Tue Jun 27 2006 Kristian H淡gsberg <krh@redhat.com> 6.6.1-3
- Bump release for FC5 aiglx build.

* Mon Jun 26 2006 Adam Jackson <ajackson@redhat.com> 6.6.1-2
- Filter the EDID mode list by the monitor's reported pixel clock.  Bump
  the BuildReq to a server that provides the necessary ABI field.

* Sat Jun 17 2006 Mike A. Harris <mharris@redhat.com> 6.6.1-1
- Updated xorg-x11-drv-ati to version 6.6.1 update release for X11R7.1
- Drop db-root-visual.patch, as it is included in 6.6.1
- Enable DRI support for sparc/sparc64 builds.

* Fri Jun  9 2006 Kristian H淡gsberg <krh@redhat.com> 6.6.0-7
- Committed db-root-visual.patch and reenabled.

* Thu Jun  8 2006 Mike A. Harris <mharris@@redhat.com> 6.6.0-6
- Disable db-root-visual.patch, because the file wasn't committed to CVS.

* Thu Jun  8 2006 Kristian H淡gsberg <krh@redhat.com> 6.6.0-5
- Bump for rawhide build.

* Thu Jun  8 2006 Kristian H淡gsberg <krh@redhat.com> 6.6.0-4
- Add db-root-visual.patch to make root visual double buffered.

* Tue May 23 2006 Adam Jackson <ajackson@redhat.com> 6.6.0-3
- Rebuild for 7.1 ABI fix.

* Tue Apr 11 2006 Kristian H淡gsberg <krh@redhat.com> 6.6.0-2
- Bump for fc5-bling build.

* Sun Apr  9 2006 Adam Jackson <ajackson@redhat.com> 6.6.0-1
- Update to 6.6.0 from 7.1RC1.

* Tue Apr  4 2006 Kristian H淡gsberg <krh@redhat.com> 6.5.7.3-4.cvs20060404
- Update to CVS snapshot from 20060404.

* Wed Mar 22 2006 Kristian H淡gsberg <krh@redhat.com> 6.5.7.3-4.cvs20060322
- Update to CVS snapshot of 20060322.
- Drop xorg-x11-drv-ati-6.5.7.3-radeon-metamodes-SEGV-fix.patch.

* Tue Feb 21 2006 Mike A. Harris <mharris@redhat.com> 6.5.7.3-4
- Added xorg-x11-drv-ati-6.5.7.3-radeon-metamodes-SEGV-fix.patch from CVS HEAD.

* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 6.5.7.3-3.2
- bump again for double-long bug on ppc(64)

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 6.5.7.3-3.1
- rebuilt for new gcc4.1 snapshot and glibc changes

* Sun Feb 05 2006 Mike A. Harris <mharris@redhat.com> 6.5.7.3-3
- Updated radeon.xinf to be up to date with the xf86PciInfo.h from the Xorg
  X server 1.0.1-1 source.  This should account for all supported Radeon
  models now modulo errors/omissions.

* Thu Feb 02 2006 Mike A. Harris <mharris@redhat.com> 6.5.7.3-2
- Added r128.xinf and radeon.xinf videoalias files to fix bug (#174101).
- Added "BuildRequires: libdrm-devel >= 2.0-1" to fix bug (#178613)

* Wed Jan 18 2006 Mike A. Harris <mharris@redhat.com> 6.5.7.3-1
- Updated xorg-x11-drv-ati to version 6.5.7.3 from X11R7.0
- Added ati.xinf videoalias file for hardware autodetection.

* Tue Dec 20 2005 Mike A. Harris <mharris@redhat.com> 6.5.7.2-1
- Updated xorg-x11-drv-ati to version 6.5.7.2 from X11R7 RC4
- Removed 'x' suffix from manpage dirs to match RC4 upstream.

* Wed Nov 16 2005 Mike A. Harris <mharris@redhat.com> 6.5.7-1
- Updated xorg-x11-drv-ati to version 6.5.7 from X11R7 RC2

* Fri Nov 4 2005 Mike A. Harris <mharris@redhat.com> 6.5.6.1-1
- Updated xorg-x11-drv-ati to version 6.5.6.1 from X11R7 RC1
- Fix *.la file removal.
- Add "BuildRequires: mesa-libGL-devel >= 6.4-4 for DRI builds"

* Mon Oct 3 2005 Mike A. Harris <mharris@redhat.com> 6.5.6-1
- Update BuildRoot to use Fedora Packaging Guidelines.
- Deglob file manifest.
- Use _smp_mflags with make, to speed up SMP builds.
- Add "alpha sparc sparc64" to ExclusiveArch

* Fri Sep 2 2005 Mike A. Harris <mharris@redhat.com> 6.5.6-0
- Initial spec file for ati video driver generated automatically
  by my xorg-driverspecgen script.
