plocate/plocate.spec

94 lines
2.8 KiB
RPMSpec
Raw Normal View History

Name: plocate
2021-11-24 08:41:51 +00:00
Version: 1.1.13
2021-09-08 18:12:57 +00:00
Release: %autorelease
Summary: Much faster locate
2021-02-20 12:06:34 +00:00
License: GPLv2+
URL: https://plocate.sesse.net/
2021-06-21 15:30:08 +00:00
Source0: https://plocate.sesse.net/download/plocate-%{version}.tar.gz
2021-02-20 12:06:34 +00:00
Source1: plocate.sysusers
BuildRequires: meson
BuildRequires: gcc-c++
2021-06-21 14:57:49 +00:00
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(liburing)
BuildRequires: pkgconfig(libzstd)
BuildRequires: libatomic
2021-02-20 12:06:34 +00:00
# The plan is to provide both mlocate and plocate for one or two
# Fedora releases, and then retire mlocate when the bugs in plocate
# have been ironed out. Thus, we only allow one or the other to be
# installed.
Conflicts: mlocate
2021-02-20 12:06:34 +00:00
%description
plocate is a locate(1) based on posting lists, giving much faster
searches on a much smaller index. It is a drop-in replacement for
mlocate in nearly all aspects, and is fast on SSDs and non-SSDs alike.
%prep
2021-06-21 15:30:08 +00:00
%autosetup -p1
2021-02-20 12:06:34 +00:00
%build
2021-09-08 18:20:31 +00:00
%meson -Dsystemunitdir=%_unitdir -Dinstall_systemd=true
2021-02-20 12:06:34 +00:00
%meson_build
%install
%meson_install
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/plocate.conf
ln -s plocate %{buildroot}%{_bindir}/locate
2021-02-20 12:06:34 +00:00
# A state file to carry information from %%post to %%posttrans. See
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_saving_state_between_scriptlets.
%global plocate_start_now %{_localstatedir}/lib/rpm-state/plocate_start_now
2021-02-20 12:06:34 +00:00
%pre
%sysusers_create_compat %{SOURCE1}
%post
%systemd_post plocate-updatedb.service plocate-updatedb.timer
if [ $1 == 1 ] && [ -d /run/systemd ]; then
touch %{plocate_start_now} || :
fi
2021-02-20 12:06:34 +00:00
%preun
%systemd_preun plocate-updatedb.service plocate-updatedb.timer
%postun
%systemd_postun_with_restart plocate-updatedb.service plocate-updatedb.timer
%posttrans
# The timer runs once per day. On new installs, let's start both the
# timer and the service immediately in the background, so that the db
# becomes populated. When people install this package onto a running
# system, it's reasonable to assume that they want to use the database.
if [ -f %{plocate_start_now} ]; then
rm %{plocate_start_now} || :
if systemctl is-enabled plocate-updatedb.timer &>/dev/null; then
systemctl start --no-block plocate-updatedb.timer plocate-updatedb.service || :
fi
fi
2021-02-20 12:06:34 +00:00
%files
%license COPYING
%doc README
%attr(02755,-,plocate) %_bindir/plocate
%_bindir/locate
2021-02-20 12:06:34 +00:00
%_sbindir/plocate-build
%_sbindir/updatedb
2021-02-20 12:06:34 +00:00
%_unitdir/plocate-updatedb.service
%_unitdir/plocate-updatedb.timer
%_mandir/man1/plocate.1*
%_mandir/man5/updatedb.conf.5*
%_mandir/man8/plocate-build.8*
%_mandir/man8/updatedb.8*
2021-02-20 12:06:34 +00:00
%_sysusersdir/plocate.conf
%dir %{_sharedstatedir}/plocate
%{_sharedstatedir}/plocate/CACHEDIR.TAG
%ghost %attr(0620,-,plocate) %verify(not md5 mtime) %{_sharedstatedir}/plocate/plocate.db
2021-02-20 12:06:34 +00:00
%changelog
2021-09-08 18:12:57 +00:00
%autochangelog