Snippet for use of dpatch-edit-patch in alien-generated debian/rules

July 2009


In order to use dpatch-edit-patch in an alien-generated debian/rules Makefile, the following snippet may come in handy:

clean: clean-patched unpatch

clean-patched:
dh_testdir
dh_testroot
dh_clean -d
rm -rf debian/imaginary-package debian/files debian/substvars

patch: patch-stamp
patch-stamp:
dpatch apply-all
dpatch cat-all >patch-stamp

unpatch:
dpatch deapply-all
rm -rf patch-stamp debian/patched
    

As usual, mind the spaces!