summaryrefslogtreecommitdiff
blob: c99504a1374fdf7f0bec8a4afb53c08f53badb43 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-ftp/netkit-tftp/netkit-tftp-0.17-r6.ebuild,v 1.1 2008/03/29 02:33:27 vapier Exp $

inherit eutils toolchain-funcs

DESCRIPTION="the tftp server included in netkit"
HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/"
SRC_URI="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-tftp-0.17.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~mips ppc ppc64 sparc x86"
IUSE=""

DEPEND="!virtual/tftp
	virtual/inetd"
PROVIDE="virtual/tftp"

src_unpack() {
	unpack ${A}
	cd "${S}"

	# Change default man directory
	sed -i \
		-e 's:MANDIR="$PREFIX/man":MANDIR="$PREFIX/share/man":' \
		-e 's:^LDFLAGS=::' \
		configure

	# don't prestrip binaries
	find . -name Makefile -print0 | xargs -0 sed -i -e 's:install -s:install:'

	# Solve QA warning by including string.h
	epatch "${FILESDIR}"/memset.patch
	epatch "${FILESDIR}"/${P}-tftp-connect-segfault.patch
	epatch "${FILESDIR}"/${P}-tftp-manpage-typo.patch
	epatch "${FILESDIR}"/${P}-tftp-fix-put-zero-size.diff
}

src_compile() {
	./configure \
		--prefix=/usr \
		--installroot="${D}" \
		--with-c-compiler="$(tc-getCC)" \
		|| die
	emake || die
}

src_install() {
	dodir /usr/bin /usr/sbin /usr/share/man/man{1,8}
	emake install || die
	rm -f "${D}"/usr/share/man/man8/tftpd.8
	insinto /etc/xinetd.d
	doins "${FILESDIR}"/{tftp-dgram,tftp-stream}
	dodoc BUGS ChangeLog README
}