1 # Maintainer: aphet <aphet83@gmail.com>
2 # Contributor: Andras Biro <bbandi86@gmail.com>
6 pkgdesc="Small operating system for sensor motes, embedded devices"
10 url="http://www.tinyos.net/"
11 depends=('glibc' 'nesc')
13 optdepends=(avr-libc avrdude binutils-avr gcc-avr jdk jre)
14 source=(tinyos.profile)
15 md5sums=('8275b06a188620150fb08facc1c34bd2')
17 _gitroot="git://hinrg.cs.jhu.edu/git/tinyos-2.x.git"
22 msg "Connecting to GIT server...."
24 if [ -d $_gitname ] ; then
25 cd $_gitname && git pull origin
26 msg "The local files are updated."
28 git clone $_gitroot $_gitname
31 msg "GIT checkout done or server timeout"
32 msg "Starting make..."
34 rm -rf "$srcdir/$_gitname-build"
35 git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
36 cd "$srcdir/$_gitname-build"
38 install -d ${pkgdir}/opt
39 cp -aR ${srcdir}/${_gitname}/ ${pkgdir}/opt
40 install -D -m755 ${srcdir}/tinyos.profile ${pkgdir}/etc/profile.d/${pkgname}.sh
42 if [ "${CARCH}" = "x86_64" ]; then
43 sed 's/JNIVERSIONS="-32. -64."/JNIVERSIONS="-64."/' ${srcdir}/${_gitname}/tools/configure.ac > ${srcdir}/${_gitname}/tools/configure.new
45 sed 's/JNIVERSIONS="-32. -64."/JNIVERSIONS="-32."/' ${srcdir}/${_gitname}/tools/configure.ac > ${srcdir}/${_gitname}/tools/configure.new
47 mv -f ${srcdir}/${_gitname}/tools/configure.new ${srcdir}/${_gitname}/tools/configure.ac
48 cd ${srcdir}/${_gitname}-build/tools/
50 cd ${srcdir}/${_gitname}-build/tools/platforms/mica/uisp/
52 cd ${srcdir}/${_gitname}-build/tools
53 ./configure --prefix=/usr
55 make DESTDIR="${pkgdir}/" install
57 jni=${pkgdir}`/${pkgdir}/usr/bin/tos-locate-jre --jni`
59 if [ "${CARCH}" = "x86_64" ]; then
64 echo "Installing $bits-bit Java JNI code in $jni ... "
65 for lib in ${pkgdir}/usr/lib/tinyos/*.so; do
66 realname=`basename $lib | sed -e s/-$bits\.so/.so/`
67 install -D $lib "$jni/$realname" || exit 1