%define name 915resolution
%define version 0.5.3
%define release 1%{?_dist_release}

Summary: A tool to force resolution of Intel 8xx,9xx video Card
Summary(ja): Intel 8xx, 9xx ビデオカードの解像度を強制設定するツール
Name: %{name}
Version: %{version}
Release: %{release}
License: Public Domain
Group: Applications/System
Url: http://www.geocities.com/stomljen/

Source0: http://www.geocities.com/stomljen/%{name}-%{version}.tar.gz
Source1: 915resolution.init
Source2: 915resolution.default-sysconfig
Patch: 915resolution-0.5.3-automatically-choose-best-mode.patch
Patch10: 915resolution-0.5.3-new-chipset.patch

BuildRoot: %{_tmppath}/%{name}-buildroot
Exclusivearch: %{ix86} x86_64
Requires: sed, grep

%description
915resolution is a tool to modify the video BIOS of the 800 and 900 series
Intel graphics chipsets. This includes the 845G, 855G, and 865G chipsets, as
well as 915G, 915GM, and 945G chipsets. This modification is necessary to
allow the display of certain graphics resolutions for an Xorg or XFree86
graphics server.

915resolution's modifications of the BIOS are transient. There is no risk of
permanent modification of the BIOS. This also means that 915resolution must be
run every time the computer boots inorder for it's changes to take effect.

915resolution is derived from the tool 855resolution. However, the code differs
substantially. 915resolution's code base is much simpler. 915resolution also 
allows the modification of bits per pixel.

%prep
%setup -q
%patch0 -p1 -b .automarically-choose-best-mode
%patch10 -p1 -b .new-chipset

%build
rm -f *.o
%__make

%install
rm -rf $RPM_BUILD_ROOT

install -D -m755 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
install -D -m0755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
install -D -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}


%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/chkconfig --add %{name}

%preun
if [ "$1" = 0 ]; then
	/sbin/chkconfig --del %{name}
fi


%files
%defattr(-,root,root)
%doc chipset_info.txt README.txt
%{_sbindir}/%{name}
%{_sysconfdir}/rc.d/init.d/*
%config(noreplace) %{_sysconfdir}/sysconfig/*


%changelog
* Sun Sep 14 2008 Shu KONNO <owa@bg.wakwak.com> 0.5.3-1vl5
- applied new versioning policy, spec in utf-8

* Tue Oct 30 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.3-0vl2
- add Patch10 to support 945GME,965GM/GME/GLE,G33,Q33,Q35

* Fri May 04 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.3-0vl1
- new upstream release

* Tue Dec 05 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.2-0vl4
- fix init.d/915resolution (<BTS:416>)

* Wed Sep 13 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.2-0vl3
- update init.d/915resolution
  - fix bugs (<BTS:0176>)

* Sat Sep 09 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.2-0vl2
- update init.d/915resolution
  - fix bugs
  - automatically detect XRESO and YRESO from xorg.conf.
    (use Monitor ModelName "LCD Panel XRESOxYRESO")

* Sat Sep 09 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.2-0vl1
- initial build for Vine Linux based on MDV package.

* Fri Aug 04 2006 Olivier Thauvin <nanardon@mandriva.org>
+ 08/04/06 19:16:12 (52825)
- rebuild

* Fri Aug 04 2006 Olivier Thauvin <nanardon@mandriva.org>
+ 08/04/06 19:14:11 (52823)
Import 915resolution

* Fri Jun 16 2006 Pixel <pixel@mandriva.com> 0.5.2-5mdv2007.0
- fix patch automatically-choose-best-mode
  (if no matching X resolution, it was chosing the last entry, even if unreachable)

* Tue May 02 2006 Olivier Thauvin <nanardon@mandriva.org> 0.5.2-4mdk
- Exclusivearch should be x86_64, not only amd64

* Tue May 02 2006 Pixel <pixel@mandriva.com> 0.5.2-3mdk
- Exclusivearch x86 and am64 (bugzilla #22203)

* Fri Apr 28 2006 Pixel <pixel@mandriva.com> 0.5.2-2mdk
- add patch automatically-choose-best-mode allowing "915resolution best <X> <Y>"
  which chooses the first bios mode with xres == <X>
  (or defaults to the last available mode)
- add a service calling 915resolution before dm is launched

* Thu Apr 27 2006 Olivier Thauvin <nanardon@mandriva.org> 0.5.2-1mdk
- initial mandriva rpm

