3 # nodevs=$(awk '$1 == "nodev" && $2 != "rootfs" { print $2 }' /proc/filesystems)
4 # exec /usr/bin/updatedb -f "$nodevs"
5 # to ExecStart=/usr/bin/updatedb
7 Summary: A locate/updatedb implementation
8 Summary(pl.UTF-8): Implementacja locate/updatedb
13 Group: Applications/System
14 Source0: https://releases.pagure.org/mlocate/%{name}-%{version}.tar.xz
15 # Source0-md5: 539e6f86bf387358aa2b14d5f880e49a
16 Source1: updatedb.conf
18 Source3: cronjob-%{name}.timer
19 Source4: cronjob-%{name}.service
20 URL: https://pagure.io/mlocate
21 BuildRequires: rpmbuild(macros) >= 1.228
22 BuildRequires: tar >= 1:1.22
24 Requires(postun): /usr/sbin/groupdel
25 Requires(pre): /usr/bin/getgid
26 Requires(pre): /usr/sbin/groupadd
28 Requires: rc-scripts >= 0.4.2.4-2
29 Requires: systemd-units >= 38
31 Provides: group(mlocate)
32 Provides: locate-utility
33 Obsoletes: locate-utility
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 mlocate is a new locate implementation. The "m" stands for "merging",
38 because updatedb reuses the existing database to avoid rereading most
39 of the file system, which makes updatedb faster and does not trash the
40 system caches as much. The locate(1) utility is intended to be
41 completely compatible to slocate. It also attempts to be compatible to
42 GNU locate, when it does not conflict with slocate compatibility.
44 %description -l pl.UTF-8
45 mlocate to nowa implementacja locate. "m" oznacza "merging" (łącząca),
46 ponieważ updatedb wykorzystuje istniejącą bazę aby zapobiec ponownemu
47 odczytywaniu większości systemu plików, dzięki czemu updatedb działa
48 szybciej i nie czyści tak bardzo buforów systemowych. Narzędzie
49 locate(1) powinno być w pełni kompatybilne z slocate. Próbuje być
50 kompatybilne także z GNU locate, o ile nie jest to w konflikcie z
51 kompatybilnością z slocate.
58 --localstatedir=/var/lib
62 rm -rf $RPM_BUILD_ROOT
64 INSTALL='install -p' \
65 DESTDIR=$RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.daily}
68 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/updatedb.conf
69 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/%{name}
70 touch $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/%{name}.db
72 install -d $RPM_BUILD_ROOT%{systemdunitdir}
73 install -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.timer
74 install -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-%{name}.service
79 rm -rf $RPM_BUILD_ROOT
82 %groupadd -g 196 %{name}
85 if [ ! -f %{_localstatedir}/lib/%{name}/%{name}.db ]; then
86 echo 'Run "%{_bindir}/updatedb" if you want to make %{name} database immediately.'
88 %systemd_post cronjob-%{name}.timer
91 %systemd_preun cronjob-%{name}.timer
94 if [ "$1" = "0" ]; then
99 %files -f %{name}.lang
100 %defattr(644,root,root,755)
101 %doc AUTHORS ChangeLog NEWS README
102 %attr(755,root,root) /etc/cron.daily/%{name}
103 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/updatedb.conf
104 %attr(2755,root,mlocate) %{_bindir}/locate
105 %attr(755,root,root) %{_bindir}/updatedb
106 %{_mandir}/man1/locate.1*
107 %{_mandir}/man5/%{name}.db.5*
108 %{_mandir}/man5/updatedb.conf.5*
109 %{_mandir}/man8/updatedb.8*
110 %dir %attr(750,root,mlocate) /var/lib/%{name}
111 %ghost %{_localstatedir}/lib/%{name}/%{name}.db
112 %{systemdunitdir}/cronjob-%{name}.service
113 %{systemdunitdir}/cronjob-%{name}.timer