File preload.spec of Package preload

#
# spec file for package preload (Version 0.2)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           preload
Version:        0.2
Release:        195
Summary:        Preloads Files into System Cache for Faster Booting
License:        GPL v2 or later
Group:          System/Boot
Source0:        preload.tar.bz2
Source1:        %name-rpmlintrc
# svn export http://prefetch.googlecode.com/svn/trunk/ext3remapper
Source3:        ext3remapper-r129.tar.bz2
Patch0:         ext3remapper-r129.diff
Source4:        boot.blktrace
Source5:        stopblktrace
Source6:        bootfaster.diff
Source7:        waitfornm
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  blktrace e2fsprogs-devel update-desktop-files
PreReq:         %fillup_prereq %insserv_prereq
Requires:       cron
Requires(post): blktrace

%description
Preload lists files to load into the system cache. This shortens system
boot time if used correctly.



Authors:
--------
    Robert Love <rml@ximian.com>
    Chris Mason <mason@suse.de>
    Stephan Kulow <coolo@suse.de>
    Michael Matz <matz@suse.de>

%prep
%setup -n preload -a 3
%patch -p0

%build
gcc $RPM_OPT_FLAGS -W -Wall -DUSE_FADVISE -o preload preload.c
gcc $RPM_OPT_FLAGS -W -Wall -o print-bmap print-bmap.c
make -C ext3remapper-r129 "CC=gcc $RPM_OPT_FLAGS"

%install
mkdir -p $RPM_BUILD_ROOT/usr/bin
for prog in e2block2file e2remapblocks preloadblocks; do
   install -m755 ext3remapper-r129/$prog $RPM_BUILD_ROOT%_bindir
done
mkdir -p $RPM_BUILD_ROOT/sbin
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/cron.daily
install -m 755 preload $RPM_BUILD_ROOT/sbin
install -m 755 print-bmap $RPM_BUILD_ROOT/sbin
install -m 755 update_preload $RPM_BUILD_ROOT/usr/bin
install -m 755 bootcache $RPM_BUILD_ROOT/usr/sbin
install -m 755 prepare_preload $RPM_BUILD_ROOT/usr/bin
install -m 755 init.earlyxdm $RPM_BUILD_ROOT/etc/init.d/earlyxdm
install -m 755 %{S:4} $RPM_BUILD_ROOT/etc/init.d/
install -m 755 %{S:5} $RPM_BUILD_ROOT/etc/init.d/
install -m 755 %{S:7} $RPM_BUILD_ROOT/etc/init.d/
mkdir -p $RPM_BUILD_ROOT/etc
cp -a preload.d $RPM_BUILD_ROOT/etc
pushd $RPM_BUILD_ROOT/etc/preload.d
for i in *; do
  sed -i -e 's,lib64,%{_lib},g' $i
done
popd
install -m 755 cron $RPM_BUILD_ROOT/etc/cron.daily/suse.de-update-preload
# empty dir
mkdir -p $RPM_BUILD_ROOT/var/cache/preload
mkdir -p $RPM_BUILD_ROOT/opt/kde3/share/autostart
install -m 644 appspreload.desktop $RPM_BUILD_ROOT/opt/kde3/share/autostart
install -m 755 appspreloader.sh $RPM_BUILD_ROOT/usr/bin
%suse_update_desktop_file -n $RPM_BUILD_ROOT/opt/kde3/share/autostart/appspreload.desktop
cp %{S:6} .

%post
%{fillup_and_insserv -nY preload earlyxdm}
%{fillup_and_insserv -nY preload boot.blktrace}
%{fillup_and_insserv -nY preload stopblktrace}

