summaryrefslogtreecommitdiff
blob: 7e1f04aaec7c938b235014c617c80be0dc304430 (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-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/pdftk/pdftk-1.41-r1.ebuild,v 1.3 2009/07/23 21:01:52 ssuominen Exp $

EAPI="2"

inherit eutils

DESCRIPTION="A tool for manipulating PDF documents"
HOMEPAGE="http://www.pdfhacks.com/pdftk"
SRC_URI="http://www.pdfhacks.com/pdftk/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE=""
DEPEND=">=sys-devel/gcc-4.3.1[gcj]"

S="${WORKDIR}/${P}/${PN}"

src_unpack() {
	unpack ${A}

	#bug #225709 and #251796
	epatch "${FILESDIR}/${P}-gcc-4.3.patch"
	#bug #269312
	epatch "${FILESDIR}/${P}-gcc-4.4.patch"
	#bug #209802
	epatch "${FILESDIR}/${P}-honor-ldflags.patch"
	# force usage of custom CFLAGS.
	sed -iorig 's:-O2:\$(CFLAGS):g' "${S}"/Makefile.Generic
}

src_compile() {
	# java-config settings break compilation by gcj.
	unset CLASSPATH
	unset JAVA_HOME
	# parallel make fails
	emake -j1 -f Makefile.Generic || die "Compilation failed."
}

src_install() {
	dobin pdftk
	newman ../debian/pdftk.1 pdftk.1
	dohtml ../pdftk.1.html
}