Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Packaging (http://www.linux-archive.org/fedora-packaging/)
-   -   Perl Question (http://www.linux-archive.org/fedora-packaging/269981-perl-question.html)

Conner Finlay 03-25-2009 02:58 PM

Perl Question
 
Hello list,

I have searched Google high and low, but I have not found an answer. I have a spec file that requires some perl modules, ie Net::IP, XML::Simple, etc. For all but one there is an RPM available for it. In the SPEC file I have them as Requires: perl(Net::IP) and the spec file builds fine(rpmbuild -ba -v) but when I go to install the RPM it complains about the missing perl modules. If I do a `yum install perl-xyz` and rebuild the SPEC file, it will not complain about the missing perl modules. How can I have the SPEC file download/install the perl modules/packages? If it is easier, I can also post the SPEC file itself.


Thanks,
Conner
--
Conner Finlay


--
Fedora-packaging mailing list
Fedora-packaging@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-packaging

Paul Howarth 03-25-2009 03:06 PM

Perl Question
 
Conner Finlay wrote:

Hello list,

I have searched Google high and low, but I have not found an answer. I
have a spec file that requires some perl modules, ie Net::IP,
XML::Simple, etc. For all but one there is an RPM available for it. In
the SPEC file I have them as Requires: perl(Net::IP) and the spec file
builds fine(rpmbuild -ba -v) but when I go to install the RPM it
complains about the missing perl modules. If I do a `yum install
perl-xyz` and rebuild the SPEC file, it will not complain about the
missing perl modules. How can I have the SPEC file download/install the
perl modules/packages? If it is easier, I can also post the SPEC file
itself.


If you use yum to install the rpm you've built, it will resolve the
dependencies and install them too.


When you specify "Requires: foo", this means that your package needs
"foo" on the system to run, but not necessarily to build, so rpm
enforces this when you try to install the package. If you want "foo"
available at build time (perhaps to run a test suite), you specify that
as "BuildRequires: foo", and rpm-build will insist you have "foo" when
you try to build the package.


Paul.


--
Fedora-packaging mailing list
Fedora-packaging@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-packaging

"Tom "spot" Callaway" 03-25-2009 03:13 PM

Perl Question
 
On 03/25/2009 11:58 AM, Conner Finlay wrote:
> For all but one there is an RPM available for it.

I know this is offtopic, but which perl module was not available in Fedora?

~spot

--
Fedora-packaging mailing list
Fedora-packaging@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-packaging

Conner Finlay 03-25-2009 04:07 PM

Perl Question
 
Paul,

Wouldn't BuildRequires: be pretty much the same thing as doing a manual yum install of the package, then building the spec file?

Thanks,
Conner

On Wed, Mar 25, 2009 at 12:06 PM, Paul Howarth <paul@city-fan.org> wrote:

Conner Finlay wrote:


Hello list,



I have searched Google high and low, but I have not found an answer. I have a spec file that requires some perl modules, ie Net::IP, XML::Simple, etc. For all but one there is an RPM available for it. In the SPEC file I have them as Requires: perl(Net::IP) and the spec file builds fine(rpmbuild -ba -v) but when I go to install the RPM it complains about the missing perl modules. If I do a `yum install perl-xyz` and rebuild the SPEC file, it will not complain about the missing perl modules. How can I have the SPEC file download/install the perl modules/packages? If it is easier, I can also post the SPEC file itself.





If you use yum to install the rpm you've built, it will resolve the dependencies and install them too.



When you specify "Requires: foo", this means that your package needs "foo" on the system to run, but not necessarily to build, so rpm enforces this when you try to install the package. If you want "foo" available at build time (perhaps to run a test suite), you specify that as "BuildRequires: foo", and rpm-build will insist you have "foo" when you try to build the package.




Paul.





--

Fedora-packaging mailing list

Fedora-packaging@redhat.com

https://www.redhat.com/mailman/listinfo/fedora-packaging



--
Conner Finlay


--
Fedora-packaging mailing list
Fedora-packaging@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-packaging

Paul Howarth 03-25-2009 04:14 PM

Perl Question
 
Conner Finlay wrote:

Paul,

Wouldn't BuildRequires: be pretty much the same thing as doing a manual
yum install of the package, then building the spec file?


Yes; that's the way dependencies are done. The spec file contains the
dependency information and it's up to the user how to satisfy that
dependency.


Given that packages should be built as non-root users for security
reasons, nothing in the spec file that attempted to download and install
dependencies on to the system (and in particular, into the rpm database)
would work anyway due to permissions.


Paul.

--
Fedora-packaging mailing list
Fedora-packaging@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-packaging

Alex Samad 12-19-2009 07:10 AM

perl question
 
Hi

I have a set of constants setup in my script

RC_OK
...
...

I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
redifinition

is there some way around this with out renaming my constants.

Alex

Gabor Urban 12-19-2009 07:43 AM

perl question
 
Hi,

did you check this issue on Perl sites? Try to start with
www.cpan.org. BTW this is a very great site.

Good luck,
Gabor

2009/12/19 Alex Samad <alex@samad.com.au>:
> Hi
>
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple *which also uses RC_OK, and I get a main::RC_OK
> redifinition
>
> is there some way around this with out renaming my constants.
>
> Alex
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkssinMACgkQkZz88chpJ2N9sQCfc4mkgkatwH jCGzKJLGZZla/h
> oQoAnRP9hOxIzvMjdtqCZi4PriHYKSh7
> =KFfZ
> -----END PGP SIGNATURE-----
>
>



--
Linux: Choice of a GNU Generation


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Niu Kun 12-19-2009 09:29 AM

perl question
 
How about setting it a "local" variable?
And I think that you'd better send such a question to a perl mailing list.

Alex Samad wrote:
> Hi
>
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> redifinition
>
> is there some way around this with out renaming my constants.
>
> Alex
>
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Chris Dale 12-19-2009 03:00 PM

perl question
 
On Sat, 19 Dec 2009, Alex Samad wrote:
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> redifinition
>
> is there some way around this with out renaming my constants.

You can suppress symbol importing, and then call methods the long way:

use LWP::Simple qw();
my $html = LWP::Simple::get("http://...");

Or just import what you want:

use LWP::Simple qw(get);
my $html = get("http://...");

See http://perldoc.perl.org/Exporter.html.

cd


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Alex Samad 12-19-2009 07:16 PM

perl question
 
On Sat, Dec 19, 2009 at 11:00:07AM -0500, Chris Dale wrote:
> On Sat, 19 Dec 2009, Alex Samad wrote:
> > I have a set of constants setup in my script
> >
> > RC_OK
> > ...
> > ...
> >
> > I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> > redifinition
> >
> > is there some way around this with out renaming my constants.
>
> You can suppress symbol importing, and then call methods the long way:
>
> use LWP::Simple qw();
> my $html = LWP::Simple::get("http://...");
>
> Or just import what you want:
>
> use LWP::Simple qw(get);
> my $html = get("http://...");
>
> See http://perldoc.perl.org/Exporter.html.

thanks for that. Did some more reading and it seems constants don't
really have a scope which is why I was having the problem.

>
> cd
>
>

--
"More and more of our imports are coming from overseas."

- George W. Bush
09/26/2005
On NPR's Morning Edition


All times are GMT. The time now is 12:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.