diff --git a/sys-apps/plocate/files/updatedb.cron b/sys-apps/plocate/files/updatedb.cron new file mode 100644 index 0000000000..c3895afedd --- /dev/null +++ b/sys-apps/plocate/files/updatedb.cron @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/sbin/updatedb diff --git a/sys-apps/plocate/files/updatedb.service b/sys-apps/plocate/files/updatedb.service new file mode 100644 index 0000000000..01af0322b1 --- /dev/null +++ b/sys-apps/plocate/files/updatedb.service @@ -0,0 +1,13 @@ +[Unit] +Description=Update the plocate database +ConditionACPower=true + +[Service] +Type=oneshot +ExecStart=/usr/sbin/updatedb +LimitNOFILE=131072 +IOSchedulingClass=idle + +PrivateTmp=true +PrivateDevices=true +PrivateNetwork=true diff --git a/sys-apps/plocate/files/updatedb.timer b/sys-apps/plocate/files/updatedb.timer new file mode 100644 index 0000000000..1f69330cd2 --- /dev/null +++ b/sys-apps/plocate/files/updatedb.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Update the plocate database daily + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/sys-apps/plocate/plocate-1.1.5.ebuild b/sys-apps/plocate/plocate-1.1.5.ebuild index 6d3fdab794..3c9b1fa0fc 100644 --- a/sys-apps/plocate/plocate-1.1.5.ebuild +++ b/sys-apps/plocate/plocate-1.1.5.ebuild @@ -3,7 +3,7 @@ EAPI=7 -inherit meson +inherit meson systemd if [[ "${PV}" == "9999" ]]; then inherit git-r3 @@ -27,10 +27,18 @@ DEPEND=" src_configure() { local emesonargs=( - -Dinstall_cron=true - -Dinstall_systemd=true + -Dinstall_cron=false + -Dinstall_systemd=false -Dlocategroup=locate ) meson_src_configure } + +src_install() { + meson_src_install + + exeinto /etc/cron.daily/ + newexe "${FILESDIR}"/updatedb.cron plocate + systemd_dounit "${FILESDIR}"/updatedb.{service,timer} +}