waf "binary" is basically a Python script with an embedded bzip2 tarball unpacked at runtime. A more detailed explanation about it is available here.
repack-waf in debian/watch
repack-waf is a quick-and-dirty recipe to repack a source tarball with waf files. You can customise it, put in your debian directory, then modify debian/watch file as follows:
version=3 opts="[your normal options],\ dversionmangle=s/\+dfsg\d+$//" \ [etc] [etc] \ debian debian/repack-waf
How to unpack waf
Here is how to unpacked waf instances manually:
./waf --help &> /dev/null mv .waf-*/* . sed -i '/^#==>$/,$d' waf rmdir .waf-*
Also, you will need to remove generated .pyc files during clean phase in the expanded dirs (waflib, wafadmin,...):
find waflib wafadmin -name "*.pyc" -delete
You can add this to your debian/rules to repack the upstream tarball without waf:
# get-orig-source to drop waf upstream_version ?= $(shell dpkg-parsechangelog --show-field=Version | sed -rne 's/^([0-9.]+)(\+dfsg\d+)?.*$$/\1/p') dfsg_version = $(upstream_version)+dfsg1 pkg = $(shell dpkg-parsechangelog --show-field=Source) get-orig-source: uscan --noconf --force-download --rename --repack --download-current-version --destdir=. tar -xzf $(pkg)_$(upstream_version).orig.tar.gz mv $(pkg)-$(upstream_version) $(pkg)-$(dfsg_version) cd $(pkg)-$(dfsg_version) ; python waf --help > /dev/null mv $(pkg)-$(dfsg_version)/.waf-*/* $(pkg)-$(dfsg_version) sed -i '/^#==>$$/,$$d' $(pkg)-$(dfsg_version)/waf rmdir $(pkg)-$(dfsg_version)/.waf-* GZIP="-9fn" tar -czf $(pkg)_$(dfsg_version).orig.tar.gz $(pkg)-$(dfsg_version) rm -rf $(pkg)-$(dfsg_version)
for the uscan to work, you also need to demangle the destination file in debian/watch:
opts=dversionmangle=s/\+dfsg\d+$// \ http://some.site.org/some/path/foobar-(.+)\.tar\.gz
Don't forget that the files you've extracted from the archive are under the same license as the original waf file, even though they are now separated from the license statement. Add something similar to the following to your debian/copyright file:
Files: waf waflib/* Copyright: © 2005-2010 Thomas Nagy License: BSD-3-clause License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
It would be a good idea to check the years against the original waf file to ensure that you're presenting the correct copyright details.