Bug 702769

Summary: With GNU autoconf produced configure scripts are probably violating the FHS regarding "localstatedir"
Product: [Fedora] Fedora Reporter: smurffit <smurffit>
Component: autoconfAssignee: Karsten Hopp <karsten>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: bugs.michael, karsten, smurffit
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-16 13:43:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description smurffit 2011-05-06 23:51:13 UTC
Description of problem:
Regarding the GNU autoconf documentation is the default prefix-path used in generated Makefiles "/usr/local", if not defined otherwise.

Although that seems to be the correct location for unpackaged software, the substitution of "localstatedir" to [PREFIX/var] - which will result in "/usr/local/var" - is very likely a violation of the current Filesystem Hierachy Standard version 2.3.


Version-Release number of selected component (if applicable):
Name        : autoconf                     Relocations: (not relocatable)
Version     : 2.66                              Vendor: Fedora Project
Release     : 2.fc14                        Build Date: Tue 06 Jul 2010 09:26:27 AM CEST
Install Date: Sat 02 Apr 2011 04:49:27 PM CEST      Build Host: xb-01.phx2.fedoraproject.org
Group       : Development/Tools             Source RPM: autoconf-2.66-2.fc14.src.rpm
Size        : 2989492                          License: GPLv2+ and GFDL
Signature   : RSA/SHA256, Tue 27 Jul 2010 11:37:06 AM CEST, Key ID 421caddb97a1071f
Packager    : Fedora Project
URL         : http://www.gnu.org/software/autoconf/
Summary     : A GNU tool for automatically configuring source code


How reproducible:
Always with the current version 2.66 and probably with all earlier versions.


Steps to Reproduce:
1. Get any tarball based on Autoconf 2.66 (i.e. yumdownloader --source autoconf), untar and type ./configure --help.
2. If that isn't enough proceed with an actual ./configure && make and check the Makefile and/or configure.log
  
Actual results:
configure produces something like:
localstatedir='${prefix}/var'
prefix='/usr/local'

Expected results:
Accorind to /usr/lib/rpm/redhat/macros from the redhat-rpm-config 9.1.0 package: %_localstatedir         /var


Additional info:
Source FHS 2.3 about /usr/local: http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY

GNU Autoconf Manual about the installation-paths: http://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables

Thank you for your time.
Kind regards.

Comment 1 Michael Schwendt 2011-06-30 07:59:25 UTC
* Autoconf is configurable. It defaults to expanding most of its installation directories based on ${prefix}. That way you can create local install trees for a program by simply changing just the --prefix arg.

* To adjust to the FHS, a config.site script can be set up by the Autoconf user. The bottom half of section 1.5.8 comments on that and on the FHS:
http://www.gnu.org/software/autoconf/manual/autoconf.html#Site-Defaults

* When building packages with RPM, typically the %configure macro is used ("rpm --eval %configure"), which alters --localstatedir and --sharedstatedir.

Comment 2 smurffit 2011-07-04 09:50:01 UTC
(In reply to comment #1)

Thank you for your comment. To be honest, I'm not very experienced with that material, however, I'll try to comment your reply.

> * Autoconf is configurable. It defaults to expanding most of its installation
> directories based on ${prefix}. That way you can create local install trees for
> a program by simply changing just the --prefix arg.

I understand, that Autoconf is meant to be flexible and that the --prefix arg is supposed to be a feature. However, as far as I can see, are all prefixed-directories correct - except the /var dir. Overwriting the --prefix wouldn't solve the problem, because the other values would then be wrong and overwriting the --localstatedir everytime isn't a real solution neither. Based on that situation my primary questions are:

1. why should I change the prefix, if it's correct except for one value / why is overwriting the localstedir required in most cases?
2. the main-purpose of autoconf is making things easier, so in my opinion should the _default_ values be as common as possible


> * To adjust to the FHS, a config.site script can be set up by the Autoconf
> user. The bottom half of section 1.5.8 comments on that and on the FHS:
> http://www.gnu.org/software/autoconf/manual/autoconf.html#Site-Defaults

Thanks for the link. I'm not sure if I got the concept correct, but why should I overwrite autoconf-paths, if finding platform-dependend paths is one of autoconfs tasks? That's the core-point of that ticket. IMHO should autoconf be FHS-compilant by default. Hard-coding paths or workarounding path-related problems are not the job of the developer.

> * When building packages with RPM, typically the %configure macro is used ("rpm
> --eval %configure"), which alters --localstatedir and --sharedstatedir.

Yes, RPM and DEB handle the paths correct. However, if I'm going to provide a tarball I must either give the user a hint about the wrong path and the required args or have trust in his knowledge or start implementing workarounds (which, in my opinion includes writing scripts or other files to find a correct path or specify a default).

Conclusion: In my opinion should the default be at least basically correct (which, I guess would mean a localstatedir w/o a prefix (afaik is /usr/local/var only common on *BSD and even they put their stuff to /var while keeping configs in /usr/local/etc)).

regards

Comment 3 Fedora End Of Life 2012-08-16 13:43:49 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping