summaryrefslogtreecommitdiff
blob: 0e27de128efac36aadf638b658ec157b2e662c00 (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
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/dd-rescue/dd-rescue-1.44.ebuild,v 1.1 2014/05/28 13:53:21 polynomial-c Exp $

EAPI=5

inherit toolchain-funcs flag-o-matic autotools

MY_PN=${PN/-/_}
MY_P=${MY_PN}-${PV}

DESCRIPTION="Similar to dd but can copy from source with errors"
HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
IUSE="static"

S=${WORKDIR}/${MY_PN}

src_prepare() {
	sed -i \
		-e 's:-ldl:$(LDFLAGS) -ldl:' \
		Makefile
	eautoreconf
}

src_compile() {
	use static && append-ldflags -static

	# The Makefile is a mess.  Override a few vars rather than patch it.
	emake \
		RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
		CFLAGS_OPT='$(CFLAGS)' \
		CC="$(tc-getCC)"
}

src_install() {
	# easier to install by hand than trying to make sense of the Makefile.
	dobin dd_rescue
	dodoc README.dd_rescue
	doman dd_rescue.1
}