summaryrefslogtreecommitdiff
blob: 65d4eac3a0b1e2d28daec5af00ee65884e798f21 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/mbtpdfasm/mbtpdfasm-1.0.26-r1.ebuild,v 1.1 2006/04/08 10:56:34 sbriesen Exp $

inherit eutils toolchain-funcs

MY_P="mbtPdfAsm-${PV}"

DESCRIPTION="mbtPdfAsm can assemble/merge PDF files, extract information from PDF files, and update the metadata in PDF files."
HOMEPAGE="http://thierry.schmit.free.fr/dev/mbtPdfAsm/enMbtPdfAsm2.html"
SRC_URI="http://thierry.schmit.free.fr/dev/mbtPdfAsm/${MY_P}.tar.gz"

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

DEPEND=""

S="${WORKDIR}/${MY_P}"

src_unpack() {
	unpack ${A}
	cd "${S}"

	edos2unix *.txt
	epatch "${FILESDIR}/${P}-gcc4.patch"

	# patch location of help files
	sed -i -e "s:\(aide.txt\):/usr/share/doc/${PF}/\1:g" \
		 -e "s:\(help.txt\):/usr/share/doc/${PF}/\1:g" string.cpp

	# convert to UTF-8
	if use unicode; then
		for i in aide.txt; do
			einfo "Converting ${i} to UTF-8"
			iconv -f latin1 -t utf8 -o "${i}~" "${i}" && mv -f "${i}~" "${i}" || rm -f "${i}~"
		done
	fi
}

src_compile() {
	# FIXME: ugly, but this way we don't need to patch anything
	emake CC="$(tc-getCXX) ${CXXFLAGS}" || die "emake failed"
}

src_install() {
	dobin mbtPdfAsm || die "install failed"
	insinto /usr/share/doc/${PF}
	doins *.txt  # do not gzip!
}