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

EAPI=4

inherit eutils

FILENAME="JLink_Linux_V${PV/./}"
INSTALLDIR="/opt/${PN}"

DESCRIPTION="J-Link gdb-server and commander for Segger J-Link jtag adapter"
HOMEPAGE="http://www.segger.com/jlink-software.html"
SRC_URI="${FILENAME}.tgz"

LICENSE="J-Link EDU Terms of Use"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""

RESTRICT="fetch strip"
DEPEND=""
RDEPEND="${DEPEND}
	amd64? ( app-emulation/emul-linux-x86-xlibs )"

S=${WORKDIR}/${FILENAME}

src_install() {
	dodir ${INSTALLDIR} || die
	dodir ${INSTALLDIR}/lib || die
	dodir ${INSTALLDIR}/doc || die

	local BINS="JLinkExe JLinkGDBServer JLinkRemoteServer"
	for wrapper in $BINS ; do
		make_wrapper $wrapper ./$wrapper ${INSTALLDIR} lib
	done

	exeinto ${INSTALLDIR}
	doexe $BINS || die

	exeinto ${INSTALLDIR}/lib
	doexe "libjlinkarm.so.${PV}" || die
	dosym "libjlinkarm.so.${PV}" ${INSTALLDIR}/lib/libjlinkarm.so.${PV:0:1} || die
	if use amd64; then
		dosym /lib32/libreadline.so.6 ${INSTALLDIR}/lib/libreadline.so.5 || die
	fi

	insinto ${INSTALLDIR}/doc
	doins README.txt || die
	doins Doc/{UM08001_JLinkARM.pdf,UM08005_JLinkGDBServer.pdf} || die
	doins Doc/ReleaseNotes/ReleaseJLinkARM.html || die

	insinto ${INSTALLDIR}
	doins -r Samples || die "doins failed"

	insinto /lib/udev/rules.d/
	doins 45-jlink.rules || die "doins udev rules failed"
}

pkg_postinst() {
	enewgroup plugdev
	elog "To be able to access the jlink usb adapter, you have to be"
	elog "a member of the 'plugdev' group."
}