summaryrefslogtreecommitdiff
blob: 91186504c4b22bc7afc0b9fc2a3b4eb19e18835f (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/ifplugd-0.25.ebuild,v 1.5 2004/12/20 13:57:11 ka0ttic Exp $


DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
HOMEPAGE="http://0pointer.de/lennart/projects/ifplugd/"
SRC_URI="http://0pointer.de/lennart/projects/ifplugd/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ~amd64 ppc"
IUSE="doc"

DEPEND=">=sys-apps/sed-4
	dev-util/pkgconfig
	doc? ( net-www/lynx )"
RDEPEND=">=dev-libs/libdaemon-0.5"

# Gentoo-provided scripts. Version is for the scripts, not ifplugd.
INITSCRIPT=${FILESDIR}/gentoo-ifplugd-init-v3
ACTIONSCRIPT=${FILESDIR}/gentoo-ifplugd.action-v2
CONFFILE=${FILESDIR}/gentoo-ifplugd-conf-v3

src_unpack() {
	unpack ${A}
	cd ${S}
	# This moves the default location for the script that handles
	# calling the distro network scripts to /usr/sbin. The reason
	# is that the user very probably shouldn't mess with it.
	sed -i 's:SYSCONFDIR"/ifplugd/:"/usr/sbin/:' src/ifplugd.c \
		|| die "sed failed"
}

src_compile() {
	econf $(use_enable doc lynx) \
		--with-initdir=/etc/init.d \
		--disable-xmltoman \
		--disable-subversion \
		|| die "econf failed"
	emake || die "emake failed"
}

src_install() {
	make DESTDIR="${D}" install || die "make install failed"
	newsbin ${ACTIONSCRIPT} ifplugd.action

	# Fix init.d configuration
	rm -fr ${D}/etc/ifplugd ${D}/etc/init.d/ifplugd

	insinto /etc/conf.d ; newins ${CONFFILE} ${PN} || die
	exeinto /etc/init.d ; newexe ${INITSCRIPT} ${PN} || die

	cd ${S}/doc
	dodoc README SUPPORTED_DRIVERS
	use doc && dohtml *.{html,css}
}