summaryrefslogtreecommitdiff
blob: f000f2bebde7e3a3533dc828bd220a0e54a6be0a (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-pda/plucker/plucker-1.8-r1.ebuild,v 1.10 2007/04/19 20:03:53 gustavoz Exp $

IUSE="gtk"

inherit python eutils wxwidgets

DESCRIPTION="Distiller for Plucker -- offline ebook reader for Palm devices"
HOMEPAGE="http://www.plkr.org/"
SRC_URI="http://downloads.plkr.org/${PV}/${PN}_src-${PV}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
DEPEND=">=dev-lang/python-1.5.2
	gtk? ( >=x11-libs/gtk+-2.2
		=x11-libs/wxGTK-2.4* )
	sys-devel/autoconf"
RDEPEND=">=dev-lang/python-1.5.2
	gtk? ( >=x11-libs/gtk+-2.2
		=x11-libs/wxGTK-2.4* )
	|| (
		>=media-gfx/imagemagick-5.4.4
		>=dev-python/imaging-1.1
		>=media-libs/netpbm-9.15
	)"

src_unpack() {
	unpack ${A}
	cd ${S} || die

	# Repair broken Makefile.in
	epatch ${FILESDIR}/plucker-1.8-Makefile.in.patch

	# GCC 4 - extra qualification - Bug #138370
	epatch "${FILESDIR}"/${P}-gcc4.patch

	# Repair documentation installation path
	sed -i "/^DOCSDIR/s/packages/${PF}/" plucker_desktop/Makefile.in || die "sed 1 failed"

	# Fix default path to netpbm files
	sed -i "s:, '\(palm.*\.map\):, '/usr/share/netpbm/\1:p" \
		parser/python/PyPlucker/ImageParser.py || die "sed 2 failed"

	# Fix deprecation warnings for python-2.3
	sed -i "s:0x\w\w\w\w\w\w\w\w:&L:" \
		parser/python/PyPlucker/helper/gettext.py || die "sed 3 failed"

	# Get the right version of wxGTK (note call to need-wxwidgets below)
	find . -name Makefile.in | xargs sed -i 's/wx-config/$(WX_CONFIG)/g' \
		|| die "sed 4 failed"
}

src_compile() {
	# plucker-desktop doesn't build with the unicode version of wxGTK.  Force
	# the non-unicode version until plucker-desktop is fixed.  #55716
	if useq gtk; then
		need-wxwidgets gtk2
	fi

	# --enable-desktopbuild and --disable-desktopbuild are equivalent for this
	# package; either one will *disable* the desktopbuild.  It is enabled only
	# if the flags are lacking from the cmdline.  (21 Jun 2004 agriffis)
	econf \
		$(useq gtk || echo --disable-desktopbuild --disable-gtkviewer) \
		--disable-palmosbuild \
		--disable-docbuild \
		--with-docdir=/usr/share/doc/${PF} \
		|| die "econf failed"

	# breaks when built in parallel
	emake -j1 || die "emake failed"

	# "make install" will try to access this non-existent file
	touch TODO
}

src_install() {
	dodir /usr/share/doc/${PF}
	make DESTDIR=${D} install || die

	# Various symlinks normally created by unix/install-plucker.sh
	python_version
	dosym /usr/lib/python${PYVER}/site-packages/PyPlucker/Spider.py \
		/usr/bin/plucker-build
	dosym /usr/lib/python${PYVER}/site-packages/PyPlucker/Plucker-Docs.py \
		/usr/bin/plucker-decode
	dosym /usr/lib/python${PYVER}/site-packages/PyPlucker/Decode.py \
		/usr/bin/plucker-dump

	# Extra symlink
	dosym /usr/lib/python${PYVER}/site-packages/PyPlucker/pluck-comics.py /usr/bin/pluck-comics
}