# 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
# 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|')
+version := $(shell head -1 debian/changelog | sed -e s'|^.*(\(.*\)-.*).*$$|\1|')
+tosver := $(shell echo $(version) | sed -e s'|-.*||')
+tmiver := $(shell echo $(version) | sed -e s'|^.*-||')
+
+debian-control: debian/control.in
+ sed -e 's/RELEASE-VERSION/$(version)/g' < $^ | \
+ sed -e 's/TOS-VERSION/$(tosver)/g' | \
+ sed -e 's/TMI-VERSION/$(tmiver)/g' > debian/control
-configure-stamp: patch-stamp
+configure-stamp:
$(checkdir)
rm -rf configure-stamp $(dtmp)/builddir $(tempdir)
$(install_dir) $(dtmp)
tools/release/extractor $(dtmp)/$(srcpkg)/opt/tinyos/$(version) < \
tools/release/tinyos.files >/dev/null
$(install_dir) $(dtmp)/$(srcpkg)/usr/share/lintian/overrides
- $(install_file) debian/$(srcpkg).lintian-overrides \
- $(dtmp)/$(srcpkg)/usr/share/lintian/overrides/$(srcpkg)
- $(install_dir) $(dtmp)/$(srcpkg)/usr/share/doc/$(srcpkg)/
+ sed -e 's/RELEASE-VERSION/$(version)/g' \
+ < debian/$(srcpkg).lintian-overrides \
+ > $(dtmp)/$(srcpkg)/usr/share/lintian/overrides/$(srcpkg)-$(version)
+ $(install_dir) $(dtmp)/$(srcpkg)/usr/share/doc/$(srcpkg)-$(version)/
+ $(install_file) debian/changelog \
+ $(dtmp)/$(srcpkg)/usr/share/doc/$(srcpkg)-$(version)/changelog.Debian
$(install_file) debian/copyright \
- $(dtmp)/$(srcpkg)/usr/share/doc/$(srcpkg)/
+ $(dtmp)/$(srcpkg)/usr/share/doc/$(srcpkg)-$(version)/
$(install_file) tools/README debian/README.Debian \
- $(dtmp)/$(srcpkg)/usr/share/doc/$(srcpkg)/
- dpkg-gencontrol -isp -P$(dtmp)/$(srcpkg) -p$(srcpkg)
+ $(dtmp)/$(srcpkg)/usr/share/doc/$(srcpkg)-$(version)/
+ find $(dtmp)/$(srcpkg)/usr/share/doc/$(srcpkg)-$(version) -type f \
+ ! -name copyright | xargs gzip -9
+ dpkg-gencontrol -isp -P$(dtmp)/$(srcpkg) -p$(srcpkg)-$(version)
chown -R root:root $(dtmp)/$(srcpkg)
chmod -R go=rX $(dtmp)/$(srcpkg)
dpkg --build $(dtmp)/$(srcpkg) ..
binary: binary-indep binary-arch
-clean: unpatch
+clean: debian-control
$(checkdir)
-rm -rf $(dtmp)
- -rm -fr debian/patched debian/files* debian/substvars
+ -rm -fr debian/files* debian/substvars
-rm -f *-stamp
test root = "`whoami`"
-.PHONY: binary clean checkroot
+.PHONY: binary clean checkroot debian-control