dh-make-perl 0.50

Damyan Ivanov dmn at debian.org
Thu Feb 4 21:00:50 UTC 2010


Hello Tom,

-=| Tom Metro, Thu, Feb 04, 2010 at 02:36:07PM -0500 |=-
> I had the thought that I'd create a simple wrapper around dh-make-perl  
> (v0.50 on Ubuntu 9.04) as a substitute for the cpan command to encourage  
> use of Debian packages locally, and I ran into some unexpected problems  
> on the first run.

Uh, oh.

> […]
>
> The first bit of trouble seem to show up here:
>
>> Use of uninitialized value $_[1] in string eq at /usr/share/perl/5.10/File/Copy.pm line 71.
>> […]
>> Use of uninitialized value $ENV{"PWD"} in concatenation (.) or 
>> string at /usr/bin/dh-make-perl line 384.
>
> I'm guessing that is from dh-make-perl and not from the module build.

Seems so.

> And then there is this:
>
>> Use of uninitialized value $desc in pattern match (m//) at /usr/bin/dh-make-perl line 977.
>
> which I'm assuming is just dh-make-perl having problems extracting a  
> package description from the module's POD. I assume a non-critical error  
> that should have been trapped and displayed as a warning.

This may already be fixed in the current version (0.63)

> Here's where things get more problematic:
>
>> Using rules: /usr/share/dh-make-perl/rules.dh7.noxs
>> make: Entering directory `/WWW-Mechanize-Plugin-FollowMetaRedirect-0.01'
>
> It seems this combination of dh-make-perl and cpan running under sudo  
> resulted in the build directory being created under the file system root  
> (/), rather than some more appropriate location.

Yes. You use sudo so that dh-make-perl can install the resulting 
package. Running dh-make-perl as root doesn't seem a good idea in 
general. It is a complicated piece of code, and a bug in it can have 
severe effect on the system.

What is missing is a way to install the packahe without running 
dh-make-perl as root. Something like

    dh-make-perl -rsudo --build     # build normally, install via sudo

This looks like sommething that deserves a bug report against 
dh-make-perl.

> I assume these are ignorable:
>
>> ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.

Normal. fakeroot not working under sudo.

>> dpkg-gencontrol: warning: unknown substitution variable 
>> ${misc:Depends}

Harmless, fixed in recent versions of the toolchain.

> On a related note, I'm using 'script' in the wrapper to log the 
> session,  and ideally I'd like to use the Debian package name as 
> part of the file  name, rather than the Perl module name, which is 
> being supplied on the  command line. It would be handy if 
> dh-make-perl had a command line  option to return the Debian package 
> name for a given module name.  Perhaps there is an existing library 
> that could be accessed with a  one-liner to do this, like:
>
> PACKAGE=`perl -Mmodule -e 'print module::method("$MODULE"),"\n";'`

Looks like another bugreport is in order. In general, Foo::Bar becomes 
libfoo-bar, but there are exceptions when Foo or Bar is 'Perl'.

> Also, I'm confused why one of these command lines doesn't build the 
> .deb  using the existing ./debian files:
>
> /usr/local/src/cpan/WWW-Mechanize-Plugin-FollowMetaRedirect-0.01%  
> dh-make-perl
> Found: WWW-Mechanize-Plugin-FollowMetaRedirect 0.01  
> (libwww-mechanize-plugin-followmetaredirect-perl arch=all)
> The directory ./debian is already present and I won't overwrite it:  
> remove it yourself.

This is as designed. The main purpose of dh-make-perl is to create the 
debian/ directory. Since you already have it, dh-make-perl refuses to 
override it, possibly destroying valuable work. You want to run 
'dpkg-buildpackage' instead.

> /usr/local/src/cpan/WWW-Mechanize-Plugin-FollowMetaRedirect-0.01%  
> dh-make-perl --build
> Found: WWW-Mechanize-Plugin-FollowMetaRedirect 0.01  
> (libwww-mechanize-plugin-followmetaredirect-perl arch=all)
> The directory ./debian is already present and I won't overwrite it:  
> remove it yourself.
>
> Shouldn't there be a command to build the .deb using an existing  
> ./debian? (Sure, there are the usual Debian packaging commands, but why  
> not have dh-make-perl do the expected thing?)

From the manual page:

       --build
                  Builds the package after setting it up.

So --build first tries to create debian/ which fails because debian/ 
already exists.

> And I noticed this:
>
> /usr/local/src/cpan% dh-make-perl --refresh  
> WWW-Mechanize-Plugin-FollowMetaRedirect-0.01/
> Engaging refresh mode
> Cannot open ./Makefile.PL: No such file or directory
>
> doesn't work, while this:
>
> /usr/local/src/cpan/WWW-Mechanize-Plugin-FollowMetaRedirect-0.01%  
> dh-make-perl --refresh
> Engaging refresh mode
> Found: WWW-Mechanize-Plugin-FollowMetaRedirect 0.01  
> (libwww-mechanize-plugin-followmetaredirect-perl arch=all)
> […]
> --- Done
>
> does. Technically the man page does reflect that, but it seems  
> inconsistent with the other operational modes.

True. We seem to only use --refresh inside the unpackaged source. This 
is why noone implemented the other approach. Filing a bug report is 
recommended.


Thank you for your comments.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20100204/8987eb33/attachment.pgp>


More information about the pkg-perl-maintainers mailing list