Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 444360

Summary: app-admin/collectd-5.1.1 USE="perl" installs perl module in wrong directory
Product: Gentoo Linux Reporter: Chris Mayo <aklhfex>
Component: New packagesAssignee: Johan Bergström <bugs>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
collectd-5.1.1-r1.ebuild
collectd-5.1.1-perl-prefix.patch

Description Chris Mayo 2012-11-22 20:31:31 UTC
Created attachment 330266 [details]
emerge --info

$ qlist app-admin/collectd-5.1.1 | grep perl
/usr/lib/perl5/Collectd.pm
/usr/lib/perl5/Collectd/Unixsock.pm
/usr/lib/perl5/Collectd/Plugins/OpenVZ.pm
/usr/lib/perl5/x86_64-linux-thread-multi/auto/Collectd/.packlist
/usr/share/man/man5/collectd-perl.5.bz2
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2012-11-23 10:01:31 UTC
and what would the correct directory be?
Comment 2 Chris Mayo 2012-11-23 19:24:38 UTC
Something listed by:
$ perl -le 'print foreach @INC'

Looks like others are in /usr/lib64/perl5/vendor_perl/5.12.4/ on mine.
Comment 3 Johan Bergström 2012-11-25 21:03:50 UTC
From reading your emerge --info, COLLECTD_PLUGINS section doesn't seem to contain perl unixsock. Is this perhaps stray files for whatever reason? Perhaps I'm missing something.

I don't get any perl plugin (openvz, monitorus) installed when building with USE="perl". Regarding OpenVZ, I think you have to pass --with-perl-bindings=openvz for it to build. We should add a USE-flag for that.
Comment 4 Johan Bergström 2012-11-25 21:05:00 UTC
(oh, and one more perl plugin, the unixsock access library)
Comment 5 Johan Bergström 2012-11-26 03:08:47 UTC
I can reproduce this; was using the 5.2.0 ebuild earlier but just tried the in-tree 5.1.1. Will have a look - but I suspect that default behavior regarding --with-perl-bindings is different.
Comment 6 Johan Bergström 2012-11-27 05:30:04 UTC
Ok, so. I can't fully wrap my head around this.

A couple of notes:
 - we enable the bindings if USE=perl is around. This behaviour is slightly different between 5.1.1 and 5.2.0 (not really relevant)
 - running make install from the bindings/buildperl directory at least for me puts it "where it should be"
 - the Makefile has correct paths in its variables

Not sure, but since the install is recursive, it might inherit something from somewhere. I'm not really well versed in how that ext::makefile works in perl (Makefile.pl -> Makefile conversion). I'll ask someone from the perl herd on IRC and see if I can go further.
Comment 7 Chris Mayo 2012-12-01 17:54:17 UTC
Installed correctly for me by applying patch from:
https://github.com/tokkee/collectd/commit/25fd24689c4c35409f68daf5587a67a247fc1446

and modifying src_configure() to:
myconf+=" $(use_with perl perl-bindings=INSTALLDIRS=vendor)"

Leaving out INSTALLDIRS=vendor puts things in site_perl, but this looks wrong.

Informed by:
http://packages.debian.org/wheezy/collectd
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.62/lib/ExtUtils/MakeMaker.pm#make_install
Comment 8 Johan Bergström 2012-12-02 20:45:44 UTC
Created attachment 331240 [details]
collectd-5.1.1-r1.ebuild

Here's an updated ebuild (and patch) with above changes implemented. I can't really speak for whether they should be installed in vendor_perl or perhaps site_perl, but we at least have similar functionality as other ebuilds.
Comment 9 Johan Bergström 2012-12-02 20:46:06 UTC
Created attachment 331242 [details, diff]
collectd-5.1.1-perl-prefix.patch
Comment 10 Markos Chandras (RETIRED) gentoo-dev 2012-12-03 20:49:37 UTC
+*collectd-5.1.1-r1 (03 Dec 2012)
+
+  03 Dec 2012; Markos Chandras <hwoarang@gentoo.org> +collectd-5.1.1-r1.ebuild,
+  +files/collectd-5.1.1-perl-prefix.patch:
+  Revbump to fix installation path for perl module. Bug #444360 thanks to Johan
+  Bergström <bugs@bergstroem.nu>
+