Summary:     Finds files on a system via a central database.
Summary(ja): システム上のファイルをデータベースを使って検索します
Name: slocate
Version: 2.7
Release: 24%{?_dist_release}
License: GPL
Group: Applications/System
Source0: http://ftp.debian.org/debian/pool/main/s/slocate/slocate_2.7-4.tar.gz
Source1: slocate.cron
Source2: updatedb.conf
Source3: updatedb.conf.5
Patch0: slocate-2.7-4.info.patch
Patch1: slocate-wht.patch
Patch2: slocate-2.6-manpage.patch
Patch3: slocate-2.7-fts.patch
Patch4: slocate-2.7-lazy-mtab.patch
Patch5: slocate-2.7-4.autofoo.patch
Patch6: slocate-2.7-4.bounds.patch
Patch7: slocate-2.7-4.config.patch
BuildRequires: gzip
Prereq: shadow-utils
Buildroot: %{_tmppath}/%{name}-%{version}-root


%description
Slocate is a security-enhanced version of locate. Just like locate,
slocate searches through a central database (which is updated nightly)
for files which match a given pattern. Slocate allows you to quickly
find files anywhere on your system.

%description -l ja
slocate は locate のセキュリティ対策バージョンです．locate と同様に，
slocate は (毎晩自動更新される) データベースを元に，指定したパターンに
マッチするファイルを検索します．slocate を使って，システム上のどこにある
ファイルでも高速に探し出すことが出来ます．


