]> git.pld-linux.org Git - packages/mlocate.git/commitdiff
- groupadd -g 196
authorSÅ‚awomir Paszkiewicz <paszczus@pld-linux.org>
Thu, 10 Apr 2008 19:45:41 +0000 (19:45 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- proper directory for mlocate.db

Changed files:
    mlocate.spec -> 1.5

mlocate.spec

index 97a6e5af6d6cd987ba0b1c6cf75e3ef3f0b7d841..2fff5dd06af8e7f29fe660801289dec5d7d590fd 100644 (file)
@@ -8,6 +8,9 @@ Source0:        https://fedorahosted.org/mlocate/attachment/wiki/MlocateDownloads/%{nam
 # Source0-md5: ad5e4eb1f2aecf1a5af9fe36c6e297f4
 URL:           https://fedorahosted.org/mlocate/
 BuildRequires: rpmbuild(macros) >= 1.228
+Requires(postun):      /usr/sbin/groupdel
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
 Conflicts:     slocate
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -23,11 +26,13 @@ GNU locate, when it does not conflict with slocate compatibility.
 %setup -q
 
 %build
-%configure
+%configure \
+       --localstatedir=/var/lib
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/var/lib/mlocate
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
@@ -37,6 +42,20 @@ rm -rf $RPM_BUILD_ROOT
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+%groupadd -g 196 mlocate
+
+%post
+if [ ! -f /var/lib/mlocate/mlocate.db ]; then
+       echo 'Run "%{_bindir}/updatedb" if you want to make mlocate database immediately.'
+fi
+
+%postun
+if [ "$1" = "0" ]; then
+       %groupremove mlocate
+fi
+
+
 %files -f %{name}.lang
 %defattr(644,root,root,755)
 %doc ABOUT-NLS AUTHORS ChangeLog NEWS README
@@ -45,3 +64,4 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/*.1*
 %{_mandir}/man5/*.5*
 %{_mandir}/man8/*.8*
+%dir %attr(750,root,mlocate) /var/lib/mlocate
This page took 0.097246 seconds and 4 git commands to generate.