summaryrefslogtreecommitdiff
blob: f03b34f38cac35adc4b05f1ff855135475a30ec9 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit toolchain-funcs

DESCRIPTION="This is a growing collection of the unix tools that nobody thought to write thirty years ago"
HOMEPAGE="http://www.kitenet.net/~joey/code/moreutils.html"
SRC_URI="http://ftp.debian.org/debian/pool/main/m/moreutils/${P/-/_}.tar.gz"

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

DEPEND="doc? ( =app-text/docbook-xml-dtd-4.4*
		app-text/docbook2X )"
RDEPEND="dev-lang/perl"

S=${WORKDIR}/${PN}

src_unpack() {
	unpack ${A}
	sed -i \
		-e 's/^CFLAGS/#CFLAGS/' \
		-e 's/-s//' \
		-e 's/docbook2x-man $</docbook2man.pl $< >$@/g' \
		"${S}/Makefile" || die "sed failed"

	if use doc; then
		sed -i \
			-e 's#file.*/xml/\(.*docbookx.dtd\)#\1#g' \
			$(find "${S}" -iname *.docbook -printf '%p ') || die "sed failed"

	else
		sed -i \
			-e 's/^MANS/#/' \
			-e 's#install $(MANS) $(PREFIX)/usr/share/man/man1##' \
			-e 's#mkdir -p $(PREFIX)/usr/share/man/man1##' \
			"${S}/Makefile" || die "sed failed"

	fi
}

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

src_install() {
	emake PREFIX="${D}" install || die "emake install failed"
	dodoc README
}