Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Could you simplify that a little? It's a bit confusing to understand. – digitxp Sep 8 '10 at 3:18
I've rewritten the question. – Xiè Jìléi Sep 8 '10 at 6:59
I don't understand what you're trying to do here. DESTDIR and prefix are compile-time settings and specific to a particular way of writing a makefile. They have nothing to do with postinst which is executed when the package is installed. – Gilles Sep 8 '10 at 7:20
For example, if I want to change config file $(DESTDIR)/etc/myconfig, though debuild always set DESTDIR to empty string at build time, but it can be other values. One resolution is, add debian/ to SUBDIRS in, and rename debian/postinst to debian/ and refer to @DESTDIR@/etc/myconfig. But I deem it's not recommended, since debian/* is not a part of the source. Though, DESTDIR and prefix are compile-time, but debian/ is not involved in the compilation. – Xiè Jìléi Sep 8 '10 at 13:14
up vote 0 down vote accepted

I guess DESTDIR is not used in dh_make.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.