summaryrefslogtreecommitdiff
blob: 3663192495c31d4d292e9bc6e7f38f036254dfc0 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-tinyos/tos-apps/tos-apps-1.1.15-r1.ebuild,v 1.2 2006/11/14 21:59:29 sanchan Exp $
inherit eutils

CVS_MONTH="Dec"
CVS_YEAR="2005"
MY_PN="tinyos"
MY_P=${MY_PN}-${PV}${CVS_MONTH}${CVS_YEAR}cvs

DESCRIPTION="TinyOS apps: TinyOS bundled applications."
HOMEPAGE="http://www.tinyos.net/"
SRC_URI="http://www.tinyos.net/dist-1.1.0/tinyos/source/${MY_P}.tar.gz"
LICENSE="Intel"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND=">=dev-tinyos/tos-1.1.15"
RDEPEND=">=dev-tinyos/tos-make-1.1.15"

S=${WORKDIR}/${MY_P}

pkg_setup() {
	if [ -z "${TOSROOT}" ]
	then
		export TOSROOT=/usr/src/tinyos-1.x
	fi

	if [ ! -d "${TOSROOT}" ]
	then
		eerror "In order to emerge tos-apps you have to set the"
		eerror "\$TOSROOT environment properly."
		eerror ""
		eerror "You can achieve this by emerging >=dev-tinyos/tos-1.1.15"
		eerror "or by exporting TOSDIR=\"path to your tinyos dir\""
		die "Couldn't find a valid TinyOS home"
	else
		einfo "Building tos-apps for ${TOSROOT}"
	fi
}

src_unpack(){
	unpack ${A}
	cd ${S}
	for i in `find . -name CVS`; do
		rm -rf "${i}"
	done
	epatch ${FILESDIR}/tos-apps-1.1.15-TOSBase-types-conflict-fix.patch
}

src_compile() {
	einfo "Nothing to compile."
}

src_install() {
	insinto ${TOSROOT}
	doins -r apps
	chown -R root:0 "${D}"
}

pkg_postinst() {
	elog "If you want to use TinyOS on real hardware you need a cross compiler."
	elog "You should emerge sys-devel/crossdev and compile any toolchain you need"
	elog "Example: for Mica2 and Mica2 Dot: crossdev --target avr"
	ebeep 5
	epause 5
}