%postun
%{insserv_cleanup}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%doc bootfaster.diff
/sbin/*
/usr/sbin/*
/usr/bin/*
/etc/cron.daily/suse.de-update-preload
%dir /etc/preload.d
%config /etc/preload.d/*
/etc/init.d/*
/var/cache/preload
/opt/kde3

%changelog
* Wed Oct 22 2008 coolo@suse.de
- fix syntax (bnc#435512)
* Sat Aug 23 2008 aj@suse.de
- Fix init scripts.
- Fix fillup call.
* Tue Aug 12 2008 coolo@suse.de
- now fixing differently for different checks ;(
* Mon Aug 11 2008 coolo@suse.de
- fix rpmlint warnings about init scripts
* Mon May 12 2008 coolo@suse.de
- update the preload lists (bnc#375313)
* Wed Nov 07 2007 coolo@suse.de
- fix nfs mount catch (#333688)
* Fri Nov 02 2007 coolo@suse.de
- adding correct Prereqs
* Fri Sep 21 2007 coolo@suse.de
- removing temporary files from file lists (#309149)
* Tue Sep 11 2007 coolo@suse.de
- make earlyxdm depend on haldaemon, so that we don't get a race condition.
  It's far from optimal (#309171)
* Mon Sep 03 2007 coolo@suse.de
- update preload lists for cursor change (uncommited changes)
- revert the workaround for #302010 now that we have a fix
* Thu Aug 30 2007 aj@suse.de
- Fix waitfornm typo (#305757).
* Sun Aug 26 2007 jblunck@suse.de
- Remove blktrace since this is in a separate package now
* Tue Aug 21 2007 ro@suse.de
- fix typo
* Tue Aug 21 2007 dmueller@suse.de
- readd kbd dependency as a kludge for (#302010)
* Wed Jul 04 2007 coolo@suse.de
- adding experimental support for ext2remapper
* Thu Jun 21 2007 coolo@suse.de
- remove kbd check - it's from the old earlykdm
* Wed Jun 20 2007 coolo@suse.de
- harmonize earlykdm and earlygdm into earlyxdm
* Mon Jun 18 2007 coolo@suse.de
- remove the boot scripts
* Sat Jun 16 2007 coolo@suse.de
- reduce some files
* Thu Jun 14 2007 coolo@suse.de
- update gdm file too
* Fri Apr 20 2007 matz@suse.de
- Fix off-by-one (#260836).
* Fri Apr 20 2007 coolo@suse.de
- update from SVN with updated file lists (#237120)
* Sat Nov 25 2006 olh@suse.de
- boot.preload has no hard requirement for boot.klog
  change insserv dependencies from Required-start to Should-start
  scripts will still get the right ordering that way without
  triggering insserv and rpm post errors.
* Mon Mar 20 2006 matz@suse.de
- Handle fifo gracefully.  (#158734)
- Integrate preload-gnome-session-files.diff into tarball.
* Thu Mar 16 2006 federico@novell.com
- Updated preload-gnome-session-files.diff to preload all the files which
  a GNOME session opens during login.
* Sat Mar 11 2006 federico@novell.com
- Added preload-gnome-session-files.diff with a bunch of files needed
  for a GNOME session.  This reduces cold login time from about 30
  sec. to about 12 sec.
* Thu Feb 09 2006 matz@suse.de
- Accept a cache file, update it via cron.daily if necessary.
* Thu Feb 09 2006 coolo@suse.de
- don't hang on boot in opening stale unix domain sockets
* Tue Feb 07 2006 ro@suse.de
- fix typo in boot.preload (klogd vs klog)
* Tue Feb 07 2006 coolo@suse.de
- avoid loop between boot.localfs and boot.preload_early
* Mon Feb 06 2006 coolo@suse.de
- streamline patches with SVN
- do not wait for update_preload (#117023)
* Thu Feb 02 2006 rodrigo@suse.de
- Added preload-gdm.patch to preload some basic GNOME processes.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Jan 24 2006 aj@suse.de
- boot.coldplug does not exist anymore (#144652).
* Thu Nov 10 2005 rml@suse.de
- Newest SVN snapshot, with gdm config
* Thu Nov 10 2005 coolo@suse.de
- adoption to new fontconfig file names
* Thu Aug 25 2005 matz@suse.de
- Don't be verbose anymore.
* Tue Aug 23 2005 coolo@suse.de
- new lists
* Mon Aug 22 2005 coolo@suse.de
- reworked majorly
* Wed Jan 26 2005 coolo@suse.de
- clean out the lists a bit
* Mon Jan 10 2005 coolo@suse.de
- initial package
openSUSE Build Service is sponsored by