Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Distribution-Metadata

 Distribution-Metadata

kichijoji.pm #3 LT 2015.04.17

Shoichi Kaji

April 17, 2015
Tweet

More Decks by Shoichi Kaji

Other Decks in Technology

Transcript

  1. Background • package (module) VS distribution (release) • eg: •

    package: LWP::UserAgent • distribution: libwww-perl
  2. Background • package <-> distribution ͷରԠΛ஌Γ͍ͨ • Remote • MetaCPAN

    API, CPAN MetaDB (using by cpanminus) • Local • cpanm 1.5+ ͔Β cpan module Πϯετʔϧ࣌ʹ
 distribution ͷ metadata (MYMETA.json, install.json) Λอଘ • Distribution::Metadata helps you find dist metadata in local
  3. SYNOPSIS use Distribution::Metadata my $d = Distribution::Metadata->new_from_module(‘LWP::UserAgent’); $d->name; # libwww-perl

    $d->version; # 6.13 $d->pathname; # E/ET/ETHER/libwww-perl-6.13.tar.gz $d->main_module; # LWP $d->main_module_version; # 6.13 $d->packlist; # path to .packlist file
  4. When do we use D::M? • distribution ͷΞϯΠϯετʔϧ (like cpanm)

    • App::FatPacker::Simple ͸͋Δ distribution Λ exclude ͢Δͱ͖ʹ D::M Λ࢖͍ͬͯΔ
  5. When do we use D::M? • module ͷґଘؔ܎ͷߏங (like carton)

    • Perl::PrereqDistributionGatherer
 https://github.com/shoichikaji/Perl- PrereqDistributionGatherer
  6. Wrap up • package <-> distribution ͷରԠ͕஌Γ͍ͨ • cpanm ͸

    cpan module Πϯετʔϧ࣌ʹ
 distribution ͷ metadata Λอଘ • Αͬͯ local Ͱ package ͱ distribution ͷ
 ରԠ͕Θ͔Δ • Distribution::Metadata helps that!