diff --git a/.cvsignore b/.cvsignore index e69de29..59ad5d4 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +mlocate-0.11.tar.gz diff --git a/mlocate.cron b/mlocate.cron new file mode 100644 index 0000000..871845e --- /dev/null +++ b/mlocate.cron @@ -0,0 +1,4 @@ +#!/bin/sh +nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print $2 }') +renice +19 -p $$ >/dev/null 2>&1 +/usr/bin/updatedb -f "$nodevs" diff --git a/mlocate.spec b/mlocate.spec new file mode 100644 index 0000000..9218404 --- /dev/null +++ b/mlocate.spec @@ -0,0 +1,71 @@ +Summary: An utility for finding files by name +Name: mlocate +Version: 0.11 +Release: 1 +License: GPLv2 +Group: Applications/System +Source0: %{name}-%{version}.tar.gz +Source1: updatedb.conf +Source2: mlocate.cron +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +Requires(pre,triggerpostun): shadow-utils +Obsoletes: slocate <= 2.7-30 +Provides: slocate + +%description +mlocate is a locate/updatedb implementation. It keeps a database of +all existing files and allows you to lookup files by name. + +The 'm' stands for "merging": updatedb reuses the existing database to avoid +rereading most of the file system, which makes updatedb faster and does not +trash the system caches as much as traditional locate implementations. + +%prep +%setup -q + +%build +%configure --localstatedir=/var/lib +make groupname=slocate + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT groupname=slocate + +mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.daily} +install -c -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/updatedb.conf +install -c -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/mlocate.cron +# %%ghost semantic is so stupid +touch $RPM_BUILD_ROOT/var/lib/mlocate/mlocate.db + +%find_lang mlocate + +%clean +rm -rf $RPM_BUILD_ROOT + +%pre +%{_sbindir}/groupadd -g 21 -r -f slocate + +%triggerpostun -- slocate <= 2.7-30 +%{_sbindir}/groupadd -g 21 -r -f slocate + +%files -f mlocate.lang +%defattr(-,root,root,-) +%doc AUTHORS COPYING README +/etc/cron.daily/mlocate.cron +%config(noreplace) %{_sysconfdir}/updatedb.conf +%attr(2711,root,slocate) %{_bindir}/locate +%{_bindir}/updatedb +%{_mandir}/man*/* +%dir %attr(0750,root,slocate) /var/lib/mlocate +%ghost /var/lib/mlocate/mlocate.db + +%changelog +* Thu Nov 10 2005 Miloslav Trmac - 0.11-1 +- Update to mlocate-0.11 +- Add scriptlets to create group slocate + +* Thu Jul 28 2005 Miloslav Trmac - 0.10-0.testing.1 +- Update to mlocate-0.10 + +* Thu Jul 28 2005 Miloslav Trmac - 0.09-0.testing.1 +- Initial build. diff --git a/sources b/sources index e69de29..fd3e5cb 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +6be17e300c604cdf26698e3a37d1cbf4 mlocate-0.11.tar.gz diff --git a/updatedb.conf b/updatedb.conf new file mode 100644 index 0000000..5baa025 --- /dev/null +++ b/updatedb.conf @@ -0,0 +1,2 @@ +PRUNEFS = "auto afs iso9660 sfs udf" +PRUNEPATHS = "/afs /media /net /sfs /tmp /udev /var/spool/cups /var/spool/squid /var/tmp"