summaryrefslogtreecommitdiff
blob: c466a7c139de0b7e791722ca6a79e007475d9cd2 (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
# 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.ebuild,v 1.1 2006/01/22 09:20:35 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"

#Ready to support doc regeneration when bug #113024 and #98029 will be resolved
#DEPEND="doc? ( sys-devel/m4
#	virtual/tetex
#	dev-tex/latex2html )"

DEPEND=""
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() {
#Ready to support doc when bug #113024 and #98029 will be fixed
#	if use doc
#	then
#		cd ${WORKDIR}/tinyos-1.x/doc
#		make && make install-snapshots.html || die "Make error in tinyos-1.x/doc"
#		cd ${WORKDIR}/tinyos-1.x/doc/tex
#		make || die "Unable to make docs from tex sources"
#		cd ${WORKDIR}/tinyos-1.x/doc/schemadocsrc
#		make || die "Unable to make docs from tex sources"
#		make 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

	# root group name doesn't exist on Mac OS X
	#NOTE: do not use fowners, as its not recursive ...
	# einfo "Fixing permissions ..."
	chown -R root:0 "${D}"

	# Note: should not die here or running in userpriv mode fill fail
	# portage autochanges ownership from portage to root.
	#	chmod -R u=rwX,go=rX "${D}"
	#	|| die "correcting file modes failed"
	dodoc ChangeLog
	if use doc
	then
		#once tetex works, tex could be removed.
		dohtml -A pdf,gif,tex -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
}