Skip Menu |

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 11278
Status: open
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: julian [...] mehnle.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.2608
Fixed in: (no value)



Subject: No portable way to install files to /usr/local/lib or /usr/lib
Unfortunately there is no portable way to install files to the FHS-defined[1] paths /usr/local/lib or /usr/lib. Installing files in /usr/local/bin ("installsitebin") or /usr/bin ("installvendorbin") is easy (for the "bin" installation target), though. I guess Module::Build can't just hard-code the FHS paths, and I know Perl doesn't provide these lib paths, but perhaps Module::Build could take the "install*bin" paths and do s/bin/lib/ (thus: "/usr/bin" --> "/usr/lib", "/usr/local/bin" --> "/usr/local/lib") and then use that for a new "syslib" installation target. References: 1. http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLIBLIBRARIESFORPROGRAMMINGANDPA
Hi Julian, I'm not sure I understand the problem here. What specific set of installation directories would you like to install to? I'm pretty sure a combination of install_base and install_path settings should let you install to wherever you need to, but I'm confused by the word "portable" in your subject line. -Ken
Show quoted text
> I'm not sure I understand the problem here. What specific set of > installation directories would you like to install to?
On FHS-compliant systems, I'd like to install a file (meant to act as a system library) to /usr/local/lib or /usr/lib, depending on the setting of installdirs=(site|vendor). Other files should go to the usual installation targets (lib, bin, script, etc.). On other systems, sensible equivalent locations would be acceptable, but I guess the question what these equivalents would be is difficult to answer. The problem is that Perl's Config.pm doesn't provide any installation paths for system libraries (as opposed to Perl modules), so such paths would have to be synthesized. The $Config::Config{install(site|vendor)bin} =~ s/bin/lib/ thing I described earlier could be one possible way to do this. Another approach might be using one of the paths from $Config::Config{libpth} depending on installdirs=(site|vendor). To be more concrete, I am using Module::Build to install Courier::Filter, which includes a "pureperlfilter" executable. That executable isn't a regular program (which would go into /usr(/local)/bin, i.e. the "bin" installation target, depending on installdirs=(site|vendor)). It really is a plugin library for the Courier MTA and should go into /usr(/local)/lib (on FHS-compliant systems). Show quoted text
> I'm pretty sure a combination of install_base and install_path > settings should let you install to wherever you need to
Not really. install_base does something completely different from what I need. install_path would indeed enable me to redefine one of the existing installation targets (such as "script" or "arch") to point to /usr(/local)/lib. But what I am suggesting is to add another installation target for system (not Perl) libraries, "syslib", and Module::Build to figure out roughly appropriate paths for it.
Aha, I see. Thanks for the great explanation. Presumably a common use for this would also be to install *.so or *.a libraries. I think the main difficulty here, as you say, will be to figure out sensible defaults on all platforms. But I think we can do a pretty good first approximation and fix it up as time goes on - people can always use install_path to make corrections in the meantime. -Ken
Show quoted text
> Aha, I see. Thanks for the great explanation. Presumably a common > use for this would also be to install *.so or *.a libraries.
Right, I could have thought of that right away. :-) Show quoted text
> I think the main difficulty here, as you say, will be to figure out > sensible defaults on all platforms. But I think we can do a pretty > good first approximation and fix it up as time goes on - people can > always use install_path to make corrections in the meantime.
I think this is a good strategy.
Show quoted text
> > I think the main difficulty here, as you say, will be to figure out > > sensible defaults on all platforms. But I think we can do a pretty > > good first approximation and fix it up as time goes on - people can > > always use install_path to make corrections in the meantime.
I'm going to say that this is not Module::Build's problem but perl's. The setup and default installation locations for system files is the domain of Config.pm. However, there's nothing saying Module::Build cannot provide better support for custom installation locations or add in its own locations for things which Config.pm does not yet support. That way a user can set their own defaults in .modulebuildrc.