mrdvt92 has asked for the wisdom of the Perl Monks concerning the following question:
PerlMonks,
I have a package that uses "profiles" to connect to databases, web services and file systems. A profile is "Production", "Alpha", "Beta" etc... There is a master INI file that maps the profiles to their correct databases and services.
my $db=MY::Profiles->new->profile("Production")->database; #isa DBIx +::Array my $ws=MY::Profiles->new->profile("Production")->webservice;
I would like to be able to add this INI file in my distribution so that it is installed by the normal "perl Makefile.PL;make;make install" process so that we can build RPMs and PPMs that have the INI file.
I've done some research and it appears that INI files should be in /etc (sysconfdir) on Linux-like systems and should be in the Windows folder on Windows-like systems. These paths are easy enough to get from Sys::Path->sysconfdir and Win32::GetFolderPath(Win32::CSIDL_WINDOWS). Note: I do not think the INI file should go in c:\Perl\etc (Sys::Path->sysconfdir in Windows) since it is also used by non-Perl applications.
Does anyone know how to get this to work?
In my research, it appears that neither Module::Install nor ExtUtils::MakeMaker support this out of the box but there are 100s of options.
This package Module::Build::SysPath seams to be the closest to what I need but, it puts the Windows INI file in what I consider the "wrong" path in Win32.
Thanks,
Mike
mrdvt92
http://www.perlmonks.org/?node_id=728353
http://search.cpan.org/~mrdvt/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to install INI file cross platform with Makefile.PL?
by Khen1950fx (Canon) on Sep 05, 2011 at 00:22 UTC |