summaryrefslogtreecommitdiff
blob: 91f96cc0e245b695415ce011dc68e054509599f2 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-libs/pwdb/pwdb-0.62.ebuild,v 1.11 2004/03/07 10:05:26 kumba Exp $

inherit eutils flag-o-matic

IUSE="selinux"

DESCRIPTION="Password database"
HOMEPAGE="http://www.firstlinux.com/cgi-bin/package/content.cgi?ID=6886"
SRC_URI="mirror://gentoo/${P}.tar.gz
	http://nl.lunar-linux.org/lunar/sources/sources/${P}.tar.gz"

LICENSE="BSD | GPL-2"
SLOT="0"
KEYWORDS="amd64 x86 ppc sparc ~alpha mips hppa ~ia64 ppc64 s390"

DEPEND="virtual/glibc
	selinux? ( sys-libs/libselinux )"

src_unpack () {
	unpack ${A}

	cd ${S}
	# Uses gcc as linker needed for hppa, but good idea in general.
	epatch ${FILESDIR}/${P}-use-gcc-as-linker.patch

	use selinux && epatch ${FILESDIR}/${P}-selinux.patch

	sed -i -e "s/^DIRS = .*/DIRS = libpwdb/" -e "s:EXTRAS += :EXTRAS += ${CFLAGS} :" \
		Makefile
	sed -i -e "s/=gcc/=${CC:-gcc}/g" default.defs
}

src_compile() {
	filter-flags "-fstack-protector"

	# author has specified application to be compiled with `-g` 
	# no problem, but with ccc `-g` disables optimisation to make
	# debugging easier, `-g3` enables debugging and optimisation
	[ "${ARCH}" = "alpha" -a "${CC}" = "ccc" ] && append-flags -g3

	emake || die
}

src_install() {
	dodir /lib /usr/include/pwdb
	make INCLUDED=${D}/usr/include/pwdb \
		LIBDIR=${D}/lib \
		LDCONFIG="echo" \
		install || die

	preplib /
	dodir /usr/lib
	mv ${D}/lib/*.a ${D}/usr/lib

	# See bug $4411 for more info
	gen_usr_ldscript libpwdb.so

	insinto /etc
	doins conf/pwdb.conf

	dodoc CHANGES Copyright CREDITS README
	dohtml -r doc
	docinto txt
	dodoc doc/*.txt
}