Debian package [was Re: Mail::Box::IMAP4]

Mitar <[email protected]> Thu, 23 Sep 2004 01:23:10 +0200
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <[email protected]>
Hi!

On Wed, 22 Sep 2004 11:45:56 +0200, Mark Overmeer <[email protected]> wrote:
> * Tom Allison ([email protected]) [040922 11:21]:
> > Mark Overmeer wrote:
> > Mail::Box version is 2.055 if I read it correctly from the debian
> > unstable package tree.
> 
> Wow, that's an old version ;-)

Yes, that is the problem with Debian. This package is not very up to date.

But it is really easy to build yourself a newer one (I have Debian and
I regulary
do this) as Debian provides "dh-make-perl" script for making Debian package
from Perl modules.

I download source-current.tar.gz and unpack it (dh-make-perl have support
for automatic download from CPAN but I had problems with it and so I do not
use it) and than run dh-make-perl in unpacked directory. This creates
package something like:

libmail-box-perl_2.xxx-1_all.deb

where xxx is version number. Than I install it with:

dpkg -i libmail-box-perl_2.xxx-1_all.deb

dh-make-perl can also automaticly install it but I do not like to much
automaticity.

It is similar with Mail::Box::Parser:C.

dh-make-perl had some problems finding out version of Mail::Box module
so I had to add some code to /usr/share/dh-make-perl/overrides (I do
not know if it is still needed). The code is (just add it at the end of file):

$overrides{'Mail::Box'} = {
        version=>sub {
                my $ver;
                my $makefile = 'Makefile.PL';
                local $/ = undef;
                open (MF, "<./$makefile") || die "Cannot open $makefile\n";
                my $file = <MF>;
                close(MF);
                local $/ = "\n";
                my $vfrom = $4 if $file =~
/(['"]?)VERSION_FROM\1\s*(=>|,)\s*(['"]?)(\S+)\3/s;
                unless (open(MF, "<./$vfrom")) {
                        return;
                }
                while (<MF>) {
                        if (/([\$*])(([\w\:\']*)\bVERSION)\b.*\=/) {
                                no strict;
                                $ver = (eval $_)[0];
                                last;
                        }
                }
                close(MF);
                return $ver;
        }
}

Maybe someone could add a guide for Debian to Mail::Box home page? :-)

And while making Debian package I saw this warning this time (with new version,
I do not know if it was there before):

Too late to run INIT block at /usr/share/perl5/Mail/Reporter.pm line 27.


Mitar