summaryrefslogtreecommitdiff
blob: a601bab35b51633333eb4a56c3037c0da71b857d (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/ponyprog/ponyprog-2.07a.ebuild,v 1.4 2008/06/20 20:24:44 calchan Exp $

inherit eutils

DESCRIPTION="Serial device programmer"
HOMEPAGE="http://www.lancos.com/ppwin95.html"
SRC_URI="mirror://sourceforge/${PN}/PonyProg2000-${PV}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="epiphany firefox seamonkey"
RDEPEND="x11-libs/libXaw
	x11-libs/libXmu
	x11-libs/libXt
	x11-libs/libXext
	x11-libs/libX11
	epiphany? ( www-client/epiphany )
	firefox? ( || ( www-client/mozilla-firefox www-client/mozilla-firefox-bin ) )
	seamonkey? ( || ( www-client/seamonkey www-client/seamonkey-bin ) )"
DEPEND="${RDEPEND}
	media-gfx/imagemagick"

S="${WORKDIR}/PonyProg2000-${PV}"

pkg_setup() {
	if (use epiphany && use firefox) || (use epiphany && use seamonkey) || (use firefox && use seamonkey) ; then
		die "Only one of epiphany, firefox or seamonkey can be in USE."
	fi
}

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

	sed -i \
		-e "s:\$(HOME)/Progetti/PonyProg_Sourceforge/v:${S}/v:" \
		-e 's/\-O2//' \
		v/Config.mk || die "sed failed"

	sed -i -e 's/<asm\/io.h>/<sys\/io.h>/' *.cpp || die "sed failed"

	if use epiphany ; then
		sed -i -e 's/netscape/epiphany/' e2cmdw.cpp
	fi
	if use firefox ; then
		sed -i -e 's/netscape/firefox/' e2cmdw.cpp
	fi
	if use seamonkey ; then
		sed -i -e 's/netscape/seamonkey/' e2cmdw.cpp
	fi
	convert ponyprog.ico ponyprog.png

	# Fix compilation with gcc-4.3, bug #227503
	epatch "${FILESDIR}/${P}-gcc43.patch"
}

src_compile() {
	emake || die "Compilation failed"
}

src_install () {
	dobin bin/ponyprog2000
	keepdir /var/lock/uucp
	fowners uucp:uucp /var/lock/uucp
	fperms 755 /var/lock/uucp
	doicon ponyprog.png
	make_desktop_entry ponyprog2000 PonyProg2000 ponyprog
}

pkg_postinst() {
	elog "To use the COM port in user mode (not as root) you need to"
	elog "make sure you have the rights to write to /dev/ttyS? devices"
	elog "and /var/lock directory."
	elog
	elog "To use the LPT port in user mode (not as root) you need a kernel with"
	elog "ppdev, parport and parport_pc compiled in or as modules. You need the"
	elog "rights to write to /dev/parport? devices."
}