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

EAPI=4

inherit toolchain-funcs

MY_PN="RemenDeKO"
DESCRIPTION="File corruption detection and repair program"
HOMEPAGE="http://rdko.sourceforge.net/"
SRC_URI="mirror://sourceforge/rdko/${MY_PN}-${PV}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="gtk"

RDEPEND="gtk? ( x11-libs/gtk+:2 )"
DEPEND="${RDEPEND}
	gtk? ( >=dev-util/pkgconfig-0.15 )"

S=${WORKDIR}/${MY_PN}

src_prepare() {
	sed -i \
		-e 's: -s::g' \
		-e 's:$(CC) $(LINKOBJ:$(CC) $(LDFLAGS) $(LINKOBJ:g' \
		-e "s:^\(CC   = \).*$:\1$(tc-getCC):" \
		-e "s:^\(CFLAGS = \).*$:\1${CFLAGS} -Wall:" \
		Makefile || die "sed Makefile failed"

	if use gtk;	then
		sed -i \
			-e "s:^\(CFLAGSGUI = \).*$:\1${CFLAGS} -DUSEGUI -Wall \
				`pkg-config gtk+-2.0 gthread-2.0 --cflags`:" \
			Makefile || die "sed Makefile failed"
	else
		sed -i \
			-e "s:^\(CFLAGSGUI = \).*$:\1${CFLAGS} -Wall:" \
			Makefile || die "sed Makefile failed"
	fi
}

src_compile() {
	if use gtk; then
		emake || die "emake failed"
	else
		emake rdko || die "emake rdko failed"
	fi
}

src_install() {
	dobin rdko
	use gtk && dobin gredeko
	dodoc CHANGELOG
}