]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Debianize the tinyos package. This directory builds tinyos, tinyos-tools, tinyos...
authorR. Steve McKown <rsmckown@gmail.com>
Tue, 1 Dec 2009 02:34:03 +0000 (19:34 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Tue, 1 Dec 2009 02:34:03 +0000 (19:34 -0700)
README.Debian [new file with mode: 0644]
changelog [new file with mode: 0644]
control [new file with mode: 0644]
copyright [new file with mode: 0644]
patches/001_tinyos-sh.dpatch [new file with mode: 0755]
patches/002_distfiles.dpatch [new file with mode: 0644]
patches/00list [new file with mode: 0644]
rules [new file with mode: 0755]

diff --git a/README.Debian b/README.Debian
new file mode 100644 (file)
index 0000000..a545745
--- /dev/null
@@ -0,0 +1,3 @@
+This package creates Ubuntu source and binary debian packages for the
+tinyos, tinyos-tools and tinyos-source packages, which comprise the TinyOS
+distribution.
diff --git a/changelog b/changelog
new file mode 100644 (file)
index 0000000..8297110
--- /dev/null
+++ b/changelog
@@ -0,0 +1,12 @@
+tinyos (2.1.0-0tinyos2) hardy; urgency=low
+
+  * The extractor and tinyos.files files exist in tools/release, so we don't
+    need to replicate them in tools.  Modify to support these changes.
+
+ -- R. Steve McKown <rsmckown@gmail.com>  Tue, 02 Sep 2008 08:42:57 -0600
+
+tinyos (2.1.0-0tinyos1) hardy; urgency=low
+
+  * Initial release, built from stanford makefiles
+
+ -- R. Steve McKown <rsmckown@gmail.com>  Wed, 27 Aug 2008 06:46:41 -0600
diff --git a/control b/control
new file mode 100644 (file)
index 0000000..c75e9d2
--- /dev/null
+++ b/control
@@ -0,0 +1,53 @@
+Source: tinyos
+Section: devel
+Priority: optional
+Maintainer: R. Steve McKown <rsmckown@gmail.com>
+Standards-Version: 3.7.2.0
+Build-Depends: dpkg-dev (>= 1.13.9), autoconf (>= 2.13), automake, bison, flex, gettext, texinfo, binutils (>= 2.9.5.0.12), gcc (>= 4:4.2.2), dejagnu (>= 1.4.2-1.1), dpatch, file, bzip2, lsb-release, nesc (>= 1.3.0)
+
+Package: tinyos
+Architecture: all
+Depends: tinyos-tools (>= 1.3.0), deputy-tinyos (>= 1.1), tinyos-root, tinyos-toolchain
+Conflicts:
+Priority: extra
+Description: Main TinyOS package.
+  To install TinyOS, install this package.
+
+Package: tinyos-tools
+Architecture: any
+Depends: python, python-serial, nesc (>= 1.3.0), ${shlibs:Depends}
+Conflicts:
+Priority: extra
+Description: Development support tools for TinyOS.
+  Includes various support tools, including uisp, motelist, pybsl, mig, ncc and
+  nesdoc. The source for these tools is found in the TinyOS CVS repository
+  under tinyos-2.x/tools.
+
+Package: tinyos-source
+Architecture: all
+Depends:
+Provides: tinyos-root
+Conflicts:
+Priority: extra
+Description: TinyOS source code tree.
+  TinyOS source is required to compile TinyOS applications.
+
+Package: tinyos-avr
+Architecture: all
+Depends: avr-tinyos-base, avr-binutils-tinyos, avr-gcc-tinyos, avr-libc-tinyos, avrdude-tinyos
+Provides: tinyos-toolchain
+Conflicts:
+Priority: extra
+Description: TinyOS avr toolchain
+  This dummy package allows for easy installation of the avr toolchain
+  for building TinyOS applications for avr microprocessor based systems.
+
+Package: tinyos-msp430
+Architecture: all
+Depends: msp430-binutils, msp430-gcc, msp430-libc
+Provides: tinyos-toolchain
+Conflicts:
+Priority: extra
+Description: TinyOS msp430 toolchain
+  This dummy package allows for easy installation of the msp430 toolchain
+  for building TinyOS applications for msp430 microprocessor based systems.
diff --git a/copyright b/copyright
new file mode 100644 (file)
index 0000000..41e3cef
--- /dev/null
+++ b/copyright
@@ -0,0 +1,27 @@
+TinyOS is copyright by various contributors over time.  Please see the
+copyright notices in each directory and/or file for more information.  TinyOS
+community software is usually released under the TinyOS license, which is
+provided for convenience below.
+
+---
+
+Copyright (c) <date> <contributor>.  All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and
+its documentation for any purpose, without fee, and without written
+agreement is hereby granted, provided that the above copyright
+notice, the following two paragraphs and the author appear in all
+copies of this software.
+
+IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+IF <CONTRIBUTOR> HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+<CONTRIBUTOR> SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
+PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND <CONTRIBUTOR>
+HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ENHANCEMENTS, OR MODIFICATIONS."
diff --git a/patches/001_tinyos-sh.dpatch b/patches/001_tinyos-sh.dpatch
new file mode 100755 (executable)
index 0000000..4663942
--- /dev/null
@@ -0,0 +1,55 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 001_tinyos-sh.dpatch by  <smckown@stevex2>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Sourced file that sets up TinyOS environment, with per-user persistence
+
+@DPATCH@
+
+diff -urN tinyos-2.1.0.orig/tinyos.sh tinyos-2.1.0/tinyos.sh
+--- tinyos-2.1.0.orig/tinyos.sh        1969-12-31 17:00:00.000000000 -0700
++++ tinyos-2.1.0/tinyos.sh     2008-08-27 13:28:48.000000000 -0600
+@@ -0,0 +1,43 @@
++#! /usr/bin/env bash
++# Here we setup the environment
++# variables needed by the tinyos 
++# make system
++
++TOSBASE=/opt/tinyos
++
++# $1 is a directory or tos version number
++# returns a fully rooted and valid TOSROOT
++getdir()
++{
++    if [ -d "$1" -a -d "$1/tos" ]; then
++      echo "$1"
++    elif [ -d "$TOSBASE/$1" -a -d "$TOSBASE/$1/tos" ]; then
++      echo "$TOSBASE/$1"
++    fi
++}
++
++# Clear TOS environment
++if [ -n "$TOSROOT" ]; then
++    CLASSPATH=$(echo $CLASSPATH | sed -e "s|:$TOSROOT/support/sdk/java||")
++fi
++unset TOSDIR MAKERULES
++
++# Set TOS environment
++TOSROOT=$(getdir "$1")
++if [ -z "$TOSROOT" ]; then
++    TOSROOT=$(cat ~/.tosrc 2>/dev/null)
++fi
++
++if [ -z "$TOSROOT" ]; then
++    echo "No TinyOS source directory found.  Usage:" >&2
++    echo "source /opt/tinyos/tinyos.sh [<version> | <directory>]" >&2
++    export TOSROOT TOSDIR MAKERULES
++else
++    echo "Setting up for TinyOS source in $TOSROOT"
++    echo "$TOSROOT" > ~/.tosrc
++    TOSDIR="$TOSROOT/tos"
++    CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java
++    MAKERULES="$TOSROOT/support/make/Makerules"
++    export TOSROOT TOSDIR CLASSPATH MAKERULES
++fi
++unset TOSBASE tmp
diff --git a/patches/002_distfiles.dpatch b/patches/002_distfiles.dpatch
new file mode 100644 (file)
index 0000000..ee6b90b
--- /dev/null
@@ -0,0 +1,26 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 003_distfiles.dpatch by  <smckown@stevex2>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch tinyos.files to exclude debian build related files
+
+@DPATCH@
+
+--- tinyos-2.1.0/tools/release/tinyos.files    2008-09-02 08:26:42.000000000 -0600
++++ tinyos-2.1.0/tools/tinyos.files    2008-09-02 08:18:52.000000000 -0600
+@@ -4,6 +4,10 @@
+ cd ../..
+ rm -rf $NAME-$VERSION
+ tools/release/extractor $NAME-$VERSION <<'EOF' | gzip >../$NAME-$VERSION.tar.gz
++!^./tinyos.sh
++!^./debian
++!^./builddir
++!^./(patch|configure|build|install)-stamp
+ !^./apps/tests/(eyesIFX|mica2|msp430|rf230|mts300|telosb)
+ !^./apps/tests/(RadioStress|TestAlarm|TestAM|TestAMOnOff|TestAMService|TestBroadcast|TestCollection|TestLocalTime|TestMultihopLqi|TestOscilloscopeLQI|TestPowerManager|TestPowerup|TestPrintf|TestRadioPM|TestScheduler|TestSerialBandwidth|TestSharedResource|TestSimTimers|TestSleep|TestTimerSync|TestTreeRouting|TestTrickleTimer|TestTymo)
+ !^/apps/(BlinkAlarm|BlinkMSP430|BlinkTask|BlinkToRadio|Test|TestADC|TestArbiter|TestCC2420|TestRadio|TestSPI|TestScheduler|TestSchedulerTemp|TestSerial)
+@@ -45,4 +49,3 @@
+ ./tests/TestSerial/TestSerial.class
+ ./RadioCountToLeds/RadioCountMsg.class
+ EOF
+-rm -rf $NAME-$VERSION
diff --git a/patches/00list b/patches/00list
new file mode 100644 (file)
index 0000000..afd1311
--- /dev/null
@@ -0,0 +1,2 @@
+001_tinyos-sh.dpatch
+002_distfiles.dpatch
diff --git a/rules b/rules
new file mode 100755 (executable)
index 0000000..e46391f
--- /dev/null
+++ b/rules
@@ -0,0 +1,154 @@
+#!/usr/bin/make -f
+# debian/rules file - for tinyos-tools
+# Based on sample debian/rules file - for GNU Hello (1.3).
+# Copyright 1994,1995 by Ian Jackson.
+# Copyright 1998-2007 James Troup
+# I hereby give you perpetual unlimited permission to copy,
+# modify and relicense this file, provided that you do not remove
+# my name from the file itself.  (I assert my moral right of
+# paternity under the Copyright, Designs and Patents Act 1988.)
+# This file may have to be extensively modified
+
+include /usr/share/dpatch/dpatch.make
+
+package = tinyos
+toolspkg = $(package)-tools
+srcpkg = $(package)-source
+msppkg = tinyos-msp430
+avrpkg = tinyos-avr
+
+STRIP  = strip --strip-unneeded --remove-section=.comment --remove-section=.note
+
+install_dir    = install -d -m 755
+install_file   = install -m 644
+install_script = install -m 755
+install_binary = install -m 755 -s
+
+DISTRIBUTION := $(shell lsb_release -is)
+
+
+# At the current time (20080827) tinyos-tools will not build from a separate
+# build directory.
+#
+# For now, the solution is quite hackish: copy the source directory to the
+# build directory before running configure.
+tempdir := $(shell tempfile $(PACKAGE))
+version := $(shell head -1 debian/changelog | sed -e s'|^.*(\([^-)]*\).*$$|\1|')
+
+configure-stamp: patch-stamp
+       $(checkdir)
+       rm -rf configure-stamp builddir $(tempdir)
+       cp -a . $(tempdir)
+       rm -rf $(tempdir)/debian
+       mv -f $(tempdir) builddir
+       cd builddir/tools && ./Bootstrap && ./configure --prefix=/usr
+       touch $@
+
+
+build: build-stamp
+build-stamp: configure-stamp
+       $(checkdir)
+       $(MAKE) -C builddir/tools
+       touch $@
+
+
+install: install-stamp
+install-stamp: checkroot build-stamp
+       $(checkdir)
+       rm -rf debian/$(toolspkg)
+       $(install_dir) debian/$(toolspkg)
+       $(MAKE) -C builddir/tools prefix=$$(pwd)/debian/$(toolspkg)/usr \
+               mandir=$$(pwd)/debian/$(toolspkg)/usr/share/man install
+       touch $@
+
+
+binary-indep: checkroot build install
+       : # Nothing to do
+
+
+binary-arch: checkroot build install
+       $(checkdir)
+       : # install maintainer scripts
+       $(install_dir) debian/$(toolspkg)/DEBIAN
+       : # install docs
+       $(install_dir) debian/$(toolspkg)/usr/share/doc/$(toolspkg)/
+       $(install_file) debian/changelog \
+               debian/$(toolspkg)/usr/share/doc/$(toolspkg)/changelog.Debian
+       $(install_file) debian/copyright \
+               debian/$(toolspkg)/usr/share/doc/$(toolspkg)/
+       $(install_file) tools/README debian/README.Debian \
+               debian/$(toolspkg)/usr/share/doc/$(toolspkg)/
+       : # Remove unnecessary files installed
+       : # Create links
+       : # Compress stuff that needs it
+       gzip -9 debian/$(toolspkg)/usr/share/man/man1/*
+       find debian/$(toolspkg)/usr/share/doc/$(toolspkg) -type f \
+               ! -name copyright | xargs gzip -9
+       : # Finish it all up
+       find debian/$(toolspkg) -type f | xargs file | grep ELF | \
+               cut -d: -f 1 | xargs dpkg-shlibdeps
+       dpkg-gencontrol -isp -Pdebian/$(toolspkg) -p$(toolspkg)
+       chown -R root:root debian/$(toolspkg)
+       chmod -R go=rX  debian/$(toolspkg)
+       dpkg --build debian/$(toolspkg) ..
+
+       : # Build the tinyos-source package
+       rm -rf debian/$(srcpkg)
+       $(install_dir) debian/$(srcpkg)/DEBIAN
+       $(install_dir) debian/$(srcpkg)/opt/tinyos
+       chmod u+x tools/release/extractor
+       tools/release/extractor debian/$(srcpkg)/opt/tinyos/$(version) < \
+               tools/release/tinyos.files >/dev/null
+       dpkg-gencontrol -isp -Pdebian/$(srcpkg) -p$(srcpkg)
+       chown -R root:root debian/$(srcpkg)
+       chmod -R go=rX  debian/$(srcpkg)
+       dpkg --build debian/$(srcpkg) ..
+
+       : # Build the tinyos package too
+       rm -rf debian/$(package)
+       $(install_dir) debian/$(package)/DEBIAN
+       $(install_dir) debian/$(package)/opt/tinyos
+       $(install_file) tinyos.sh debian/$(package)/opt/tinyos
+       dpkg-gencontrol -isp -Pdebian/$(package) -p$(package)
+       chown -R root:root debian/$(package)
+       chmod -R go=rX  debian/$(package)
+       dpkg --build debian/$(package) ..
+
+       : # Build tinyos-msp430 dummy package
+       rm -rf debian/tmp
+       $(install_dir) debian/tmp/DEBIAN
+       dpkg-gencontrol -isp -Pdebian/tmp -p$(msppkg)
+       chown -R root:root debian/tmp
+       chmod -R go=rX  debian/tmp
+       dpkg --build debian/tmp ..
+
+       : # Build tinyos-avr dummy package
+       rm -rf debian/tmp
+       $(install_dir) debian/tmp/DEBIAN
+       dpkg-gencontrol -isp -Pdebian/tmp -p$(avrpkg)
+       chown -R root:root debian/tmp
+       chmod -R go=rX  debian/tmp
+       dpkg --build debian/tmp ..
+
+
+binary: binary-indep binary-arch
+
+
+clean: unpatch
+       $(checkdir)
+       -rm -rf debian/tmp debian/$(package) debian/$(toolspkg) debian/$(srcpkg) builddir
+       -rm -fr debian/patched debian/files* debian/substvars
+       -rm -f *-stamp
+
+
+define checkdir
+        test -d tos/chips -a -f debian/rules
+endef
+
+
+checkroot:
+       $(checkdir)
+       test root = "`whoami`"
+
+
+.PHONY: binary clean checkroot