]> git.pld-linux.org Git - packages/rlocate.git/blame - rlocate.spec
fix broken uninstall
[packages/rlocate.git] / rlocate.spec
CommitLineData
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 15Summary: Finds files on a system via a central database
ce0c9977 16Summary(pl.UTF-8): Szukanie plików w systemie poprzez centralną bazę danych
d26ca6b9 17Name: rlocate
0a2c45f1 18Version: 0.5.6
8b542a04 19Release: %{_rel}
0a2c45f1 20License: GPL v2+
d26ca6b9 21Group: Base
0a2c45f1
JB
22Source0: http://downloads.sourceforge.net/rlocate/%{name}-%{version}.tar.gz
23# Source0-md5: b834e2b1249fba9138bea29a030de46c
8cb9253c 24Patch0: %{name}-build.patch
0a2c45f1 25Patch1: %{name}-open.patch
3be771a1 26URL: http://rlocate.sourceforge.net/
0a2c45f1
JB
27BuildRequires: autoconf >= 2.50
28BuildRequires: automake >= 1:1.7.1
29%if %{with kernel}
f57ebcec 30BuildRequires: kernel-module-build >= 3:2.6
f047d711 31%endif
09a37f8e 32BuildRequires: perl-base
ad197e55 33BuildRequires: rpmbuild(macros) >= 1.228
f57ebcec
ER
34Requires(post,preun): /sbin/chkconfig
35Requires(postun): /usr/sbin/groupdel
d26ca6b9
SP
36Requires(pre): /usr/bin/getgid
37Requires(pre): /usr/sbin/groupadd
d26ca6b9
SP
38Requires: crondaemon
39Provides: group(rlocate)
24a9c03d 40Conflicts: slocate
d26ca6b9
SP
41BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43%description
4e0598bf 44rlocate is an implementation of the locate command that is always
dbe6fb8d
SP
45up-to-date. The database that the original locate uses is usually
46updated only once a day, so newer files cannot be located right away.
47The behavior of rlocate is the same as slocate, but it also maintains
48a diff database that gets updated whenever a new file is created. This
49is accomplished with rlocate kernel module and daemon. The rlocate
50kernel module can be compiled only with Linux 2.6 kernels.
d26ca6b9 51
aecc10e3
JR
52%description -l pl.UTF-8
53rlocate to implementacja polecenia locate będąca zawsze aktualna. Baza
54danych używana przez oryginalne polecenie locate jest zwykle
55uaktualniana raz dziennie, więc nowszych plików nie można znaleźć w
56ten sposób. Zachowanie rlocate jest takie samo jak slocate, ale
57rlocate dodatkowo utrzymuje bazę danych różnic uaktualnianą przy
58tworzeniu każdego nowego pliku. Jest to osiągnięte przy użyciu modułu
59jądra i demona rlocate. Moduł jądra można skompilować tylko na jądrach
f047d711
JB
60Linuksa 2.6.
61
085837cb 62%package -n kernel-misc-%{name}
f047d711 63Summary: rlocate Linux module
ce0c9977 64Summary(pl.UTF-8): Moduł rlocate dla Linuksa
085837cb
SP
65Release: %{_rel}@%{_kernel_ver_str}
66Group: Base/Kernel
67Requires(post,postun): /sbin/depmod
0a2c45f1
JB
68%requires_releq_kernel
69Requires(postun): %releq_kernel
085837cb
SP
70
71%description -n kernel-misc-%{name}
f047d711 72This package contains rlocate Linux module.
085837cb 73
aecc10e3
JR
74%description -n kernel-misc-%{name} -l pl.UTF-8
75Ten 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
95echo "EXTRA_CFLAGS:= -DRL_VERSION=\\\"%{version}\\\" -DRLOCATE_UPDATES" > src/rlocate-module/Makefile
96echo "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
102rm -rf $RPM_BUILD_ROOT
103
d26ca6b9 104%if %{with userspace}
0a2c45f1
JB
105install -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
110cp -p contrib/rlocate.redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/rlocate
111cp -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
120rm -rf $RPM_BUILD_ROOT
121
122%pre
1ecbafb2 123%groupadd -g 37 rlocate
d26ca6b9
SP
124
125%post
126if [ ! -f /var/lib/rlocate/rlocate.db ]; then
127 echo 'Run "%{_bindir}/updatedb" if you want to make rlocate database immediately.'
128fi
ee154e7a
SP
129/sbin/chkconfig --add %{name}
130%service %{name} restart
d26ca6b9 131
4e0598bf
ER
132%preun
133if [ "$1" = "0" ]; then
134 %service -q %{name} stop
135 /sbin/chkconfig --del %{name}
136fi
137
d26ca6b9
SP
138%postun
139if [ "$1" = "0" ]; then
140 %groupremove rlocate
ad197e55
SP
141fi
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
This page took 0.104274 seconds and 4 git commands to generate.