[asterisk-bugs] [Asterisk 0008555]: even though configure is ran with --prefix, make install tries to mkdir /var/lib/asterisk

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Sep 14 15:14:38 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=8555 
====================================================================== 
Reported By:                barthek
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   8555
Category:                   Core/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4 
SVN Revision (number only!): 48373 
Disclaimer on File?:        No 
Request Review:              
====================================================================== 
Date Submitted:             12-10-2006 11:54 CST
Last Modified:              09-14-2007 15:14 CDT
====================================================================== 
Summary:                    even though configure is ran with --prefix, make
install tries to mkdir /var/lib/asterisk
Description: 
as above,
i ran configure --prefix=/destdir, then make menuselect, make.

when make install is ran it fails with obvious mistake.

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0008605 ./configure --prefix... ignored.
related to          0007057 [branch] define paths in a more autocon...
====================================================================== 

---------------------------------------------------------------------- 
 leedm777 - 09-14-07 15:14  
---------------------------------------------------------------------- 
It's interesting that the issues that get so much discussion are the ones
that deserve the least amount of discussion.  This is not a bug in this
behavior of configure.  It may violate the principal of least surprise, but
that's not a bug.

According to the GNU Coding Standards
(http://www.gnu.org/prep/standards/html_node/Directory-Variables.html#Directory-Variables):
  The default value of prefix should be /usr/local.
  [$(sysconfdir)] should normally be /usr/local/etc, but write it as
$(prefix)/etc. (If you are using Autoconf, write it as
‘@sysconfdir@’.)
  $(localstatedir) should normally be /usr/local/var, but write it as
$(prefix)/var. (If you are using Autoconf, write it as
‘@localstatedir@’.)

Most apps do, in fact, follow this convention.  But this is mostly because
they use autoconf/automake and don't bother messing with the variables. 
They leave it to the packager/builder to ./configure --prefix=/usr
--sysconfdir=/etc --localstatedir=/var.  For example, the default
%configure macro handles this for RPM builds.

But there's nothing in the Asterisk docs that states any desire to adhere
to the GNU Coding Standard.  Even if they did, these are shoulds, not
musts.

There is at least one well known package that does something similar to
asterisk: glibc.  Look at
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/configure.in?annotate=1.66.2.3&cvsroot=glibc,
starting at line 156.  If $prefix is /usr, and $sysconfdir is /usr/etc,
then sysconfdir is set to /etc.

A reasonable compromise might be to only reset sysconfdir, localstatedir
and mandir when $prefix is /usr.  This is consistent with how glibc
operates, so there's precedence.  If someone uses --prefix to move the
install to somewhere other than /usr, things work like they do with any
other package.

If there is a bug, it's in ./configure --help's output.  This, sadly, is
not uncommon, given how inflexible autoconf can be about this sort of
thing. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-14-07 15:14  leedm777       Note Added: 0070576                          
======================================================================




More information about the asterisk-bugs mailing list