加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mlocate.spec 2.77 KB
一键复制 编辑 原始数据 按行查看 历史
桐小哥 提交于 2020-09-05 15:14 . update Source0 and URL
%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.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化