[Home]

Summary:ASTERISK-08319: even though configure is ran with --prefix, make install tries to mkdir /var/lib/asterisk
Reporter:barthek (barthek)Labels:
Date Opened:2006-12-10 11:54:30.000-0600Date Closed:2011-06-07 14:03:03
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Addons/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:as above,
i ran configure --prefix=/destdir, then make menuselect, make.

when make install is ran it fails with obvious mistake.


****** ADDITIONAL INFORMATION ******

doli@1g ~/progz/asterisk-src $ make install
menuselect/menuselect --check-deps   menuselect.makeopts
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `depend'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
if [ x`/usr/bin/id -un` = xroot ]; then CFLAGS="-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -march=i686 " sh build_tools/mkpkgconfig /usr/lib/pkgconfig; fi
mkdir -p /var/lib/asterisk/static-http
mkdir: cannot create directory `/var/lib/asterisk': Permission denied
make: *** [datafiles] Error 1
Comments:By: Jason Parker (jparker) 2006-12-11 09:54:51.000-0600

I ran into this as well, just yesterday.  The problem also occurs during `make samples` with /etc/ - the fix will probably be to modify makeopts.in, to add a ${prefix} before those two paths.

By: Jason Parker (jparker) 2006-12-11 12:38:45.000-0600

Per kpfleming, this isn't really a bug.  The trouble is that /etc/ should ignore --prefix, as that isn't what it's used for.  --prefix changes binary/module install dirs, but config stuff is still supposed to be in the same location.

By: Jason Parker (jparker) 2006-12-20 13:02:53.000-0600

Closing, since this isn't actually an issue.

If you'd like to install configs and such to another dir, see ./configure --help

By: barthek (barthek) 2006-12-21 06:16:22.000-0600

but you are wrong.

it is not an issue of installing samples.

i did 'make install' to install the software itself.

most of the stuff is installed to the place specified by --prefix
but apparently not everything of it.

as per config files - I'd say most of the opensource software using automake/autoconf suite assumes that if you specify --prefix, then EVERY single piece of the software should go into that specified directory. mysql & apache to name only two major ones do.



By: Jason Parker (jparker) 2007-03-21 13:29:37

--sysconfdir=DIR       read-only single-machine data
--localstatedir=DIR    modifiable single-machine data


If you do a `./configure --prefix=/usr` on other applications, it will most certainly not put config files and local state files in /usr/etc/ and /usr/var/


Closing.

By: barthek (barthek) 2007-03-21 13:48:38

I am sorry but what is your opinion based on?
Because you certainly are wrong about this.

To name just a few applications that put ALL of their
stuff in the subtrees of the directory specified
with --prefix (including ${prefix}/var/run etc stuff)
- gcc (isnt it notable example??)
- ssh
- mysql
- apache
- php
- GNU make

and if you look at default autoconf macros you'd see that
sysconfdir's and localstatedir's default paths are relative to prefix
set:

...
exec_prefix='${prefix}'
...
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'

what else do you need to be convinced ?

Why do you resist ? :)



By: Dan Maroff (djm) 2007-06-13 14:07:13

In the Makefile you'll see the following on line 95 ...

#DESTDIR?=/tmp/asterisk

Uncomment DESTDIR, remove '?' and put in your chosen prefix directory.
run make install again.  Worked for me.

By: Russell Bryant (russell) 2007-06-29 13:34:36

As qwell already indicated, it is this way on purpose.  If you'd like to debate it further, feel free to do so on the asterisk-dev mailing list.  

As far as this issue is concerned, I'm closing it out as not a bug since it is doing exactly what we wanted it to do.

By: barthek (barthek) 2007-06-30 05:30:45

russel,

what qwell wrote is based on wrong assumption:

"If you do a `./configure --prefix=/usr` on other applications, it will most certainly not put config files and local state files in /usr/etc/ and /usr/var/"

this certainly does not work this way (see my previous comments, or maybe give me an example of notable autoconf application that does that the way qwell thinks)

I do understand your point that this is not to be treated as a bug.

But if the devs decided to use autoconf why wouldnt it be done the way all other software projects do so the users would not get confused ?

wouldnt it be possible to look at this issue in a more user-friendly way?

it seems to cause a lot of misunderstandings and would probably save you a lot of time managing duplicate bug reports :)



By: Michiel van Baak (mvanbaak) 2007-09-08 06:12:23

./configure --enable-dev-mode --prefix=/tmp/asterisk --sysconfdir=/tmp/astconf --localstatedir=/tmp/aststate

That will install the configs in /tmp/astconf, the statichttp and soundfiles etc in /tmp/aststate and the binaries/modules in /tmp/asterisk.

Again, this is not a bug but it's how autoconf is designed to be used.
Closing again.

By: barthek (barthek) 2007-09-08 07:08:28

i find it really sad your total ignorance of the facts and inability to discuss the issue.

as per examples i have given and per examples given by other users (see for example related bug 8605) - the default way sysconfdir & localstatedir are created is by means of expanding PREFIX.

how come you claim its the way autoconf is designed to be used?

and on top of that here is output of configure --help from ASTERISKs configure script:

--sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
--localstatedir=DIR    modifiable single-machine data [PREFIX/var]

the way you treat input from asterisk users on this issue is really shameful.



By: Dave Lee (personal) (leedm777) 2007-09-14 15:14:37

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.

By: Tilghman Lesher (tilghman) 2007-10-26 10:24:30

Reclosing.  Discuss on -dev mailing list if you feel this merits further response.