The maintainer scripts of Debian package (
debian/prerm, etc.) can optionally have the old/new-version argument, but there's no install dest dir argument. (See Debian Policy Manual)
My package is autotools-based (autoconf & automake), I guess
debuild configure the package with
Well, though it's uncommon to change
prefix to other values, but maybe it's useful.
For example, if my package is installed to
prefix=/usr/local, but how can I know it in the
debian/postinst script, so I can do the config munging to the correct installation?