95 lines
2.8 KiB
RPMSpec
95 lines
2.8 KiB
RPMSpec
%global _hardened_build 1
|
|
|
|
Name: mlocate
|
|
Version: 0.26
|
|
Release: 25
|
|
Summary: Application of finding files by name
|
|
License: GPLv2
|
|
URL: https://pagure.io/mlocate
|
|
Source0: https://releases.pagure.org/mlocate/mlocate-%{version}.tar.xz
|
|
Source1: updatedb.conf
|
|
Source2: mlocate-run-updatedb
|
|
Source3: mlocate-updatedb.service
|
|
Source4: mlocate-updatedb.timer
|
|
|
|
BuildRequires: gcc systemd
|
|
Requires(pre): shadow-utils
|
|
Requires(post): grep sed
|
|
# standard systemd requires
|
|
%{?systemd_requires}
|
|
Provides: bundled(gnulib)
|
|
Obsoletes: slocate <= 2.7-30
|
|
|
|
%description
|
|
mlocate is a locate/updatedb implementation. The 'm' stands for "merging":
|
|
updatedb reuses the existing database to avoid rereading most of the file
|
|
system, which makes updatedb faster and does not trash the system caches as
|
|
much.
|
|
|
|
%package_help
|
|
|
|
%prep
|
|
%autosetup -n %{name}-%{version}
|
|
|
|
%build
|
|
%configure --localstatedir=%{_localstatedir}/lib
|
|
%make_build groupname=slocate
|
|
|
|
%install
|
|
%make_install groupname=slocate
|
|
|
|
mkdir -p %{buildroot}{%{_sysconfdir},/etc/cron.daily}
|
|
install -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/updatedb.conf
|
|
install -D -p -m 750 %{SOURCE2} %{buildroot}%{_libexecdir}/mlocate-run-updatedb
|
|
install -D -p -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/mlocate-updatedb.service
|
|
install -D -p -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/mlocate-updatedb.timer
|
|
|
|
# %%ghost semantics is so stupid
|
|
touch %{buildroot}%{_localstatedir}/lib/mlocate/mlocate.db
|
|
|
|
%find_lang mlocate
|
|
|
|
%pre
|
|
getent group slocate > /dev/null || groupadd -g 21 -r -f slocate
|
|
exit 0
|
|
|
|
%post
|
|
if grep -q '^[^#]*DAILY_UPDATE' %{_sysconfdir}/updatedb.conf; then
|
|
sed -i.rpmsave -e '/DAILY_UPDATE/s/^/#/' %{_sysconfdir}/updatedb.conf
|
|
fi
|
|
%systemd_post mlocate-updatedb.timer
|
|
systemctl start mlocate-updatedb.timer
|
|
|
|
%preun
|
|
%systemd_preun mlocate-updatedb.timer
|
|
|
|
%postun
|
|
%systemd_postun_with_restart mlocate-updatedb.timer
|
|
|
|
%triggerin -- %{name} < 0.26-11
|
|
systemctl start mlocate-updatedb.timer
|
|
|
|
%files -f mlocate.lang
|
|
%doc AUTHORS COPYING NEWS README
|
|
%config(noreplace) %{_sysconfdir}/updatedb.conf
|
|
%attr(2711,root,slocate) %{_bindir}/locate
|
|
%{_bindir}/updatedb
|
|
%{_unitdir}/mlocate-updatedb.service
|
|
%{_unitdir}/mlocate-updatedb.timer
|
|
%{_libexecdir}/mlocate-run-updatedb
|
|
%dir %attr(0750,root,slocate) %{_localstatedir}/lib/mlocate
|
|
%ghost %attr(0640,root,slocate) %{_localstatedir}/lib/mlocate/mlocate.db
|
|
|
|
%files help
|
|
%{_mandir}/man*/*
|
|
|
|
%changelog
|
|
* Sat Sep 5 2020 shixuantong <shixuantong@huawei.com> - 0.26-25
|
|
- update Source0 and URL
|
|
|
|
* Thu Feb 27 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.26-24
|
|
- Solve issue #I1ACCR: updatedb: can not find group 'mlocate'.
|
|
|
|
* Wed Jul 18 2018 openEuler Buildteam <buildteam@openeuler.org> - 0.26-23
|
|
- Package init.
|