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