%define version 22.6
%define release 0vl1

Summary: The boot loader for Linux and other operating systems.
Name: lilo
Version: %{version}
Release: %{release}
License: MIT
Group: System Environment/Base
URL: http://home.san.rr.com/johninsd/pub/linux/lilo/
Source: http://home.san.rr.com/johninsd/pub/linux/lilo/lilo-%{version}.tar.bz2
SOURCE10: vine30.bmp
Patch0: lilo-21.6-keytab-3mdk.patch.bz2
Patch1: lilo-disks-without-partitions.patch.bz2
Patch9: lilo-22.5.1-unsafe-and-default-table.patch.bz2
Patch20: lilo-22.6-graphic-makefile.patch.bz2
Patch21: lilo-22.5.9-graphic.patch.bz2
Patch22: lilo-22.6-mandir.patch.bz2
Patch26: lilo-22.5.9-longer_image_names.patch.bz2
Patch27: lilo-22.5.8-two_columns.patch.bz2
Patch28: lilo-22.5.9-never-relocate-when-has-partititions.patch.bz2
Patch29: lilo-22.5.9-initialize-Volume-IDs-with-no-fanfare.patch.bz2
Patch30: lilo-22.5.9-test-edd.patch.bz2
Patch31: lilo-22.5.9-exit_code_1_when_aborting.patch.bz2

BuildRequires: tetex, dev86, fileutils, nasm
PreReq: perl
Exclusivearch: %{ix86}
Buildroot: %{_tmppath}/%{name}-%{version}-root

%description
LILO (LInux LOader) is a basic system program which boots your Linux
system.  LILO loads the Linux kernel from a floppy or a hard drive, boots
the kernel and passes control of the system to the kernel.  LILO can also
boot other operating systems.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch9 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch26 -p1 -b .images
%patch27 -p1 -b .two
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1

bzip2 -9 README*

%build
perl -p -i -e "s/-Wall -g/$RPM_OPT_FLAGS/" Makefile
make
(cd doc
make CFLAGS="$RPM_OPT_FLAGS"
dvipdfm -o User_Guide.pdf user.dvi
dvipdfm -o Technical_Guide.pdf tech.dvi
rm -f *.aux *.log *.toc)

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
make install ROOT=$RPM_BUILD_ROOT

install -d $RPM_BUILD_ROOT%{_bindir}
mv $RPM_BUILD_ROOT%{_sbindir}/* $RPM_BUILD_ROOT%{_bindir}

# graphic addons, keep default options for bmp2mdk

%{__perl} ./bmp2mdk	mode:0x103 \
			timer:357,610,0,128 \
			entry:161,144,0,128,13,54 \
			progress:405,167,11,17,128 \
			clear:600,800,64+127 \
			pos:0,0 \
	< %{SOURCE10} > $RPM_BUILD_ROOT/boot/message

install bmp2mdk %buildroot%{_bindir}/lilo-bmp2mdk

mkdir -p %buildroot/%{_mandir}/man{5,8}/
install -m644 manPages/*.5 %buildroot/%{_mandir}/man5/
install -m644 manPages/*.8 %buildroot/%{_mandir}/man8/

%clean
rm -rf $RPM_BUILD_ROOT

%post
if [ -f /etc/lilo.conf ]; then
  chmod 600 /etc/lilo.conf
  /sbin/lilo > /dev/null
fi

%files
%defattr(-,root,root)
%doc README* COPYING
%doc doc/*.pdf CHANGES INCOMPAT QuickInst
/boot/message
/boot/diag1.img
/boot/diag2.img
/sbin/*
%{_bindir}/*
%{_mandir}/*/*

