summaryrefslogtreecommitdiff
path: root/core/mlocate/PKGBUILD
blob: b46a7afdb2bdcda2c28467758c183c2fb8c6d555 (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
# $Id: PKGBUILD 210562 2014-04-14 22:14:39Z thomas $
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: lydgate

pkgname=mlocate
pkgver=0.26
pkgrel=3
pkgdesc='Merging locate/updatedb implementation'
url='https://fedorahosted.org/mlocate/'
arch=('i686' 'x86_64')
license=('GPL')
backup=('etc/updatedb.conf')
depends=('glibc')
source=("https://fedorahosted.org/releases/m/l/mlocate/mlocate-${pkgver}.tar.xz"
	'updatedb.conf'
	updatedb.{timer,service})
sha1sums=('c6e6d81b25359c51c545f4b8ba0f3b469227fcbc'
          '0150379149bf9d714bc81332d775fc273e7e3535'
          '2f3a94994ece62aeb286315a6fa5e9e03203706a'
          'f2f71aefbf677fb1719b5c67c757cde34e3210d7')

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	sed -i '/^groupname /s/mlocate/locate/' Makefile.in
}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./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

	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 ../updatedb.conf "${pkgdir}/etc/updatedb.conf"

	install -D -m644 ${srcdir}/updatedb.timer ${pkgdir}/usr/lib/systemd/system/updatedb.timer
	install -D -m644 ${srcdir}/updatedb.service ${pkgdir}/usr/lib/systemd/system/updatedb.service
	install -d -m755 ${pkgdir}/usr/lib/systemd/system/multi-user.target.wants
	ln -s ../updatedb.timer ${pkgdir}//usr/lib/systemd/system/multi-user.target.wants/updatedb.timer
}