pcp
[Top] [All Lists]

Re: rpm and perl and packaging question

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: rpm and perl and packaging question
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Thu, 01 Aug 2013 13:32:02 +1000
Cc: PCP Mailing List <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <y0mli4nk4za.fsf@xxxxxxxx>
References: <51F767EB.3060008@xxxxxxxxxxxxxxxx> <y0mli4nk4za.fsf@xxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7
On 31/07/13 09:22, Frank Ch. Eigler wrote:

Ken McDonell <kenj@xxxxxxxxxxxxxxxx> writes:

Considering that it is a genuine dependency, and assists
administrators on sufficiently CPAN-friendly distributions, we
shouldn't just disable this everywhere.  Perhaps it could be
an RPM-level conditional, which either preserves the normal
perl prereq-detection, or suppresses it (but calls CPAN to
install dependencies in the %pre-install scriptlet).

I have a workaround for the rpm auto-generated Requires dependency ... see my last take.

This allows us to build and ship and install the
pcp-import-sheet2pcp rpms without the rpm-generated dependency on the perl-Spreadsheet-Read rpm.

I'd vote against calling CPAN inside a %pre-install scriplet because CPAN
- may require interactive responses from the user
- needs a public internet connection
- downloads potentially a lot of stuff from cpan

Rather, I think we should do our own pre-requisite checking in these cases, so replace

use Spreadsheet::Read;

with

eval
{
    require Spreadsheet::Read;
    Spreadsheet::Read->import();
};

if ($@) {
die "Error: Perl Module Spreadsheet::Read needs to be installed either from\nyour distro or downloaded and installed from CPAN\n";
}

<Prev in Thread] Current Thread [Next in Thread>