1 # Maintainer: Gaetan Bisson <bisson@archlinux.org>
2 # Contributor: Allan McRae <allan@archlinux.org>
6 pkgver=0.26.git.20170220
7 _commit=c98bf6595703456558a6f9c163c746cdaa9e591f
9 pkgdesc='Merging locate/updatedb implementation'
10 url='https://pagure.io/mlocate'
13 backup=('etc/updatedb.conf')
16 install=mlocate.install
17 source=("git+https://pagure.io/mlocate.git#commit=$_commit"
18 'git+https://git.savannah.gnu.org/git/gnulib.git#commit=5861339993f3014cfad1b94fc7fe366fc2573598'
25 '1713a8fc8b81f4a390bf8597c4c0e917474379002dcc984aad2f44218d10c82a'
26 'd00796741e2194032d0185b40de70ff5c8a11fda416a70434eb0aa2020981f91'
27 '94520117a4a2e16b5f2311c406904369d72690b8998c39ee4cf758009fdddbcb'
28 'af0db83e34ffd0325101042760d4a5e3bccacbc3a0ef42c997e42507bf4ba6a3')
31 cd "${srcdir}/${pkgname}"
32 sed -i '/^groupname /s/mlocate/locate/' Makefile.am
33 ../gnulib/gnulib-tool --import # See file: ./HACKING
38 cd "${srcdir}/${pkgname}"
39 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib
44 cd "${srcdir}/${pkgname}"
49 cd "${srcdir}/${pkgname}"
51 make DESTDIR="${pkgdir}" install
53 # fix group and permissions of /var/lib/mlocate; the Makefile does not
54 # do this because it uses a group name instead of a group id and fails
55 # https://lists.archlinux.org/pipermail/arch-general/2018-June/045165.html
56 chgrp 21 "${pkgdir}/var/lib/mlocate"
57 chmod 750 "${pkgdir}/var/lib/mlocate"
59 chgrp 21 "${pkgdir}/usr/bin/locate"
60 chmod 2755 "${pkgdir}/usr/bin/locate"
61 ln -s locate "${pkgdir}/usr/bin/slocate"
63 install -dm755 "${pkgdir}/var/lib"
64 install -dm750 -g21 "${pkgdir}/var/lib/locate"
66 install -Dm644 ../updatedb.conf "${pkgdir}/etc/updatedb.conf"
67 install -Dm644 ../sysusers.d "${pkgdir}/usr/lib/sysusers.d/locate.conf"
68 install -Dm644 ../updatedb.timer "${pkgdir}/usr/lib/systemd/system/updatedb.timer"
69 install -Dm644 ../updatedb.service "${pkgdir}/usr/lib/systemd/system/updatedb.service"
71 install -d "${pkgdir}/usr/lib/systemd/system/timers.target.wants"
72 ln -s ../updatedb.timer "${pkgdir}/usr/lib/systemd/system/timers.target.wants/updatedb.timer"