Name plocate
Description Alternative to locate, faster and compatible with mlocate's database.
Version 1.1.24-1
Package Base plocate
Homepage https://plocate.sesse.net
Maintainers ['Morten Linderud <foxboron@archlinux.org>']
Contributors ['Hans-Nikolai Viessmann <hans AT viess DOT mn>']
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/plocate
Sources ['https://plocate.sesse.net/download/plocate-1.1.24.tar.gz', 'plocate-fix-updatedb.timer.patch', 'plocate.sysusers', 'plocate.tmpfiles', 'updatedb.conf']
Dependencies ['liburing', 'systemd', 'zstd']
Optional-Dependencies []
Build-Dependencies ['meson']
Provides ['mlocate', 'locate']
Builddate 14-01-2026 18:55:53
Architecture x86_64
Distro-Version
Licenses ['GPL-2.0-only', 'GPL-2.0-or-later']
Hash 95733c80fccacb18b6794e31cda02435dc4c0923717e5d86d58b93515e3f9772
# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Hans-Nikolai Viessmann <hans AT viess DOT mn>

pkgname=plocate
pkgver=1.1.24
pkgrel=1
pkgdesc="Alternative to locate, faster and compatible with mlocate's database."
arch=('x86_64')
url="https://plocate.sesse.net"
license=('GPL-2.0-or-later' 'GPL-2.0-only')
depends=('zstd' 'liburing' 'systemd')
makedepends=('meson')
conflicts=('mlocate')
provides=('mlocate' 'locate')
replaces=('mlocate')
backup=('etc/updatedb.conf')
source=("${url}/download/${pkgname}-${pkgver}.tar.gz"
        'plocate-fix-updatedb.timer.patch'
        'plocate.sysusers'
        'plocate.tmpfiles'
        'updatedb.conf')
sha256sums=('e55a757af1d7efb15ea674993224da4f0258479f8f720bd3dae0925d27dc04a2'
            'f519c901e2fb4195e25025a745db41c4167156be698738b198cbd5651cd9d9e6'
            '1713a8fc8b81f4a390bf8597c4c0e917474379002dcc984aad2f44218d10c82a'
            'adda399ac42f0faa002caab5bf932777c0006ae7c4387add859c9f77321b4202'
            'd00796741e2194032d0185b40de70ff5c8a11fda416a70434eb0aa2020981f91')

prepare() {
    cd $pkgname-$pkgver
    patch -Np1 < "$srcdir/plocate-fix-updatedb.timer.patch"
}

build() {
    cd $pkgname-$pkgver
    arch-meson \
        -Dinstall_cron=false \
        -Dinstall_systemd=true\
        -Dlocategroup=locate \
        ../build
    meson compile -C ../build
}

package() {
    cd $pkgname-$pkgver
    DESTDIR="$pkgdir" meson install -C ../build

    chgrp 21 "${pkgdir}/usr/bin/plocate"
    chmod 2755 "${pkgdir}/usr/bin/plocate"

    install -Dm644 ../plocate.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/plocate.conf"
    install -Dm644 ../plocate.sysusers "$pkgdir/usr/lib/sysusers.d/plocate.conf"
    install -Dm644 ../updatedb.conf "${pkgdir}/etc/updatedb.conf"
    ln -sf /usr/bin/plocate "$pkgdir/usr/bin/mlocate"
    ln -sf /usr/bin/plocate "$pkgdir/usr/bin/locate"
    ln -sf /usr/share/man/man1/locate.1.gz "$pkgdir/usr/share/man/man1/plocate.1.gz"

    install -d "${pkgdir}/usr/lib/systemd/system/timers.target.wants"
    ln -s ../plocate-updatedb.timer "${pkgdir}/usr/lib/systemd/system/timers.target.wants/plocate-updatedb.timer"
}