summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3c2afb6438d4c9bfd611121dcc603e4a0bf01b5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=mlocate-git
pkgver=0.26.r14.gc98bf65
pkgrel=3
pkgdesc="A locate/updatedb implementation"
arch=('i686' 'x86_64')
url="https://pagure.io/mlocate"
license=('GPL2')
depends=('glibc')
makedepends=('git')
provides=("mlocate=$pkgver")
conflicts=('mlocate')
backup=('etc/updatedb.conf')
source=("git+https://pagure.io/mlocate.git"
        "git+https://git.savannah.gnu.org/git/gnulib.git#commit=5861339993f3014cfad1b94fc7fe366fc2573598"
        "sysusers.d::https://gitlab.archlinux.org/archlinux/packaging/packages/mlocate/-/raw/main/sysusers.d"
        "updatedb.conf::https://gitlab.archlinux.org/archlinux/packaging/packages/mlocate/-/raw/main/updatedb.conf"
        "updatedb.service::https://gitlab.archlinux.org/archlinux/packaging/packages/mlocate/-/raw/main/updatedb.service"
        "updatedb.timer::https://gitlab.archlinux.org/archlinux/packaging/packages/mlocate/-/raw/main/updatedb.timer")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')


prepare() {
  cd "mlocate"

  sed -i '/^groupname /s/mlocate/locate/' "Makefile.am"

  "$srcdir/gnulib/gnulib-tool" --import
}

pkgver() {
  cd "mlocate"

  git describe --long --tags | sed 's/^mlocate-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "mlocate"

  autoreconf -fi
  ./configure \
    --prefix="/usr" \
    --localstatedir="/var/lib"
  make
}

check() {
  cd "mlocate"

  #make check
}

package() {
  cd "mlocate"

  make DESTDIR="$pkgdir" install

  chgrp 21 "$pkgdir/var/lib/mlocate"
  chmod 750 "$pkgdir/var/lib/mlocate"

  chgrp 21 "$pkgdir/usr/bin/locate"
  chmod 2755 "$pkgdir/usr/bin/locate"
  ln -s "locate" "$pkgdir/usr/bin/slocate"

  install -dm755 "$pkgdir/var/lib"
  install -dm750 -g21 "$pkgdir/var/lib/locate"

  install -Dm644 "$srcdir/updatedb.conf" -t "$pkgdir/etc"
  install -Dm644 "$srcdir/sysusers.d" "$pkgdir/usr/lib/sysusers.d/locate.conf"
  install -Dm644 "$srcdir/updatedb.timer" -t "$pkgdir/usr/lib/systemd/system"
  install -Dm644 "$srcdir/updatedb.service" -t "$pkgdir/usr/lib/systemd/system"

  install -d "$pkgdir/usr/lib/systemd/system/multi-user.target.wants"
  ln -s "../updatedb.timer" "$pkgdir/usr/lib/systemd/system/multi-user.target.wants/updatedb.timer"
}