diff --git a/mlocate.spec b/mlocate.spec index c9f5605..62a2559 100644 --- a/mlocate.spec +++ b/mlocate.spec @@ -1,7 +1,7 @@ Summary: An utility for finding files by name Name: mlocate Version: 0.21.1 -Release: 2 +Release: 3 License: GPLv2 URL: https://fedorahosted.org/mlocate/ Group: Applications/System @@ -28,18 +28,18 @@ trash the system caches as much as traditional locate implementations. %setup -q %build -%configure --localstatedir=/var/lib -make groupname=slocate +%configure --localstatedir=%{_localstatedir}/lib +make %{?_smp_mflags} groupname=slocate %install rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT groupname=slocate +make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' groupname=slocate mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.daily} -install -c -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/updatedb.conf -install -c -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/mlocate.cron +install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/updatedb.conf +install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/mlocate.cron # %%ghost semantic is so stupid -touch $RPM_BUILD_ROOT/var/lib/mlocate/mlocate.db +touch $RPM_BUILD_ROOT%{_localstatedir}/lib/mlocate/mlocate.db %find_lang mlocate @@ -47,7 +47,8 @@ touch $RPM_BUILD_ROOT/var/lib/mlocate/mlocate.db rm -rf $RPM_BUILD_ROOT %pre -%{_sbindir}/groupadd -g 21 -r -f slocate +getent group slocate >/dev/null || groupadd -g 21 -r -f slocate +exit 0 %post if /bin/grep -q '^[^#]*DAILY_UPDATE' %{_sysconfdir}/updatedb.conf; then @@ -55,7 +56,8 @@ if /bin/grep -q '^[^#]*DAILY_UPDATE' %{_sysconfdir}/updatedb.conf; then fi %triggerpostun -- slocate <= 2.7-30 -%{_sbindir}/groupadd -g 21 -r -f slocate +getent group slocate >/dev/null || groupadd -g 21 -r -f slocate +exit 0 %files -f mlocate.lang %defattr(-,root,root,-) @@ -65,10 +67,17 @@ fi %attr(2711,root,slocate) %{_bindir}/locate %{_bindir}/updatedb %{_mandir}/man*/* -%dir %attr(0750,root,slocate) /var/lib/mlocate -%ghost /var/lib/mlocate/mlocate.db +%dir %attr(0750,root,slocate) %{_localstatedir}/lib/mlocate +%ghost %{_localstatedir}/lib/mlocate/mlocate.db %changelog +* Mon Jan 12 2009 Miloslav Trmač - 0.21.1-3 +- Merge review fixes, based on a patch by Parag AN: + - Use %%{_localstatedir}/lib instead of hard-coding /var/lib + - Use %%{?_smp_mflags} + - Preserve file time stamps + - Only create the group if it doesn't exist, hide errors from rpm + * Fri Nov 28 2008 Miloslav Trmač - 0.21.1-2 - Add .git to PRUNENAMES Resolves: #473227