summaryrefslogtreecommitdiffstats
path: root/testing/mlocate/APKBUILD
blob: f23c4657895668a1e8dcbd481020d54f5824d14e (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
# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>

pkgname=mlocate
pkgver=0.25
pkgrel=0
pkgdesc='An utility to index and quickly search for files by name'
url='https://fedorahosted.org/mlocate/'
arch='all'
license='GPL'
install="$pkgname.pre-install"
makedepends='uclibc-dev sed'
subpackages="$pkgname-doc"
source="https://fedorahosted.org/releases/m/l/mlocate/mlocate-$pkgver.tar.xz
        updatedb.conf
        updatedb.cron.daily"

build() {
    cd $srcdir/$pkgname-$pkgver

    sed -i '/^groupname /s/mlocate/locate/' Makefile.in
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib
    make
}

check() {
    cd $srcdir/$pkgname-$pkgver
    make check
}

package() {
    cd $srcdir/$pkgname-$pkgver

    make DESTDIR=$pkgdir install

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

    install -dm755 $pkgdir/var/lib
    install -dm750 -g locate $pkgdir/var/lib/locate

    install -Dm644 ${srcdir}/updatedb.conf $pkgdir/etc/updatedb.conf
    install -Dm744 ${srcdir}/updatedb.cron.daily $pkgdir/etc/cron.daily/updatedb
}

md5sums="c6d043b170613b0e327a815b497f680a  mlocate-0.25.tar.xz
465315bfa3380a23fae9a383270cb2ec  updatedb.conf
cde5da81bebad2de556ef2e43d895e13  updatedb.cron.daily"