while that worked flawlessly, there might be problems on a subsequent build in the same tree, if you were renaming directories.
To fix that, I added (to the aforementioned) an override_dh_autoreconf sequence: post_patch: [ -d src/new-dir ] || mv src/orig-dir src/new-dir override_dh_autoreconf: post_patch dh_autoreconf override_dh_auto_clean: if [ -d src/orig-dir -a -d debian/tmp ]; then debian/rules post_patch; fi dh_auto_clean Hope that helps anyone :) On Wed, Oct 10, 2012 at 4:37 AM, Jasmine Hassan <jasmine.a...@gmail.com>wrote: > Hi, > > Has this been reported as a bug yet? > > The only thing I found to work is: > > pre_unpatch: > [ -f orig.c ] || mv new.c orig.c > ... > > override_dh_clean: pre_unpatch > dh_clean > > # This forces the rename right before dpkg-source --after-build > override_dh_builddeb: pre_unpatch > dh_builddeb > > Best, > Jasmine >