Re: [Module::Build] Data::Package::*, File::ShareDir and the 'auto/' subdir
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <ml...@th...> - 2006-03-28 04:53:59
|
Steffen Schwigon wrote: > Hi! > > Once upon a time, I already asked a similar question, where to install > non-perl files. I then solved it by installing files with an own > suffix into @INC near the module. > > This time I want to install rather large amounts of data. > > I could install them again beside the module, but in the mean time I > read about a "more official" sounding way in the documentation of the > modules > > Data::Package (::SQLite) > File::ShareDir > Module::Install::Share > > which would all solve this problem by installing data in the 'data/' > subdir near the module and finding them there at runtime. > > By looking into the source, it seems, Module::Install:Share simply > uses a MakeMaker variable INST_AUTODIR (which itself is just a > relative subdir to INST_LIBDIR). > > I want to use this way (i.e., Data::Package::SQLite with data files in > 'auto/'), but install them with Module::Build. > > ==> The question: > > How can I detect the 'auto/' subdir at install time and define > rules in Build.PL that install, for instance, all files from a > 'share/' subdir into the corresponding 'auto/' subdir? I'm not sure M::B should support this directly. It's not an official place to store data AFAICT, despite the documentation. The 'auto' directory lives in the *architecture-dependent* directory. This is where dynamic libs, auto-split files, .packlist files, etc go. Data files should be stored either next to the perl module file (or where the perl module would go if it's XS only) or they should be installed into '/usr/share/<dist-name>', '/usr/local/share/<dist-name>', 'C:\Program Files\<dist-name> or whatever is relevant for the chosen platform. (Still hoping that one day there will be a Probe::Locations that will give pointers to those locations, possibly using terminology of the FHS to query them.) I'm not saying we shouldn't provide accessors for the various install locations related to perl modules, etc., but it does not seem appropriate for your intended usage. If this is a standard that I'm not aware of, please do let me know. We do provide enough flexibility for you to set locations explicitly in your Build.PL or subclass, so you can use File::ShareDir to set them. See Module::Build::Cookbook, or feel free to ask here for some more examples or how-to. Regards, Randy. |