- perl -i.bak -pe 's|^#(include ext/automake\.mk)$|$1|' Makefile.am
- perl -i.bak -pe 's|^#(m4_include\(ext/configure\.m4\))$|$1|' configure.ac
+ echo 'include ext/automake.mk' > ext.mk
+ echo 'm4_include([ext/configure.m4])' > ext.m4
+ cat debian/control.in ext/debian/control.in > debian/control
+ for d in $(cd ext/debian && git ls-files --exclude-from=debian/dontlink)
+ do
+ test -e debian/$d || ln -s ../ext/debian/$d debian/$d
+ if ! fgrep -q $d debian/.gitignore; then
+ echo "Adding $d to debian/.gitignore"
+ (cat debian/.gitignore && printf '/%s' "$d") \
+ | LC_ALL=C sort > tmp$$ \
+ && mv tmp$$ debian/.gitignore
+ fi
+ done