%prep
%setup -q
%patch0 -p1 -b .info
%patch1 -p1 -b .wht
# *sigh*
gunzip doc/*.gz
%patch2 -p1 -b .manpage
%patch3 -p1 -b .fts
%patch4 -p1 -b .lazy
%patch5 -p1 -b .autofoo
%patch6 -p1 -b .bounds
%patch7 -p1 -b .config

%build
autoreconf -f -i
CFLAGS="$RPM_OPT_FLAGS -fsigned-char -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64" %configure
make


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man{1,5}}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily
mkdir -p $RPM_BUILD_ROOT/var/lib/slocate
install slocate $RPM_BUILD_ROOT%{_bindir}
ln -sf slocate $RPM_BUILD_ROOT%{_bindir}/locate
ln -sf slocate $RPM_BUILD_ROOT%{_bindir}/updatedb
install doc/slocate.1.linux $RPM_BUILD_ROOT%{_mandir}/man1/slocate.1
install doc/updatedb.1 $RPM_BUILD_ROOT%{_mandir}/man1
ln -sf slocate.1 $RPM_BUILD_ROOT%{_mandir}/man1/locate.1
install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily
install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
install %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man5


%clean
rm -rf $RPM_BUILD_ROOT


%pre
/usr/sbin/groupadd -g 21 -r -f slocate


%preun
if [ "$1" = "0" ]; then 
  /usr/sbin/groupdel slocate
  rm -f /var/lib/slocate/slocate.db
fi


%files
%defattr(-,root,root)
%doc ChangeLog INSTALL README LICENSE MIRRORS
%attr(2755,root,slocate) %{_bindir}/slocate
%attr(-,root,slocate) %{_bindir}/locate
%attr(-,root,slocate) %{_bindir}/updatedb
%attr(644,root,root) %{_mandir}/man[15]/*
%attr(755,root,root) %{_sysconfdir}/cron.daily/slocate.cron
%attr(644,root,root) %config %{_sysconfdir}/updatedb.conf
%dir %attr(750,root,slocate) /var/lib/slocate


%changelog
* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 2.7-24vl5
- applied new versioning policy, spec in utf-8

* Sun Sep 10 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.7-24vl2
- changed Group to Applications/System

* Tue Aug 02 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.7-24vl1
- added Patches based on Fedora development
  * Tue Jun 21 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-24
  - Add missing OOM handling to lazy-mtab.patch
  * Sun May  1 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-23
  - Remove "nodev" filesystems from PRUNEFS
  * Sat Apr 16 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-22
  - Point the user at updatedb.conf if the database is too old
  * Sat Apr 16 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-21
  - Don't assume paths in /etc/mtab don't contain symlinks (#139950, #110575)
  - Use %%config(noreplace) for /etc/updatedb.conf (#155014)
  * Sun Apr  3 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-20
  - Don't run updatedb by default
  * Tue Mar 29 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-19
  - Add updatedb.conf(5) (#135952)
  * Mon Mar 28 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-18
  - Drop unnecessary BuildRequires: autoconf
  - Remove /mnt/floppy from PRUNEPATHS, it's in /media now
  * Fri Mar 25 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-17
  - Update to debian slocate_2.7-4 (#151710)
  - Fix comment parsing in /etc/updatedb.conf (#135952)
  - Exclude /var/spool/squid and /var/spool/cups (#150388)
  - Remove 'export' lines from /etc/updatedb.conf to avoid the false impression
    that the file is a shell script
  * Fri Mar  4 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-16
  - Fix crash when no filesystems are pruned
  - Rebuild with gcc 4
  * Tue Feb 16 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-15
  - Fix slocate-2.7-fts.patch
  - Automatically prune all nodev filesystems, remove those entries from 
    PRUNEFS (#123914)
  * Tue Feb 15 2005 Miloslav Trmac <mitr@redhat.com> - 2.7-14
  - Process the filesystem type exclusion list when finding the mount points,
    not only before starting the filesystem tree walk (#139950)
  - Clean up the spec file (#135192, original patch by Robert Scheck)
  * Wed Nov  3 2004 Thomas Woerner <twoerner@redhat.com> 2.7-13
  - added /media to PRUNEPATHS
  * Wed Oct 20 2004 Thomas Woerner <twoerner@redhat.com> 2.7-12
  - added /mnt/floppy to PRUNEPATHS
  * Fri May 21 2004 Bill Nottingham <notting@redhat.com> 2.7-10
  - exclude cifs (#122499)
  * Fri Apr 16 2004 Karsten Hopp <karsten@redhat.de> 2.7-9 
  - exlude usbdevfs (#113816)
  * Mon Mar 29 2004 Karsten Hopp <karsten@redhat.de> 2.7-8 
  - use included sl_fts.h, fix handling of large files (#105950)
  - use one single file to configure updatedb (#112964)

* Sun Feb 08 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.7-5vl1
- updated 2.7 and added patch6 from Fedora 2.7-5
  * Wed Jan 21 2004 Mark Cox <mjc@redhat.com>
  - drop privs for non slocate gid databases (CAN-2003-0848)

* Mon Oct 20 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.6-10vl1
- rebuild with new toolchains
- s/Copyright/License/
- based on Redhat Rawhide 2.6-10

* Sat Jan 26 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.5-1vl3
- fixed spec typo to install gzipped man page correctly

* Mon Sep 03 2001 Toru Sagami <sagami@vinelinux.org>
- 2.5-1vl2
- place /var/lib in absolute without using %%_localstatedir macros

* Sun Jan 14 2001 Tomoya TAKA <tomoya@olive.plala.or.jp> 2.5-1vl1
- based on 2.5-1 from Rawhide
- rebuilt for Vine Linux
- use better macros
- added Japanese summary and description

* Fri Jan  6 2001 Bill Nottingham <notting@redhat.com>
- update to 2.5

* Mon Dec 18 2000 Bill Nottingham <notting@redhat.com>
- update to the mysterious 2.4 release

* Mon Nov 27 2000 Bill Nottingham <notting@redhat.com>
- update to 2.3; fixes database reading problem

* Wed Aug 23 2000 Than Ngo <than@redhat.com>
- add a default updatedb.conf (Bug #13475)

* Wed Aug 23 2000 Jakub Jelinek <jakub@redhat.com>
- fix build with glibc defining DT_WHT but not defining S_IFWHT.

* Sun Jul 23 2000 Nalin Dahyabhai <nalin@redhat.com>
- don't print a message telling how to rebuild the database if we're
  rebuilding the database

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Thu Jun 22 2000 Bill Nottingham <notting@redhat.com>
- update to 2.2
- fix it to not have debugging (oops)

* Sat Jun 10 2000 Bill Nottingham <notting@redhat.com>
- rebuild, FHS manpages, etc.

* Sun Mar 26 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- simplify preun

* Fri Mar 17 2000 Bill Nottingham <notting@redhat.com>
- fix a segfault

* Thu Feb  3 2000 Bill Nottingham <notting@redhat.com>
- handle compressed man pages

* Tue Oct 21 1999 Bill Nottingham <notting@redhat.com>
- update to 2.1

* Mon Oct 18 1999 Bill Nottingham <notting@redhat.com>
- fix a bug that was causing segfaults.

* Mon Sep 20 1999 Bill Nottingham <notting@redhat.com>
- remove group database on final uninstall

* Fri Sep 10 1999 Bill Nottingham <notting@redhat.com>
- add a note about creating the database if opening of it fails.

* Tue Jul  6 1999 Bill Nottingham <notting@redhat.com>
- update to 2.0
- use new -f (filesystem type) option to simplify cron script
- link updatedb back to slocate to allow parsing of updatedb.conf
  config files

* Mon Jun 14 1999 Bill Nottingham <notting@redhat.com>
- don't exclude VFAT partitions
- add some docs

* Tue Jun  1 1999 Jeff Johnson <jbj@redhat.com>
- update to 1.6.
- use /etc/cron.daily as /usr/bin/updatedb to more perfectly imitate the
  findutils updatedb.
- exclude vfat partitions too (#3164).

* Tue May 11 1999 Bill Nottingham <notting@redhat.com>
- update to 1.5
- make database dir 0750

* Mon Apr 19 1999 Bill Nottingham <notting@redhat.com>
- fix updatedb cron script

* Mon Apr 12 1999 Bill Nottingham <notting@redhat.com>
- add updatedb as a link to slocate
- add an updatedb man page

* Fri Mar 26 1999 Michael Maher <mike@redhat.com>
- added man page

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 3)

* Mon Feb 15 1999 Bill Nottingham <notting@redhat.com>
- %post groupadd changed to %pre 
