]>
Commit | Line | Data |
---|---|---|
c343086c | 1 | # TODO |
0a2c45f1 JB |
2 | # - kernel module: doesn't build with Linux 3.x |
3 | # - device: installed with static major, module creates as dynamic => use udev | |
4 | # - should provide something like virtual(locate), obsolete other implementations | |
8cb9253c | 5 | # - conflicts: rlocate gid with slocate |
4e0598bf | 6 | # - pldize initscript |
f047d711 JB |
7 | # |
8 | # Conditional build: | |
6da0c66f | 9 | %bcond_without kernel # don't build kernel modules |
6da0c66f | 10 | %bcond_without userspace # don't build userspace module |
11 | %bcond_with verbose # verbose build (V=1) | |
b89857aa | 12 | |
f047d711 | 13 | # |
f57ebcec | 14 | %define _rel 0.1 |
d26ca6b9 | 15 | Summary: Finds files on a system via a central database |
ce0c9977 | 16 | Summary(pl.UTF-8): Szukanie plików w systemie poprzez centralną bazę danych |
d26ca6b9 | 17 | Name: rlocate |
0a2c45f1 | 18 | Version: 0.5.6 |
8b542a04 | 19 | Release: %{_rel} |
0a2c45f1 | 20 | License: GPL v2+ |
d26ca6b9 | 21 | Group: Base |
0a2c45f1 JB |
22 | Source0: http://downloads.sourceforge.net/rlocate/%{name}-%{version}.tar.gz |
23 | # Source0-md5: b834e2b1249fba9138bea29a030de46c | |
8cb9253c | 24 | Patch0: %{name}-build.patch |
0a2c45f1 | 25 | Patch1: %{name}-open.patch |
3be771a1 | 26 | URL: http://rlocate.sourceforge.net/ |
0a2c45f1 JB |
27 | BuildRequires: autoconf >= 2.50 |
28 | BuildRequires: automake >= 1:1.7.1 | |
29 | %if %{with kernel} | |
f57ebcec | 30 | BuildRequires: kernel-module-build >= 3:2.6 |
f047d711 | 31 | %endif |
09a37f8e | 32 | BuildRequires: perl-base |
ad197e55 | 33 | BuildRequires: rpmbuild(macros) >= 1.228 |
f57ebcec ER |
34 | Requires(post,preun): /sbin/chkconfig |
35 | Requires(postun): /usr/sbin/groupdel | |
d26ca6b9 SP |
36 | Requires(pre): /usr/bin/getgid |
37 | Requires(pre): /usr/sbin/groupadd | |
d26ca6b9 SP |
38 | Requires: crondaemon |
39 | Provides: group(rlocate) | |
24a9c03d | 40 | Conflicts: slocate |
d26ca6b9 SP |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
42 | ||
43 | %description | |
4e0598bf | 44 | rlocate is an implementation of the locate command that is always |
dbe6fb8d SP |
45 | up-to-date. The database that the original locate uses is usually |
46 | updated only once a day, so newer files cannot be located right away. | |
47 | The behavior of rlocate is the same as slocate, but it also maintains | |
48 | a diff database that gets updated whenever a new file is created. This | |
49 | is accomplished with rlocate kernel module and daemon. The rlocate | |
50 | kernel module can be compiled only with Linux 2.6 kernels. | |
d26ca6b9 | 51 | |
aecc10e3 JR |
52 | %description -l pl.UTF-8 |
53 | rlocate to implementacja polecenia locate będąca zawsze aktualna. Baza | |
54 | danych używana przez oryginalne polecenie locate jest zwykle | |
55 | uaktualniana raz dziennie, więc nowszych plików nie można znaleźć w | |
56 | ten sposób. Zachowanie rlocate jest takie samo jak slocate, ale | |
57 | rlocate dodatkowo utrzymuje bazę danych różnic uaktualnianą przy | |
58 | tworzeniu każdego nowego pliku. Jest to osiągnięte przy użyciu modułu | |
59 | jądra i demona rlocate. Moduł jądra można skompilować tylko na jądrach | |
f047d711 JB |
60 | Linuksa 2.6. |
61 | ||
085837cb | 62 | %package -n kernel-misc-%{name} |
f047d711 | 63 | Summary: rlocate Linux module |
ce0c9977 | 64 | Summary(pl.UTF-8): Moduł rlocate dla Linuksa |
085837cb SP |
65 | Release: %{_rel}@%{_kernel_ver_str} |
66 | Group: Base/Kernel | |
67 | Requires(post,postun): /sbin/depmod | |
0a2c45f1 JB |
68 | %requires_releq_kernel |
69 | Requires(postun): %releq_kernel | |
085837cb SP |
70 | |
71 | %description -n kernel-misc-%{name} | |
f047d711 | 72 | This package contains rlocate Linux module. |
085837cb | 73 | |
aecc10e3 JR |
74 | %description -n kernel-misc-%{name} -l pl.UTF-8 |
75 | Ten pakiet zawiera moduł rlocate dla jądra Linuksa. | |
085837cb | 76 | |
d26ca6b9 SP |
77 | %prep |
78 | %setup -q | |
8cb9253c | 79 | %patch0 -p1 |
0a2c45f1 | 80 | %patch1 -p1 |
d26ca6b9 SP |
81 | |
82 | %build | |
83 | %if %{with userspace} | |
8cb9253c ER |
84 | %{__aclocal} -I m4 |
85 | %{__autoconf} | |
86 | %{__autoheader} | |
87 | %{__automake} | |
88 | %configure \ | |
89 | --localstatedir=/var/lib | |
90 | ||
91 | %{__make} | |
d26ca6b9 SP |
92 | %endif |
93 | ||
d26ca6b9 | 94 | %if %{with kernel} |
0a2c45f1 JB |
95 | echo "EXTRA_CFLAGS:= -DRL_VERSION=\\\"%{version}\\\" -DRLOCATE_UPDATES" > src/rlocate-module/Makefile |
96 | echo "obj-m:= rlocate.o" >> src/rlocate-module/Makefile | |
c343086c | 97 | |
0a2c45f1 | 98 | %build_kernel_modules -m rlocate -C src/rlocate-module |
d26ca6b9 SP |
99 | %endif |
100 | ||
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
d26ca6b9 | 104 | %if %{with userspace} |
0a2c45f1 JB |
105 | install -d $RPM_BUILD_ROOT{/dev,/etc/rc.d/init.d,%{_sysconfdir}/%{name}} |
106 | ||
8cb9253c | 107 | %{__make} install \ |
6da0c66f | 108 | DESTDIR=$RPM_BUILD_ROOT |
f047d711 | 109 | |
0a2c45f1 JB |
110 | cp -p contrib/rlocate.redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/rlocate |
111 | cp -p debian/updatedb.conf $RPM_BUILD_ROOT%{_sysconfdir} | |
112 | :> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/module.cfg | |
d26ca6b9 SP |
113 | %endif |
114 | ||
115 | %if %{with kernel} | |
0a2c45f1 | 116 | %install_kernel_modules -m src/rlocate-module/rlocate -d misc |
d26ca6b9 SP |
117 | %endif |
118 | ||
d26ca6b9 SP |
119 | %clean |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %pre | |
1ecbafb2 | 123 | %groupadd -g 37 rlocate |
d26ca6b9 SP |
124 | |
125 | %post | |
126 | if [ ! -f /var/lib/rlocate/rlocate.db ]; then | |
127 | echo 'Run "%{_bindir}/updatedb" if you want to make rlocate database immediately.' | |
128 | fi | |
ee154e7a SP |
129 | /sbin/chkconfig --add %{name} |
130 | %service %{name} restart | |
d26ca6b9 | 131 | |
4e0598bf ER |
132 | %preun |
133 | if [ "$1" = "0" ]; then | |
134 | %service -q %{name} stop | |
135 | /sbin/chkconfig --del %{name} | |
136 | fi | |
137 | ||
d26ca6b9 SP |
138 | %postun |
139 | if [ "$1" = "0" ]; then | |
140 | %groupremove rlocate | |
ad197e55 SP |
141 | fi |
142 | ||
f047d711 | 143 | %if %{with userspace} |
d26ca6b9 SP |
144 | %files |
145 | %defattr(644,root,root,755) | |
0a2c45f1 | 146 | %doc AUTHORS ChangeLog README |
8cb9253c | 147 | %attr(700,root,root) %dir %{_sysconfdir}/%{name} |
0a2c45f1 | 148 | %attr(600,root,root) %ghost %{_sysconfdir}/%{name}/module.cfg |
8cb9253c ER |
149 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/updatedb.conf |
150 | %attr(755,root,root) /etc/cron.daily/rlocate | |
0a2c45f1 | 151 | %attr(754,root,root) /etc/rc.d/init.d/rlocate |
8cb9253c | 152 | |
16f0cbfe | 153 | %attr(2755,root,rlocate) %{_bindir}/rlocate |
8cb9253c | 154 | %attr(2755,root,rlocate) %{_bindir}/rlocate-checkpoint |
0a2c45f1 | 155 | %attr(755,root,root) %{_sbindir}/rlocated |
8cb9253c | 156 | |
b89857aa | 157 | # symlinks |
f57ebcec ER |
158 | %attr(755,root,root) %{_bindir}/updatedb |
159 | %attr(755,root,root) %{_bindir}/locate | |
b89857aa | 160 | |
0a2c45f1 JB |
161 | %{_mandir}/man1/rlocate.1* |
162 | %{_mandir}/man1/rlocate-checkpoint.1* | |
163 | %{_mandir}/man1/rlocated.1* | |
164 | %{_mandir}/man1/updatedb.1* | |
8cb9253c | 165 | |
0a2c45f1 JB |
166 | # FIXME: use udev to get proper major |
167 | %attr(400,root,root) %dev(c,254,0) /dev/rlocate | |
8cb9253c | 168 | %dir %attr(750,root,rlocate) /var/lib/rlocate |
f047d711 | 169 | %endif |
7aa71c10 | 170 | |
0a2c45f1 JB |
171 | %if %{with kernel} |
172 | %files -n kernel-misc-%{name} | |
173 | %defattr(644,root,root,755) | |
174 | /lib/modules/%{_kernel_ver}/misc/rlocate.ko* | |
175 | %endif |