[asterisk-dev] updated: Re: DESTDIR vs INSTALL_PATH ?

Luigi Rizzo rizzo at icir.org
Sun Dec 9 10:15:24 CST 2007


On Sun, Dec 09, 2007 at 10:40:39AM -0500, Simon Perreault wrote:
> On Sunday 09 December 2007 10:25:29 Luigi Rizzo wrote:
> > 1. comment out the [directories] section in the generated asterisk.conf
> > because one can already make use of the default created at build time.
> >    This can be changed easily by turning the section into a prototype:
> >
> > 	-	echo "[directories]" ; \
> > 	+	echo "[directories](!) ; remove the (!) to enable this" ; \
> 
> +1
> 
> > 2. (less important because it can be fixed from the command line)
> >    if DESTDIR is not set, inherit the value from INSTALL_PATH
> >
> > 	-#DESTDIR?=/tmp/asterisk
> > 	DESTDIR?=${INSTALL_PATH}
> 
> No, this does not reflect the common usage of DESTDIR. Assuming INSTALL_PATH 
> contains what is passed to --prefix, ...

Well, this is not the way INSTALL_PATH is used in asterisk: the variable is
only set from the command line, not from configure or other places,
and it is only used in build_tools/make_defaults_h as follows:

	#define AST_CONFIG_DIR "${INSTALL_PATH}${ASTETCDIR}"
	#define AST_RUN_DIR    "${INSTALL_PATH}${ASTVARRUNDIR}"
	#define AST_SOCKET     "${INSTALL_PATH}${ASTVARRUNDIR}/asterisk.ctl"
	#define AST_PID        "${INSTALL_PATH}${ASTVARRUNDIR}/asterisk.pid"
	#define AST_MODULE_DIR "${INSTALL_PATH}${MODULES_DIR}"
	#define AST_SPOOL_DIR  "${INSTALL_PATH}${ASTSPOOLDIR}"
	#define AST_VAR_DIR    "${INSTALL_PATH}${ASTVARLIBDIR}"
	#define AST_DATA_DIR   "${INSTALL_PATH}${ASTDATADIR}"
	#define AST_LOG_DIR    "${INSTALL_PATH}${ASTLOGDIR}"
	#define AST_AGI_DIR    "${INSTALL_PATH}${AGI_DIR}"
	#define AST_KEY_DIR    "${INSTALL_PATH}${ASTDATADIR}/keys"
	#define AST_DB         "${INSTALL_PATH}${ASTVARLIBDIR}/astdb"
	#define AST_TMP_DIR    "${INSTALL_PATH}${ASTSPOOLDIR}/tmp"

	#define AST_CONFIG_FILE "${INSTALL_PATH}${ASTCONFPATH}"

	#define AST_SOUNDS     "${INSTALL_PATH}${ASTDATADIR}/sounds"
	#define AST_IMAGES     "${INSTALL_PATH}${ASTDATADIR}/images"

The other variables (ASTETCDIR, MODULES_DIR, ...) already contain --prefix 
or --libdir or --other-configure-options in some indirect way, and INSTALL_PATH
is only prepended.

Where do you think DESTDIR?=${INSTALL_PATH} gives something wrong ?
The only case would be when you want an empty DESTDIR and non-empty
INSTALL_PATH, which would cause the stuff to be installed in the
root, and the defaults to point to the wrong place. So do we need
to care about this case ?

Anyways, I am happy enough with fixing the content of asterisk.conf

cheers
luigi



More information about the asterisk-dev mailing list