summaryrefslogtreecommitdiff
blob: e43eeba9ae7bf44a639fb5b6ca43c8affe6b4dc8 (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
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/netselect/netselect-0.3-r3.ebuild,v 1.3 2013/06/12 16:32:22 jer Exp $

EAPI=5
inherit eutils flag-o-matic toolchain-funcs

DESCRIPTION="Ultrafast implementation of ping."
HOMEPAGE="http://alumnit.ca/~apenwarr/netselect/index.html"
SRC_URI="http://alumnit.ca/~apenwarr/netselect/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
IUSE=""

S=${WORKDIR}/${PN}

src_prepare() {
	epatch "${FILESDIR}/${P}-bsd.patch"
	epatch "${FILESDIR}/${P}-glibc.patch"

	sed -i \
		-e "s:PREFIX =.*:PREFIX = ${ED}usr:" \
		-e "s:CFLAGS =.*:CFLAGS = -Wall -I. ${CFLAGS}:" \
		-e "s:LDFLAGS =.*:LDFLAGS = ${LDFLAGS}:" \
		-e '23,27d' \
		-e '34d' \
		Makefile || die
}

src_compile() {
	emake CC="$(tc-getCC)"
}

src_install () {
	dobin netselect
	if ! use prefix ; then
		fowners root:wheel /usr/bin/netselect
		fperms 4711 /usr/bin/netselect
	fi
	dodoc ChangeLog HISTORY README*
}