]> git.pld-linux.org Git - SPECS.git/blob - rlocate.spec
SPECS updated Tue 30 Apr 15:06:09 CEST 2024
[SPECS.git] / rlocate.spec
1 # TODO
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
5 # - conflicts: rlocate gid with slocate
6 # - pldize initscript
7 #
8 # Conditional build:
9 %bcond_without  kernel          # don't build kernel modules
10 %bcond_without  userspace       # don't build userspace module
11 %bcond_with     verbose         # verbose build (V=1)
12
13 #
14 %define         _rel    0.1
15 Summary:        Finds files on a system via a central database
16 Summary(pl.UTF-8):      Szukanie plików w systemie poprzez centralną bazę danych
17 Name:           rlocate
18 Version:        0.5.6
19 Release:        %{_rel}
20 License:        GPL v2+
21 Group:          Base
22 Source0:        http://downloads.sourceforge.net/rlocate/%{name}-%{version}.tar.gz
23 # Source0-md5:  b834e2b1249fba9138bea29a030de46c
24 Patch0:         %{name}-build.patch
25 Patch1:         %{name}-open.patch
26 URL:            http://rlocate.sourceforge.net/
27 BuildRequires:  autoconf >= 2.50
28 BuildRequires:  automake >= 1:1.7.1
29 %if %{with kernel}
30 BuildRequires:  kernel-module-build >= 3:2.6
31 %endif
32 BuildRequires:  perl-base
33 BuildRequires:  rpmbuild(macros) >= 1.228
34 Requires(post,preun):   /sbin/chkconfig
35 Requires(postun):       /usr/sbin/groupdel
36 Requires(pre):  /usr/bin/getgid
37 Requires(pre):  /usr/sbin/groupadd
38 Requires:       crondaemon
39 Provides:       group(rlocate)
40 Conflicts:      slocate
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 rlocate is an implementation of the locate command that is always
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.
51
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
60 Linuksa 2.6.
61
62 %package -n kernel-misc-%{name}
63 Summary:        rlocate Linux module
64 Summary(pl.UTF-8):      Moduł rlocate dla Linuksa
65 Release:        %{_rel}@%{_kernel_ver_str}
66 Group:          Base/Kernel
67 Requires(post,postun):  /sbin/depmod
68 %requires_releq_kernel
69 Requires(postun):       %releq_kernel
70
71 %description -n kernel-misc-%{name}
72 This package contains rlocate Linux module.
73
74 %description -n kernel-misc-%{name} -l pl.UTF-8
75 Ten pakiet zawiera moduł rlocate dla jądra Linuksa.
76
77 %prep
78 %setup -q
79 %patch0 -p1
80 %patch1 -p1
81
82 %build
83 %if %{with userspace}
84 %{__aclocal} -I m4
85 %{__autoconf}
86 %{__autoheader}
87 %{__automake}
88 %configure \
89         --localstatedir=/var/lib
90
91 %{__make}
92 %endif
93
94 %if %{with kernel}
95 echo "EXTRA_CFLAGS:= -DRL_VERSION=\\\"%{version}\\\" -DRLOCATE_UPDATES" > src/rlocate-module/Makefile
96 echo "obj-m:= rlocate.o" >> src/rlocate-module/Makefile
97
98 %build_kernel_modules -m rlocate -C src/rlocate-module
99 %endif
100
101 %install
102 rm -rf $RPM_BUILD_ROOT
103
104 %if %{with userspace}
105 install -d $RPM_BUILD_ROOT{/dev,/etc/rc.d/init.d,%{_sysconfdir}/%{name}}
106
107 %{__make} install \
108         DESTDIR=$RPM_BUILD_ROOT
109
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
113 %endif
114
115 %if %{with kernel}
116 %install_kernel_modules -m src/rlocate-module/rlocate -d misc
117 %endif
118
119 %clean
120 rm -rf $RPM_BUILD_ROOT
121
122 %pre
123 %groupadd -g 37 rlocate
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
129 /sbin/chkconfig --add %{name}
130 %service %{name} restart
131
132 %preun
133 if [ "$1" = "0" ]; then
134         %service -q %{name} stop
135         /sbin/chkconfig --del %{name}
136 fi
137
138 %postun
139 if [ "$1" = "0" ]; then
140         %groupremove rlocate
141 fi
142
143 %if %{with userspace}
144 %files
145 %defattr(644,root,root,755)
146 %doc AUTHORS ChangeLog README
147 %attr(700,root,root) %dir %{_sysconfdir}/%{name}
148 %attr(600,root,root) %ghost %{_sysconfdir}/%{name}/module.cfg
149 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/updatedb.conf
150 %attr(755,root,root) /etc/cron.daily/rlocate
151 %attr(754,root,root) /etc/rc.d/init.d/rlocate
152
153 %attr(2755,root,rlocate) %{_bindir}/rlocate
154 %attr(2755,root,rlocate) %{_bindir}/rlocate-checkpoint
155 %attr(755,root,root) %{_sbindir}/rlocated
156
157 # symlinks
158 %attr(755,root,root) %{_bindir}/updatedb
159 %attr(755,root,root) %{_bindir}/locate
160
161 %{_mandir}/man1/rlocate.1*
162 %{_mandir}/man1/rlocate-checkpoint.1*
163 %{_mandir}/man1/rlocated.1*
164 %{_mandir}/man1/updatedb.1*
165
166 # FIXME: use udev to get proper major
167 %attr(400,root,root) %dev(c,254,0) /dev/rlocate
168 %dir %attr(750,root,rlocate) /var/lib/rlocate
169 %endif
170
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.094768 seconds and 3 git commands to generate.