summaryrefslogtreecommitdiff
blob: 9f964a471fabe8c778c5a4a6343b3d18fec6109e (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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/slocate/slocate-2.7-r1.ebuild,v 1.1 2003/04/12 16:33:54 seemant Exp $

S=${WORKDIR}/${P}
DESCRIPTION="Secure locate provides a secure way to index and quickly search for files on your system (drop-in replacement for 'locate')"
HOMEPAGE="http://www.geekreview.org/slocate/"
SRC_URI="ftp://ftp.geekreview.org/slocate/src/slocate-${PV}.tar.gz"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86 ppc sparc ~alpha ~hppa ~mips"

DEPEND="virtual/glibc"

src_install() {

	dodir /usr/share/man/man1

	make DESTDIR=${D} install || die

	# make install for this package is blocked by sandbox
#	dobin slocate
	dosym slocate /usr/bin/locate
	dosym slocate /usr/bin/updatedb
	fperms 0755 /etc/cron.daily/slocate
#
#	dosym slocate.1.gz /usr/share/man/man1/locate.1.gz
#
	keepdir /var/lib/slocate


	# If this file doesn't exist, the first run of updatedb will create
	# it anyway.  But doing this shuts it up.
	if [ ! -f ${ROOT}/var/lib/slocate/slocate.db ]
	then
		touch ${D}/var/lib/slocate/slocate.db
	fi

	dodoc INSTALL LICENSE COPYING AUTHORS NEWS README ChangeLog


	# man page fixing
	rm -rf ${D}/usr/share/man/man1/locate.1.gz
	dosym slocate.1.gz /usr/share/man/man1/locate.1.gz


	# Make a fake updatedb.conf file, to shut slocate up 
	echo "# There is a sample config file in :" > updatedb.conf
	echo "# /usr/share/doc/${P}/updatedb.conf.gz" >> updatedb.conf
	insinto /etc
	doins updatedb.conf
	fperms 0644 /etc/updatedb.conf

	dodoc ${FILESDIR}/updatedb.conf
}

pkg_postinst() {
	# /var/lib/slocate is owned by group slocate and so is the executable
	groupadd slocate

	chown root.slocate /usr/bin/slocate
	chmod 2755 /usr/bin/slocate

	chown -R root.slocate /var/lib/slocate
	chmod 0750 /var/lib/slocate

	einfo "Please note that the /etc/updatedb.conf file is EMPTY"
	einfo "There is a sample configuration file in"
	einfo "/usr/share/doc/${P}"

}