The maintainer scripts of Debian package (debian/postinst, 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 DESTDIR="" and prefix=/usr.
Well, though it's uncommon to change DESTDIR or prefix to other values, but maybe it's useful.
For example, if my package is installed to /node-136/usr/local, where DESTDIR=/node-136 and 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?
DESTDIRandprefixare compile-time settings and specific to a particular way of writing a makefile. They have nothing to do withpostinstwhich is executed when the package is installed. – Gilles Sep 8 '10 at 7:20$(DESTDIR)/etc/myconfig, thoughdebuildalways setDESTDIRto empty string at build time, but it can be other values. One resolution is, adddebian/ toSUBDIRSinMakefile.am, and renamedebian/postinsttodebian/postinst.inand refer to@DESTDIR@/etc/myconfig. But I deem it's not recommended, sincedebian/*is not a part of the source. Though,DESTDIRandprefixare compile-time, butdebian/is not involved in the compilation. – Xiè Jìléi Sep 8 '10 at 13:14