[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[ANNOUNCE] automatic perl module building from CPAN



Sorry about the crosspost, but this is probably of interest to three
groups of people for different reasons.

1. Users:

I have just written CPAN::Debian, a perl module that allows you to download
and build fairly good Debian packages automatically of (almost) anything in
CPAN.

A sample run is probably the best explination. Warning, CPAN is pretty
verbose, and so is building a debian package; the result is pretty spammy.

  joey@kite:~>perl -mCPAN::Debian -e shell

  cpan shell -- CPAN exploration and modules installation (v1.52)
  ReadLine support enabled

  cpan> makedeb Coy
  Going to read /home/joey/.cpan/sources/authors/01mailrc.txt.gz
  Going to read /home/joey/.cpan/sources/modules/02packages.details.txt.gz
  Scanning cache /home/joey/.cpan/build for sizes
  
    There's a new CPAN.pm version (v1.59) available!
    [Current version is v1.52]
    You might want to try
      install Bundle::CPAN
      reload cpan
    without quitting the current session. It should be a seamless upgrade
    while we are running...
  
  Going to read /home/joey/.cpan/sources/modules/03modlist.data.gz
  CPAN: MD5 loaded ok
  Checksum for /home/joey/.cpan/sources/authors/id/D/DC/DCONWAY/Coy-0.05.tar.gz ok
  Coy-0.05/
  Coy-0.05/lib/
  Coy-0.05/lib/Lingua/
  Coy-0.05/lib/Lingua/EN/
  Coy-0.05/lib/Lingua/EN/Hyphenate.pm
  Coy-0.05/lib/Lingua/EN/Inflect.pm
  Coy-0.05/lib/Coy.pm
  Coy-0.05/demo/
  Coy-0.05/demo/demo.pl
  Coy-0.05/Changes
  Coy-0.05/Makefile.PL
  Coy-0.05/README
  Coy-0.05/MANIFEST
  Removing previously used /home/joey/.cpan/build/Coy-0.05
  dh_testdir
  perl Makefile.PL INSTALLDIRS=vendor
  Checking if your kit is complete...
  Looks good
  Writing Makefile for Coy
  /usr/bin/make OPTIMIZE="-O2 -g -Wall"
  make[1]: Entering directory `/home/joey/.cpan/build/Coy-0.05'
  mkdir blib
  mkdir blib/lib
  mkdir blib/arch
  mkdir blib/arch/auto
  mkdir blib/arch/auto/Coy
  mkdir blib/lib/auto
  mkdir blib/lib/auto/Coy
  mkdir blib/man3
  cp lib/Coy.pm blib/lib/Coy.pm
  cp lib/Lingua/EN/Hyphenate.pm blib/lib/Lingua/EN/Hyphenate.pm
  cp lib/Lingua/EN/Inflect.pm blib/lib/Lingua/EN/Inflect.pm
  Manifying blib/man3/Coy.3pm
  Manifying blib/man3/Lingua::EN::Hyphenate.3pm
  make[1]: Leaving directory `/home/joey/.cpan/build/Coy-0.05'
  /usr/bin/make test
  make[1]: Entering directory `/home/joey/.cpan/build/Coy-0.05'
  No tests defined for Coy extension.
  make[1]: Leaving directory `/home/joey/.cpan/build/Coy-0.05'
  touch build-stamp
  dh_testdir
  dh_testroot
  dh_clean -k
  /usr/bin/make install PREFIX=/home/joey/.cpan/build/Coy-0.05/debian/libcoy-perl/usr
  make[1]: Entering directory `/home/joey/.cpan/build/Coy-0.05'
  Installing /home/joey/.cpan/build/Coy-0.05/debian/libcoy-perl/usr/share/perl5/Coy.pm
  Installing /home/joey/.cpan/build/Coy-0.05/debian/libcoy-perl/usr/share/perl5/Lingua/EN/Hyphenate.pm
  Installing /home/joey/.cpan/build/Coy-0.05/debian/libcoy-perl/usr/share/perl5/Lingua/EN/Inflect.pm
  Installing /home/joey/.cpan/build/Coy-0.05/debian/libcoy-perl/usr/share/man/man3/Coy.3pm
  Installing /home/joey/.cpan/build/Coy-0.05/debian/libcoy-perl/usr/share/man/man3/Lingua::EN::Hyphenate.3pm
  ## Differing version of ./Coy.pm found. You might like to
  rm /usr/lib/perl5/Coy.pm
  ## Differing version of Lingua/EN/Hyphenate.pm found. You might like to
  rm /usr/lib/perl5/Lingua/EN/Hyphenate.pm
  ## Differing version of Lingua/EN/Inflect.pm found. You might like to
  rm /usr/lib/perl5/Lingua/EN/Inflect.pm
  ## Running 'make install UNINST=1' will unlink all those files for you.
  make[1]: Leaving directory `/home/joey/.cpan/build/Coy-0.05'
  dh_installdocs README
  dh_installchangelogs Changes
  dh_strip
  dh_compress
  dh_fixperms
  dh_installdeb
  dh_perl
  dh_shlibdeps
  dh_gencontrol
  dpkg-gencontrol: warning: unknown substitution variable ${shlibs:Depends}
  perl -i -pe 's/(Depends: .*), $/$1/' debian/libcoy-perl/DEBIAN/control
  dh_md5sums
  dh_builddeb --destdir=/home/joey
  dpkg-deb: building package `libcoy-perl' in `/home/joey/libcoy-perl_0-1_i386.deb'.

  cpan> exit
  Lockfile removed.

  joey@kite:~>dpkg --info libcoy-perl_0-1_i386.deb
   new debian package, version 2.0.
   size 29340 bytes: control archive= 908 bytes.
       299 bytes,    12 lines      control              
       637 bytes,     9 lines      md5sums              
       269 bytes,     8 lines   *  postinst             #!/bin/sh
       200 bytes,     6 lines   *  prerm                #!/bin/sh
   Package: libcoy-perl
   Version: 0-1
   Section: interpreters
   Priority: optional
   Architecture: i386
   Depends: perl
   Installed-Size: 90
   Maintainer: Joey Hess <joey@kitenet.net>
   Description: Like Carp - only prettier
    The Coy perl module from CPAN.
    .
    This package was automatically created by CPAN::Debian.

  joey@kite:~>lintian libcoy-perl_0-1_i386.deb 
  W: libcoy-perl: executable-not-elf-or-script ./usr/share/perl5/Lingua/EN/Inflect.pm
  W: libcoy-perl: executable-not-elf-or-script ./usr/share/perl5/Lingua/EN/Hyphenate.pm
  W: libcoy-perl: executable-not-elf-or-script ./usr/share/perl5/Coy.pm

The lintian warnings are actually bogus, lintian is just not aware of the
newest perl policy yet. This libcoy-perl is _almost_ as good a package
as the one I maintain in the Debian archive, but I don't think I'm out of a
job quite yet :-) -- having a human make the package adds so many nice little
touches that my program cannot do. It's great if you need a perl module
package quick though, and want to keep everything in .deb form.

Oh, and it utterly depends on the latest perl packages in unstable. Nothing
else will do. Bod has done great things with MakeMaker, which was really what
made this possible.

2. Developers:

It's also possible to just debianize a module, yeilding a debianized
source tree and not building a deb. Developers may find this to be a
decent starting point at making a debian package of something in CPAN, for
release into Debian. For example:

perl -m CPAN::Debian -le 'CPAN::Shell->expand("Module",shift)->debianize' Term::Slang

3. Perlers:

So I'd like to get this module into Debian, but the question is: where?

I think getting it properly integrated into CPAN.pm, where it really belongs,
is doubtful. (Unless Bod wants to maintain a large patch to CPAN.pm? Hahaha.)

It could be dropped right into the debian perl package and work as-is, if
Bod wants to do that.

Or I could make a standalone package of it, which seems overkill for one file.


The module can be downloaded for now from
http://cvs.kitenet.net/joey-cvs/src/CPAN/Debian.pm

-- 
see shy jo, who is ready to throttle CPAN for its insessient
            "There's a new CPAN.pm version (v1.59) available!"



Reply to: