summaryrefslogtreecommitdiff
path: root/sys-apps/plocate
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-03-20 14:27:17 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-03-20 14:27:17 +0000
commit5bb9ff1ee56d2b5e75e01a7f066d8b0cec84ec02 (patch)
tree66e860a5099bcad013f1cf667255dc372a7c11b3 /sys-apps/plocate
parent7218e1b46bceac05841e90472501742d905fb3fc (diff)
gentoo resync : 20.03.2021
Diffstat (limited to 'sys-apps/plocate')
-rw-r--r--sys-apps/plocate/Manifest7
-rw-r--r--sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch21
-rw-r--r--sys-apps/plocate/files/plocate-cron.conf9
-rw-r--r--sys-apps/plocate/files/plocate.cron51
-rw-r--r--sys-apps/plocate/files/updatedb.conf16
-rw-r--r--sys-apps/plocate/metadata.xml33
-rw-r--r--sys-apps/plocate/plocate-1.1.5.ebuild79
7 files changed, 216 insertions, 0 deletions
diff --git a/sys-apps/plocate/Manifest b/sys-apps/plocate/Manifest
new file mode 100644
index 000000000000..820b84039893
--- /dev/null
+++ b/sys-apps/plocate/Manifest
@@ -0,0 +1,7 @@
+AUX plocate-1.1.5-no-systemd-check.patch 764 BLAKE2B f2a97b7c85339e7b7de663e1097e98178913766f88fdcea68b25f3285b14ff8791d668ca2a608ed6bcdf5f9b5b3c2cfedb2e76ad5c674bba03664ee19232e5bb SHA512 440b96a621c9f39f3b9a846342d5dc1d95ef7a8b5253e1c569582bddd6e1a544767996885c5f19a5bcc78cfc48f522f93631c382d2cd360a528141bc8a029aa2
+AUX plocate-cron.conf 237 BLAKE2B 531d6461309b520db31ab8f682ebbe56f2cd425222ebbc16a4662b606f5a0c6c62e4b1475a02ec3f244dde1ff73fe0ad16e0850aec53e6e8836fd0ba1273ad07 SHA512 ab055b052980783b5c63c716d7c12dcb19961a9f990c077e4f8c9bef4ca591bd281ac3941f872659a558a18b81c014dbc0655ff0a1872310670d8efc1d27cb00
+AUX plocate.cron 1392 BLAKE2B 89f7eb05879c0c1a6c30376d36dc469dde0b94df3758ae659012cf9fb6e9fb2783a0d8e53ea5f79d99e2f00be72ef24a254f2d91038a30dc9e19cd2b250782f9 SHA512 b15583e98e253c2fcb658bd9c1c589bacddb8b033eb565333d9f990b1fd320fcfbe1d950657c8b5823d4cb034ccad369bdd2178ef955e42aa9c2f8e8a0268b3f
+AUX updatedb.conf 898 BLAKE2B de832ebc92e103ccaf8923b2eb872ad8e1ef36be2dfaa463a054e3e9fc256102db676ab0568501b695d943fcb74ae6ab01585bf7301cc6aa9ce6d709cc1690b5 SHA512 8b0b32e949636aef46c5439b0c963cc113306cedb1e5c84dbbfa2efba6562ca6dd602fdbfa0b3bc9095b0cf30a619ebb366535406cdb461f20d012ec1af7ff9d
+DIST plocate-1.1.5.tar.gz 69090 BLAKE2B 70b398eb1a5d7b36294188966ef5f46843d9db9f41021a294d88795944412b4ef3819771082955a74a9945296fa14c59461a4ab4af197691f7085a40eeb7f0ef SHA512 6169ea7b3587e12e555a42e0c70e149626810f5e6f9f1f03ca1b069d7892d45bc52cabf072324eaa6f14055943dd680a71642914c0218a770e2b00a22c75efbc
+EBUILD plocate-1.1.5.ebuild 1857 BLAKE2B b90e979dd6f7771a0ef4c481e0563f59208f35ab1032b61a3c9a1998dd987cd5793ab0d6d80110822c85abcbcc117ff12d5a613025e8185d1ec3f09c9aef341e SHA512 ed35405d72cc84b4c5469a681dc03869054ca6ea9b7a8155001b2d13361536375a9985c28caddf689d840ec24f2a497363957be9f9b7e15317531656943d2758
+MISC metadata.xml 1285 BLAKE2B 778c722e0b5e673f97f22f3c60fb2ed5cd1ce18ceb6aec3426049010eaa930a51bb68c2bda2b9a3f471a9737dec406c52fc849cb674df913410868d3c9dd5479 SHA512 f558b515d2dabb31d11ace480ad94c8c2a925c5ffab618930bb3fecc29fb710f7ad3ff253955272930004ca96344950ce5aa743bece0862a3a6c1c1675be22ff
diff --git a/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch b/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch
new file mode 100644
index 000000000000..2635a8007882
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch
@@ -0,0 +1,21 @@
+Unconditionally install systemd unit
+--- a/meson.build
++++ b/meson.build
+@@ -76,17 +76,9 @@
+ configuration: conf_data)
+ install_man(updatedb_conf_man)
+
+-if get_option('install_systemd')
+- systemd = dependency('systemd', required: false)
+- if systemd.found()
+- unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+ updatedb_service = configure_file(input: 'plocate-updatedb.service.in',
+ output: 'plocate-updatedb.service',
+ configuration: conf_data)
+- install_data(updatedb_service, install_dir: unitdir)
+- install_data('plocate-updatedb.timer', install_dir: unitdir)
+- endif
+-endif
+
+ # Requires having TurboPFor checked out, so not built by default.
+ # Unless you have a recent Meson, there's no apparently good way
diff --git a/sys-apps/plocate/files/plocate-cron.conf b/sys-apps/plocate/files/plocate-cron.conf
new file mode 100644
index 000000000000..f207344a9e6c
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-cron.conf
@@ -0,0 +1,9 @@
+# nice value to run at: see -n in nice(1)
+NICE="19"
+
+# ionice class to run at: see -c in ionice(1)
+# you have to install sys-apps/util-linux manually
+IONICE_CLASS="2"
+
+# ionice priority to run at: see -n in ionice(1)
+IONICE_PRIORITY="7"
diff --git a/sys-apps/plocate/files/plocate.cron b/sys-apps/plocate/files/plocate.cron
new file mode 100644
index 000000000000..ebcfcbffe7b0
--- /dev/null
+++ b/sys-apps/plocate/files/plocate.cron
@@ -0,0 +1,51 @@
+#! /bin/sh
+set -e
+
+# check if we run on battery and if so then don't run
+if which on_ac_power >/dev/null 2>&1; then
+ ON_BATTERY=0
+ on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
+ if [ "${ON_BATTERY}" -eq 1 ]; then
+ exit 0
+ fi
+fi
+
+# check if we are already running (lockfile)
+LOCKFILE="/var/lock/plocate.daily.lock"
+if [ -e "${LOCKFILE}" ]; then
+ echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb."
+ exit 1
+fi
+touch "${LOCKFILE}"
+# trap the lockfile only if we really run the updatedb
+trap "rm -f ${LOCKFILE}" EXIT
+
+# source the user specified variables
+if [ -f /etc/plocate-cron.conf ]; then
+ . /etc/plocate-cron.conf
+fi
+
+# check the config file
+NODEVS=""
+if [ ! -f /etc/updatedb.conf ]; then
+ NODEVS=$(awk '$1 == "nodev" && $2 != "rootfs" { print $2 }' /proc/filesystems)
+fi
+
+# alter the priority of the updatedb process
+if [ -x /usr/bin/renice ]; then
+ /usr/bin/renice +${NICE:-19} -p $$ > /dev/null 2>&1
+fi
+if [ -x /usr/bin/ionice ] && /usr/bin/ionice -c3 true 2>/dev/null; then
+ /usr/bin/ionice -c${IONICE_CLASS:-2} -n${IONICE_PRIORITY:-7} -p $$ > /dev/null 2>&1
+fi
+
+# Cleanup old temp files from previous unsuccessful runs
+rm -f /var/lib/plocate/plocate.db.*
+
+# run the updatedb if possible
+if [ -x /usr/sbin/updatedb ]; then
+ /usr/sbin/updatedb -f "${NODEVS}"
+else
+ echo >&2 "Warning: \"/usr/sbin/updatedb\" is not executable, unable to run updatedb."
+ exit 0
+fi
diff --git a/sys-apps/plocate/files/updatedb.conf b/sys-apps/plocate/files/updatedb.conf
new file mode 100644
index 000000000000..6a00d3aa2b94
--- /dev/null
+++ b/sys-apps/plocate/files/updatedb.conf
@@ -0,0 +1,16 @@
+# /etc/updatedb.conf: config file for slocate
+
+# This file sets variables that are used by updatedb.
+# For more info, see the updatedb.conf(5) manpage.
+
+# Filesystems that are pruned from updatedb database
+PRUNEFS="afs anon_inodefs auto autofs bdev binfmt binfmt_misc cgroup cifs coda configfs cramfs cpuset debugfs devfs devpts devtmpfs ecryptfs eventpollfs exofs futexfs ftpfs fuse fusectl gfs gfs2 hostfs hugetlbfs inotifyfs iso9660 jffs2 lustre misc mqueue ncpfs nfs NFS nfs4 nfsd nnpfs ocfs ocfs2 pipefs proc ramfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs spufs sshfs subfs supermount sysfs tmpfs ubifs udf usbfs vboxsf vperfctrfs"
+
+# Paths which are pruned from updatedb database
+PRUNEPATHS="/tmp /var/tmp /var/cache /var/lock /var/run /var/spool"
+
+# Folder names that are pruned from updatedb database
+PRUNENAMES=".git .hg .svn CVS"
+
+# Skip bind mounts.
+PRUNE_BIND_MOUNTS="yes"
diff --git a/sys-apps/plocate/metadata.xml b/sys-apps/plocate/metadata.xml
new file mode 100644
index 000000000000..ffe1b7daa0ad
--- /dev/null
+++ b/sys-apps/plocate/metadata.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>arsen@aarsen.me</email>
+ <name>Arsen Arsenović</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>jeffrey@icurse.nl</email>
+ <name>Jeffrey Lin</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="io-uring">Enable efficient I/O via <pkg>sys-libs/liburing</pkg>.</flag>
+ </use>
+ <longdescription>
+ plocate works by creating an inverted index over trigrams (combinations of
+ three bytes) in the search strings, which allows it to rapidly narrow down the
+ set of candidates to a very small list, instead of linearly scanning through
+ every entry. It does nearly all I/O asynchronously using io_uring if available
+ (Linux 5.1+), which reduces the impact of seek latency on systems without SSDs.
+ Like mlocate and slocate, the returned file set is user-dependent, ie. a user
+ will only see a file if find(1) would list it (all directories from the root
+ have +rx permissions).
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/plocate/plocate-1.1.5.ebuild b/sys-apps/plocate/plocate-1.1.5.ebuild
new file mode 100644
index 000000000000..4aaa46baf9c4
--- /dev/null
+++ b/sys-apps/plocate/plocate-1.1.5.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info meson systemd
+
+DESCRIPTION="Posting locate is a much faster locate"
+HOMEPAGE="https://plocate.sesse.net/"
+SRC_URI="https://plocate.sesse.net/download/${P}.tar.gz"
+
+# GPL-2 for updatedb
+# GPL-2+ for plocate itself
+LICENSE="GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+io-uring"
+
+RDEPEND="
+ acct-group/locate
+ app-arch/zstd:=
+ io-uring? ( sys-libs/liburing:= )
+ !sys-apps/mlocate
+"
+DEPEND="${RDEPEND}"
+
+CONFIG_CHECK="~IO_URING"
+ERROR_IO_URING="required for USE=io-uring"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.5-no-systemd-check.patch
+)
+
+src_prepare() {
+ # Pretend liburing dep doesn't exist when USE flag off
+ if ! use io-uring; then
+ sed -i "s/dependency('liburing/dependency('/" meson.build || die
+ fi
+
+ # We'll install the manpage ourself to locate.1
+ sed -i "/install_man('plocate.1')/d" meson.build || die
+
+ default
+}
+
+src_configure() {
+ local emesonargs=(
+ -Dlocategroup=locate
+ )
+ meson_src_configure
+}
+
+src_install() {
+ meson_src_install
+ dodoc README NEWS
+ newman "${S}"/${PN}.1 locate.1
+ dosym plocate /usr/bin/locate
+
+ insinto /etc
+ doins "${FILESDIR}"/updatedb.conf
+ doins "${FILESDIR}"/plocate-cron.conf
+ fperms 0644 /etc/{updatedb,plocate-cron}.conf
+
+ insinto /etc/cron.daily
+ newins "${FILESDIR}"/plocate.cron plocate
+ fperms 0755 /etc/cron.daily/plocate
+
+ systemd_dounit "${BUILD_DIR}"/${PN}-updatedb.service "${S}"/${PN}-updatedb.timer
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+ elog "The database for the locate command is generated daily by a cron job,"
+ elog "if you install for the first time you can run the updatedb command manually now."
+ elog
+ elog "Note that the ${EROOT}/etc/updatedb.conf file is generic,"
+ elog "please customize it to your system requirements."
+ fi
+}