summaryrefslogtreecommitdiff
blob: 841cf67207feaa6fd1e1260cc7f47fb16bb0133e (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-tinyos/tos/tos-1.1.15-r1.ebuild,v 1.1 2006/02/12 16:55:04 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: an open-source OS designed for wireless embedded sensor networks"
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"
IUSE="doc"
DEPEND="doc? ( sys-devel/m4
	>=virtual/tetex-3.0_p1-r2
	dev-tex/latex2html )"
RDEPEND=""

#Required to do anything useful. Could not be a RDEPEND since portage try to emerge nesc before tos.
PDEPEND="dev-tinyos/nesc"

S=${WORKDIR}/${MY_P}
src_unpack() {
	unpack ${A}
	cd ${S}
	epatch ${FILESDIR}/tos-1.1.15-system-AMStandard-Control.patch
	sed -i -e "s:psfig:epsfig:" ${S}/doc/schemadocsrc/tinyschema.tex \
		|| die "Error while updating tex sources."
	einfo "removing CVS dirs"
	for i in `find . -name CVS`; do
		rm -rf "${i}"
	done
}

src_compile() {
	if use doc
	then
		make -C doc && make -C doc install-snapshots.html || die "Make error in tinyos-1.x/doc"
		make -C doc/tex || die "Unable to make docs from tex sources"
		make -C doc/schemadocsrc || die "Unable to make docs from tex sources"
		make -C doc/schemadocsrc tinyschema.html || die "Unable to make docs from tex sources"
	else
		einfo "Nothing to compile."
	fi
}

src_install() {
	insinto /usr/src/tinyos-1.x
	doins -r tos
	chown -R root:0 "${D}"
	dodoc ChangeLog
	if use doc
	then
		dohtml -A pdf,gif,html -r doc/*
		dodoc doc/*.txt
	fi
	doenvd ${FILESDIR}/99tinyos
}

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