]> git.pld-linux.org Git - packages/mlocate.git/blob - mlocate.spec
Update fedorahosted retirement url to pagure
[packages/mlocate.git] / mlocate.spec
1 # TODO:
2 # - Add
3 #       nodevs=$(awk '$1 == "nodev" && $2 != "rootfs" { print $2 }' /proc/filesystems)
4 #       exec /usr/bin/updatedb -f "$nodevs"
5 #   to ExecStart=/usr/bin/updatedb
6
7 Summary:        A locate/updatedb implementation
8 Summary(pl.UTF-8):      Implementacja locate/updatedb
9 Name:           mlocate
10 Version:        0.26
11 Release:        5
12 License:        GPL v2
13 Group:          Applications/System
14 Source0:        https://releases.pagure.org/mlocate/%{name}-%{version}.tar.xz
15 # Source0-md5:  539e6f86bf387358aa2b14d5f880e49a
16 Source1:        updatedb.conf
17 Source2:        %{name}.cron
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
23 BuildRequires:  xz
24 Requires(postun):       /usr/sbin/groupdel
25 Requires(pre):  /usr/bin/getgid
26 Requires(pre):  /usr/sbin/groupadd
27 Requires:       awk
28 Requires:       rc-scripts >= 0.4.2.4-2
29 Requires:       systemd-units >= 38
30 Suggests:       cronjobs
31 Provides:       group(mlocate)
32 Provides:       locate-utility
33 Obsoletes:      locate-utility
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %description
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.
43
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.
52
53 %prep
54 %setup -q
55
56 %build
57 %configure \
58         --localstatedir=/var/lib
59 %{__make}
60
61 %install
62 rm -rf $RPM_BUILD_ROOT
63 %{__make} install \
64         INSTALL='install -p' \
65         DESTDIR=$RPM_BUILD_ROOT
66
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
71
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
75
76 %find_lang %{name}
77
78 %clean
79 rm -rf $RPM_BUILD_ROOT
80
81 %pre
82 %groupadd -g 196 %{name}
83
84 %post
85 if [ ! -f %{_localstatedir}/lib/%{name}/%{name}.db ]; then
86         echo 'Run "%{_bindir}/updatedb" if you want to make %{name} database immediately.'
87 fi
88 %systemd_post cronjob-%{name}.timer
89
90 %preun
91 %systemd_preun cronjob-%{name}.timer
92
93 %postun
94 if [ "$1" = "0" ]; then
95         %groupremove %{name}
96 fi
97 %systemd_reload
98
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
This page took 0.05898 seconds and 4 git commands to generate.