summaryrefslogtreecommitdiff
path: root/core/mlocate/PKGBUILD
blob: 0f2e212e0e11b17e5163b933c8cd9f2410e0d01b (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
# $Id: PKGBUILD 152305 2012-03-06 15:10:37Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: lydgate

pkgname=mlocate
pkgver=0.25
pkgrel=1
pkgdesc="Faster merging drop-in for slocate"
arch=('i686' 'x86_64' 'mips64el')
url="http://carolina.mff.cuni.cz/~trmac/blog/mlocate"
license=('GPL')
conflicts=('slocate')
provides=('slocate')
replaces=('slocate')
depends=('glibc' 'coreutils' 'sh')
backup=('etc/updatedb.conf'
        'etc/cron.daily/updatedb')
install=mlocate.install
source=(https://fedorahosted.org/releases/m/l/mlocate/mlocate-$pkgver.tar.xz
	updatedb.conf
	updatedb.cron.daily)
md5sums=('c6d043b170613b0e327a815b497f680a'
         'c374ff223f2e07b5e602ba22359f2335'
         'cde5da81bebad2de556ef2e43d895e13')

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
  
  # Set up a default updatedb.conf and a daily cronjob
  install -Dm644 ${srcdir}/updatedb.conf $pkgdir/etc/updatedb.conf
  install -Dm744 ${srcdir}/updatedb.cron.daily $pkgdir/etc/cron.daily/updatedb

  # Install Mlocate
  make DESTDIR=$pkgdir install

  ln -sv locate $pkgdir/usr/bin/slocate
  chgrp -v 21 $pkgdir/usr/bin/locate
  chmod -v 2755 $pkgdir/usr/bin/locate

  install -dm755 $pkgdir/var/lib
  install -d -m750 -g21 $pkgdir/var/lib/locate
}