]> Pileus Git - ~andy/sunrise/blob - sys-apps/moreutils/moreutils-0.22.ebuild
1fae25299ff88e6f1822d5182851a177fc9b96a3
[~andy/sunrise] / sys-apps / moreutils / moreutils-0.22.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit toolchain-funcs
6
7 DESCRIPTION="This is a growing collection of the unix tools that nobody thought to write thirty years ago"
8 HOMEPAGE="http://www.kitenet.net/~joey/code/moreutils.html"
9 SRC_URI="http://ftp.debian.org/debian/pool/main/m/moreutils/${P/-/_}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~x86"
14 IUSE="doc"
15
16 DEPEND="doc? ( =app-text/docbook-xml-dtd-4.4*
17                 app-text/docbook2X )"
18 RDEPEND="dev-lang/perl"
19
20 S=${WORKDIR}/${PN}
21
22 src_unpack() {
23         unpack ${A}
24         sed -i \
25                 -e 's/^CFLAGS/#CFLAGS/' \
26                 -e 's/-s//' \
27                 -e 's/docbook2x-man $</docbook2man.pl $< >$@/g' \
28                 "${S}/Makefile" || die "sed failed"
29
30         if use doc; then
31                 sed -i \
32                         -e 's#file.*/xml/\(.*docbookx.dtd\)#\1#g' \
33                         $(find "${S}" -iname *.docbook -printf '%p ') || die "sed failed"
34
35         else
36                 sed -i \
37                         -e 's/^MANS/#/' \
38                         -e 's#install $(MANS) $(PREFIX)/usr/share/man/man1##' \
39                         -e 's#mkdir -p $(PREFIX)/usr/share/man/man1##' \
40                         "${S}/Makefile" || die "sed failed"
41
42         fi
43 }
44
45 src_compile() {
46         emake CC=$(tc-getCC) || die "emake failed"
47 }
48
49 src_install() {
50         emake PREFIX="${D}" install || die "emake install failed"
51         dodoc README
52 }