%changelog
* Sun Nov 21 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 22.6.1-0vl1
- new upstream release
- merged with mandrake's lilo-22.6-1mdk
  * Tue Sep 21 2004 Pixel <pixel@mandrakesoft.com> 22.5.9-9mdk
  - add README.test_bios in patch test-edd
  * Thu Sep  9 2004 Pixel <pixel@mandrakesoft.com> 22.5.9-6mdk
  - exit_code_1 when aborting
  - add patch to build test-edd.b 
    (build, then define TEST_EDD in first.S, build again, then use first.b)
  * Tue Aug 17 2004 Pixel <pixel@mandrakesoft.com> 22.5.9-5mdk
  - add patch initialize-Volume-IDs-with-no-fanfare
    (to initialize Volume IDs without prompting)
  * Fri Aug  6 2004 Pixel <pixel@mandrakesoft.com> 22.5.9-4mdk
  - never-relocate-when-has-partititions (lilo tries to skip overwriting the
    first 0x40 bytes of the devices when it detects a dos bootsector, alas it can
    detect one on the MBR)
  * Mon Aug  2 2004 Pixel <pixel@mandrakesoft.com> 22.5.9-3mdk
  - lilo-bmp2mdk: accept bmp images with palette bigger than 128 colors *if* colors above 128 are not used
  * Fri Jul 30 2004 Pixel <pixel@mandrakesoft.com> 22.5.9-2mdk
  - merge in graphic patch21 allgraph (patch23) and progress (patch24)
  - add handling of xxx.bmp.parameters in lilo-bmp2mdk
  to generate xxx.bmp.parameters use drakxplash2 (until merged in draksplash)
  * Fri Feb  6 2004 Juan Quintela <quintela@mandrakesoft.com> 22.5.8-4mdk
  - fix compilation with 2.6 headers (should still compile with 2.4 ones).
  - longer names are allowed for i686-up-4GB & friends to work.
  - 15 -> 31 chars should be enough (it needs to be (2^n)-1.
  - getting previous point to work is more difficult that it sounds.
  * Wed Jan  7 2004 Pixel <pixel@mandrakesoft.com> 22.5.8-3mdk
  - provides bootloader (basesystem now requires "bootloader" instead of lilo)
  * Fri Dec 19 2003 Luca Berra <bluca@vodka.it> 22.5.8-2mdk
  - shut up if device mapper is not loaded
  - glibc 2.3.3 needs <asm/page.h> included
  - added device mapper support (optional)
  - removed packager tag

* Tue Nov 18 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 22.5.8-0vl1
- new upstream release

* Wed Nov 12 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 22.5.7.2-0vl3
- change text color on boot screen

* Tue Nov 11 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 22.5.7.2-0vl2
- simply install message-graphics as message

* Tue Nov 11 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 22.5.7.2-0vl1
- new upstream release
- new lilo package based on Mandrake's package.
  * Sat Mar 09 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 21.4.4-8vl6
  - update boot graphics
  * Sat Sep 08 2001 Toru Sagami <sagami@vinelinux.org> 21.4.4-8vl5
  - changed BuildPreReq: tetex, not obsoleted dvipsk
  * Fri Mar 09 2001 sagami@vinelinux.org 21.4.4-8vl4
  - man-pages are included and added BuildPreReq: dvipsk dev86 fileutils
  * Sun Oct  1 2000 Daisuke SUZUKI <daisuke@linux.or.jp>
  - update boot graphics
  * Tue Sep 22 2000 Daisuke SUZUKI <daisuke@linux.or.jp>
  - update boot graphics
  * Tue Sep 22 2000 Daisuke SUZUKI <daisuke@linux.or.jp>
  - add Vine boot graphics

* Thu Sep 18 2003 François Pons <fpons@mandrakesoft.com> 22.5.7.2-6mdk
- added new picture for 9.2 with progress bar integrated inside.
- fixed critical bug of bmp2mdk generating wrong files if both timer
  and progress bar are given.
- added conflicts due to multiple lilo-bmp2mdk defined.

* Thu Sep 18 2003 François Pons <fpons@mandrakesoft.com> 22.5.7.2-5mdk
- fixed critical bug of freeze when an entry is selected by adding a
  progress bar in graphical mode when loading files.

* Wed Sep 03 2003 François Pons <fpons@mandrakesoft.com> 22.5.7.2-4mdk
- fixed to keep graphical mode if kernel uses it, else change to
  text mode.

* Tue Sep 02 2003 François Pons <fpons@mandrakesoft.com> 22.5.7.2-3mdk
- updated with smarter 9.2 pictures correctly handling multiple entries.

* Thu Aug 21 2003 François Pons <fpons@mandrakesoft.com> 22.5.7.2-2mdk
- updated with newer 9.2 pictures.

* Thu Aug 21 2003 Pixel <pixel@mandrakesoft.com> 22.5.7.2-1mdk
- new release

* Mon Aug 18 2003 Pixel <pixel@mandrakesoft.com> 22.5.7-2mdk
- add disks-without-partitions.patch

* Mon Aug 11 2003 Pixel <pixel@mandrakesoft.com> 22.5.7-1mdk
- new release

* Sun Aug  3 2003 Pixel <pixel@mandrakesoft.com> 22.5.6.1-1mdk
- new release (fix bug cause "L 40 40 ..." at boot)

* Tue Jul 29 2003 Pixel <pixel@mandrakesoft.com> 22.5.6-1mdk
- new release
- BuildRequires: dev86-devel (thanks to bluca at comedia dot it)

* Wed Jun 18 2003 Pixel <pixel@mandrakesoft.com> 22.5.5-1mdk
- new release (with images diag1.img and diag2.img)

* Mon May 12 2003 Pixel <pixel@mandrakesoft.com> 22.5.3-1mdk
- new release

* Mon May  5 2003 Pixel <pixel@mandrakesoft.com> 22.5.2-1mdk
- new release

* Mon May  5 2003 Pixel <pixel@mandrakesoft.com> 22.5.1-2mdk
- add "BuildRequires: nasm"

* Wed Apr  2 2003 Pixel <pixel@mandrakesoft.com> 22.5.1-1mdk
- new release (update patches)

* Wed Feb 05 2003 François Pons <fpons@mandrakesoft.com> 22.4.1-2mdk
- fixed picture with smoother dithering.

* Fri Jan 31 2003 Pixel <pixel@mandrakesoft.com> 22.4.1-1mdk
- new release

* Thu Jan 30 2003 François Pons <fpons@mandrakesoft.com> 22.4-2mdk
- new picture for newer distribution.

* Sat Jan 25 2003 Pixel <pixel@mandrakesoft.com> 22.4-1mdk
- new release

* Mon Nov  4 2002 Pixel <pixel@mandrakesoft.com> 22.3.4-1mdk
- new release

* Thu Oct 10 2002 Pixel <pixel@mandrakesoft.com> 22.3.3-1mdk
- new release

* Wed Aug 14 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 22.3.2-5mdk
- Automated rebuild with gcc 3.2-0.3mdk

* Fri Aug 02 2002 Giuseppe Ghib<ghibo@mandrakesoft.com> 22.3.2-4mdk
- removed duplicated PostScript files.
- PDF documentation instead of PostScript one.

* Fri Jul 19 2002 Pixel <pixel@mandrakesoft.com> 22.3.2-3mdk
- have bmp2mdk in /usr/bin/lilo-bmp2mdk (in lilo-doc)

* Thu Jul 18 2002 François Pons <fpons@mandrakesoft.com> 22.3.2-2mdk
- updated boot image for 9.0.

* Fri Jul 12 2002 Pixel <pixel@mandrakesoft.com> 22.3.2-1mdk
- new release

* Thu Jun 27 2002 Pixel <pixel@mandrakesoft.com> 22.3.1-1mdk
- new release

* Tue Jun 25 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 22.3-2mdk
- Nuke egcs requirement
- Patch22: Workaround manpath bug that returns /usr/local/man as first
  man dir (aka Titi woes)

* Mon May 27 2002 Pixel <pixel@mandrakesoft.com> 22.3-1mdk
- new release

* Tue Feb 07 2002 François Pons <fpons@mandrakesoft.com> 22.2-2mdk
- fixed lost part of image on some hardware (i810).
- very small reduction of graphic patch size.

* Wed Feb 06 2002 François Pons <fpons@mandrakesoft.com> 22.2-1mdk
- 22.2.

* Wed Jan 30 2002 François Pons <fpons@mandrakesoft.com> 22.1-5mdk
- extend message file to 512Kb instead of 64Kb.

* Mon Jan 28 2002 François Pons <fpons@mandrakesoft.com> 22.1-4mdk
- removed ghost property on hilited entry.
- modified color of timer and hilited text to be dimer.

* Fri Jan 25 2002 François Pons <fpons@mandrakesoft.com> 22.1-3mdk
- updated graphic patch to allow simple scrolling.

* Fri Jan 25 2002 François Pons <fpons@mandrakesoft.com> 22.1-2mdk
- updated picture.

* Thu Jan 24 2002 François Pons <fpons@mandrakesoft.com> 22.1-1mdk
- changed picture and extended entry height to 15 instead of 7.
- updated graphic patch with 22.1.
- 22.1.

* Wed Jan 09 2002 François Pons <fpons@mandrakesoft.com> 21.7.5-3mdk
- updated graphic patch (newer bmp2mdk and typo updates in README.graphic).
- new 8.2 boot image.

* Sun Dec  9 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 21.7.5-2mdk
- Patch1: fix build, by including linux/genhd.h not linux/fs.h, and
  not including bad defines for older kernels
- s/Serial/Epoch/

* Sun Aug  5 2001 Pixel <pixel@mandrakesoft.com> 21.7.5-1mdk
- new release (how did i miss it?)
- drop the leading 0. from the release number

* Thu Jul 26 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-18mdk
- added another patch from VMWare.

* Tue Jul 24 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-17mdk
- fixed blank chars on timeout boot.
- added patch from VMWare to fix unsupported banked videoram.
- added missing build requires.

* Thu Jul 19 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-16mdk
- new graphic message for next release.

* Tue Jul 03 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 0.21.7-15mdk
- make /etc/lilo.conf unreadable but for root as it may contain
  passwords. (sly0.21.7-15mdk)

* Tue Jun 19 2001 Pixel <pixel@mandrakesoft.com> 0.21.7-14mdk
- make /boot/lilo-* directories belong to lilo

* Tue Jun 19 2001 Stefan van der Eijk <stefan@eijk.nu> 0.21.7-13mdk
- BuildRequires: tetex-dvips tetex-latex

* Fri Jun 01 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-12mdk
- Reworked graphic patch to include needed tools and README and
  multi stage2 available.
- Moved pictures in a standalone archive.

* Fri Apr 27 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-11mdk
- Created patch to handle more nicely all lilo stage2 (boot.b).

* Sun Apr  8 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 0.21.7-10mdk
- Call detectloader with -q.

* Sun Apr  8 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 0.21.7-9mdk
- By default don't include the boot.b file if there is no exiting
  boot.b file then link it to boot-menu.b (this allow to keep
  graphical boot menu when upgrading if it set).

* Thu Apr  5 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 0.21.7-8mdk
- Reinsert manpages in doc packages.

* Thu Mar 22 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-7mdk
- fixed systematic change to text mode.

* Tue Mar 13 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-6mdk
- modified graphic patch to include mode 0x13 (320x200) and
  true LF interpretation for display.

* Tue Mar  6 2001 Pixel <pixel@mandrakesoft.com> 0.21.7-5mdk
- merge patch from redhat (mainly CCISS)

* Mon Mar 05 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-4mdk
- used new picture by default.

* Thu Mar 01 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-3mdk
- changed graphic patch license to the one used by LILO so BSD.

* Wed Feb 28 2001 François Pons <fpons@mandrakesoft.com> 0.21.7-2mdk
- created graphic patch as in syslinux-graphic but not
  activated by default, use /boot/boot-graphic.b and
  /boot/message-graphic for graphic activation (first sample).

* Mon Feb 26 2001 Pixel <pixel@mandrakesoft.com> 0.21.7-1mdk
- new version

* Wed Jan 24 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 0.21.6.1-2mdk
- Remove argument parsing patch for the new version.

* Tue Jan  2 2001 Pixel <pixel@mandrakesoft.com> 0.21.6.1-1mdk
- new version

* Thu Nov 23 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 0.21.6-5mdk
- Fix argument parsing.

* Tue Nov  7 2000 Pixel <pixel@mandrakesoft.com> 0.21.6-4mdk
- capitalize summary of -doc

* Mon Nov  6 2000 Pixel <pixel@mandrakesoft.com> 0.21.6-3mdk
- fix keytab lilo so that things like "\n" aren't badly remapped (qc-latin1)

* Thu Oct 12 2000 Pixel <pixel@mandrakesoft.com> 0.21.6-2mdk
- fix-segfault-for-floppy-entry.patch

* Tue Oct 10 2000 Pixel <pixel@mandrakesoft.com> 0.21.6-1mdk
- new version

* Fri Sep 29 2000 Pixel <pixel@mandrakesoft.com> 0.21.5.1-4mdk
- fix keytab-lilo so that keycodes > 59 are not taken into account. -> fix the
'.' giving '<' on french keyboard (should not break anything...)

* Mon Sep 25 2000 Pixel <pixel@mandrakesoft.com> 0.21.5.1-3mdk
- merge in redhat's patches
  - fix up "unsafe" <johnsonm@redhat.com>
  - add i2o boot support <johnsonm@redhat.com>
  - patches for Compaqs SA5300 controller <karsten@redhat.de>
  - add bug-fix to not have lilo core-dump on some config files <Florian.LaRoche@redhat.com>
  - work around broken 2.4 kernel headers <pbrown@redhat.com>

* Tue Aug 29 2000 Pixel <pixel@mandrakesoft.com> 0.21.5.1-2mdk
- added requires dev86

* Sun Aug 27 2000 Pixel <pixel@mandrakesoft.com> 0.21.5.1-1mdk
- new version

* Wed Jul 19 2000 Pixel <pixel@mandrakesoft.com> 0.21.5-1mdk
- new version

* Wed Jul 19 2000 Pixel <pixel@mandrakesoft.com> 0.21.4.4-2mdk
- use detectloader in %%post to know wether to call lilo or not
- BM

* Mon Jun 12 2000 Pixel <pixel@mandrakesoft.com> 0.21.4.4-1mdk
- new version

* Mon May  8 2000 Pixel <pixel@mandrakesoft.com> 0.21.4.3-1mdk
- new version (RAID patches)

* Thu Apr 27 2000 Pixel <pixel@mandrakesoft.com> 0.21.4.2-2mdk
- new version

* Sat Mar 25 2000 Pixel <pixel@mandrakesoft.com> 0.21.4-1mdk
- bzip'ed README
- separated postscript doc
- really is 21-4 (serial added)

* Wed Feb 23 2000 Pixel <pixel@mandrakesoft.com> 0.22-19mdk
- Really is 0.22 (non <<official>> version with EDD enabled)
  (EDD means no more 1024 cylinder problem)

* Fri Feb 18 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 0.22-18mdk
- Silly me reuploading and upgrade the ChangeLog.

* Wed Feb 16 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 0.22-17mdk
- Add loopdev and second patch (r).

* Tue Oct 19 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Remove the EBDA patch from zab and put in the EBDA patch
  from the VA Research RPM.  This fixes the EBDA issues.(r)
- Added ONE_SHOT to the compile options so that the lilo
  prompt won't timeout once you hit a key at the boot prompt(r)

* Wed Sep 22 1999 Pixel <pixel@mandrakesoft.com>
- added defattr (no comment)

* Tue Sep 21 1999 Pixel <pixel@mandrakesoft.com>
- patched keytab-lilo.pl (again!) to make it work (better) (changed a regexp)

* Sun Sep 19 1999 Pixel <pixel@mandrakesoft.com>
- added -DONE_SHOT to patch lilo-ebda (that way timeout is disabled as soon as a
  key is pressed)
- patched keytab-lilo.pl to make it work (removed bad suffix .map)

* Sun Aug 22 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>

- Add the patch to boot on Compaq Smart Array 3200.

* Wed Jul 21 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
- recommend manual lilo installation if post fails

* Mon Jul 19 1999 Pablo Saratxaga <pablo@mandrakesoft.com>
- added turkish description

* Mon Jul 19 1999 Thierry Vignaud <tvignaud@mandrakesoft.com>
- Add french description from Gregus <gregus@etudiant.net>

* Wed Jun 23 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Use the ebda patch from VA-Research.

* Thu Jun 10 1999 Bernhard Rosenkraenzer <bero@linux-mandrake.com>
- Use -DIGNORECASE -DVARSETUP -DREWRITE_TABLE -DLCF_LARGE_EBDA
  -DLARGE_EBDA by default. LARGE_EBDA is needed for some SMP systems.

* Mon Apr 12 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Add patch for Mandrake-6.0.
- Add keyab-lilo.pl to the file-list

* Sat Apr 10 1999 Bernhard Rosenkraenzer <bero@linux-mandrake.com>
- Mandrake adaptions
- bzip2 man/info pages
- add de locale
- handle RPM_OPT_FLAGS

* Sun Dec  6 1998 Matt Wilson <msw@redhat.com>
- updated to release 0.21
- patched to build on 2.1.x kernels

* Thu May 07 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Sun Oct 19 1997 Erik Troan <ewt@redhat.com>
- updated to release 0.20
- uses a build root

* Tue Jul 08 1997 Erik Troan <ewt@redhat.com>
- built against glibc
