2
1
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?
Could you simplify that a little? It's a bit confusing to understand. – digitxp – 2010-09-08T03:18:16.563
I've rewritten the question. – Xiè Jìléi – 2010-09-08T06:59:23.570
I don't understand what you're trying to do here.
DESTDIR
andprefix
are compile-time settings and specific to a particular way of writing a makefile. They have nothing to do withpostinst
which is executed when the package is installed. – Gilles 'SO- stop being evil' – 2010-09-08T07:20:01.717For example, if I want to change config file
$(DESTDIR)/etc/myconfig
, thoughdebuild
always setDESTDIR
to empty string at build time, but it can be other values. One resolution is, adddebian
/ toSUBDIRS
inMakefile.am
, and renamedebian/postinst
todebian/postinst.in
and refer to@DESTDIR@/etc/myconfig
. But I deem it's not recommended, sincedebian/*
is not a part of the source. Though,DESTDIR
andprefix
are compile-time, butdebian/
is not involved in the compilation. – Xiè Jìléi – 2010-09-08T13:14:31.217