summaryrefslogtreecommitdiff
blob: 03cab33abfcf5838f5177169b35e565636e0d266 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-fs/netatalk/netatalk-2.0.3-r4.ebuild,v 1.5 2009/05/21 20:24:33 ranger Exp $

EAPI=2

inherit eutils pam autotools cvs

ECVS_SERVER="netatalk.cvs.sourceforge.net:/cvsroot/netatalk"
ECVS_MODULE="netatalk"
S=${WORKDIR}/${PN}

DESCRIPTION="Kernel level implementation of the AppleTalk Protocol Suite"
HOMEPAGE="http://netatalk.sourceforge.net/"

LICENSE="BSD"
SLOT="0"
KEYWORDS=""
IUSE="ssl pam tcpd slp cups kerberos krb4 debug cracklib xfs"

RDEPEND=">=sys-libs/db-4.2.52
	cracklib? ( sys-libs/cracklib )
	pam? ( virtual/pam )
	ssl? ( dev-libs/openssl )
	tcpd? ( sys-apps/tcp-wrappers )
	slp? ( net-libs/openslp )
	cups? ( net-print/cups )
	kerberos? ( virtual/krb5 )
	krb4? ( virtual/krb5 )
	>=sys-apps/coreutils-7.1"
DEPEND="${RDEPEND}
	xfs? ( sys-fs/xfsprogs <sys-kernel/linux-headers-2.6.16 )"

src_prepare() {
	# until someone that understands their config script build
	# system gets a patch pushed upstream to make
	# --enable-srvloc passed to configure also add slpd to the
	# use line on the initscript, we'll need to do it this way
	if use slp; then
		myconf="${myconf} --enable-srvloc"
		sed -i -e 's/^\([[:space:]]*use[[:space:][:alnum:]]*\)$/\1 slpd/' \
			"${S}"/distrib/initscripts/rc.atalk.gentoo.tmpl
	fi

	eautoreconf
}

src_configure() {
	# Ignore --enable-gentoo, we install the init.d by hand and we avoid having to
	# sed the Makefiles to not do rc-update.
	econf \
		$(use_with pam) \
		$(use_enable cups) \
		$(use_enable debug) \
		$(use_enable tcpd tcp-wrappers) \
		$(use_enable kerberos krbV-uam) \
		$(use_enable krb4 krb4-uam) \
		$(use_enable slp srvloc) \
		$(use_with ssl ssl-dir) \
		$(use_with cracklib) \
		$(use_with elibc_glibc shadow) \
		$(use_with xfs) \
		--disable-afs \
		--enable-fhs \
		--with-cnid-cdb-backend \
		--with-bdb=/usr
}

src_compile() {
	emake || die "netatalk emake failed"

	# Create the init script manually (it's more messy to --enable-gentoo)
	cd "${S}"/distrib/initscripts
	emake rc.atalk.gentoo
}

src_install() {
	emake DESTDIR="${D}" install || die "netatalk make install failed"

	dodoc CONTRIBUTORS NEWS README TODO VERSION

	newinitd "${S}"/distrib/initscripts/rc.atalk.gentoo atalk

	# The pamd file isn't what we need, use pamd_mimic_system
	rm -rf "${D}/etc/pam.d"
	pamd_mimic_system netatalk auth account password session

	# Move /usr/include/netatalk to /usr/include/netatalk2 to avoid collisions
	# with /usr/include/netatalk/at.h provided by glibc (strange, uh?)
	# Packages that wants to link to netatalk should then probably change the
	# includepath then, but right now, nothing uses netatalk.
	# On a side note, it also solves collisions with freebsd-lib and other libcs
	mv "${D}"/usr/include/netatalk{,2}
}