綾小路龍之介の素人思考

[perl] モジュール作成とアップロードはCPAN::Uploaderのcpan-upload

アップロードという日常業務をいちいちログインしてアーカイブ指定してとかやってたら死ぬので。

まずはCPAN::Uploaderをインストール

# cpan -i CPAN::Uploader
CPAN: Storable loaded ok (v2.24)
Going to read '/root/.cpan/Metadata'
  Database was generated on Thu, 18 Nov 2010 02:43:48 GMT
Running install for module 'CPAN::Uploader'
CPAN: YAML loaded ok (v0.72)
Running make for R/RJ/RJBS/CPAN-Uploader-0.102150.tar.gz
CPAN: LWP::UserAgent loaded ok (v5.835)
CPAN: Time::HiRes loaded ok (v1.9721)
Fetching with LWP:
  ftp://ftp.jaist.ac.jp/pub/CPAN/authors/id/R/RJ/RJBS/CPAN-Uploader-0.102150.tar.gz
CPAN: Digest::SHA loaded ok (v5.48)
CPAN: Compress::Zlib loaded ok (v2.021)
Checksum for /root/.cpan/sources/authors/id/R/RJ/RJBS/CPAN-Uploader-0.102150.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.68)
CPAN-Uploader-0.102150
CPAN-Uploader-0.102150/Changes
CPAN-Uploader-0.102150/dist.ini
CPAN-Uploader-0.102150/bin
CPAN-Uploader-0.102150/bin/cpan-upload
CPAN-Uploader-0.102150/lib/CPAN
CPAN-Uploader-0.102150/lib/CPAN/Uploader.pm
CPAN-Uploader-0.102150/t
CPAN-Uploader-0.102150/t/00-load.t
CPAN-Uploader-0.102150/META.yml
CPAN-Uploader-0.102150/LICENSE
CPAN-Uploader-0.102150/README
CPAN-Uploader-0.102150/MANIFEST
CPAN-Uploader-0.102150/META.json
CPAN-Uploader-0.102150/t/release-pod-syntax.t
CPAN-Uploader-0.102150/Makefile.PL
CPAN: File::Temp loaded ok (v0.22)

  CPAN.pm: Going to build R/RJ/RJBS/CPAN-Uploader-0.102150.tar.gz

Checking if your kit is complete...
Looks good
Warning: prerequisite Getopt::Long::Descriptive 0.084 not found.
Warning: prerequisite Term::ReadKey 0 not found.
Writing Makefile for CPAN::Uploader
---- Unsatisfied dependencies detected during ----
----    RJBS/CPAN-Uploader-0.102150.tar.gz    ----
    Getopt::Long::Descriptive [requires]
    Term::ReadKey [requires]
Running make test
  Delayed until after prerequisites
Running make install
  Delayed until after prerequisites
Running install for module 'Getopt::Long::Descriptive'
Running make for R/RJ/RJBS/Getopt-Long-Descriptive-0.086.tar.gz
Fetching with LWP:
  ftp://ftp.jaist.ac.jp/pub/CPAN/authors/id/R/RJ/RJBS/Getopt-Long-Descriptive-0.086.tar.gz
Checksum for /root/.cpan/sources/authors/id/R/RJ/RJBS/Getopt-Long-Descriptive-0.086.tar.gz ok
Getopt-Long-Descriptive-0.086/
Getopt-Long-Descriptive-0.086/Changes
Getopt-Long-Descriptive-0.086/MANIFEST
Getopt-Long-Descriptive-0.086/META.yml
Getopt-Long-Descriptive-0.086/Makefile.PL
Getopt-Long-Descriptive-0.086/README
Getopt-Long-Descriptive-0.086/lib/
Getopt-Long-Descriptive-0.086/t/
Getopt-Long-Descriptive-0.086/t/00-load.t
Getopt-Long-Descriptive-0.086/t/descriptive.t
Getopt-Long-Descriptive-0.086/t/pod-coverage.t
Getopt-Long-Descriptive-0.086/t/pod.t
Getopt-Long-Descriptive-0.086/lib/Getopt/
Getopt-Long-Descriptive-0.086/lib/Getopt/Long/
Getopt-Long-Descriptive-0.086/lib/Getopt/Long/Descriptive/
Getopt-Long-Descriptive-0.086/lib/Getopt/Long/Descriptive.pm
Getopt-Long-Descriptive-0.086/lib/Getopt/Long/Descriptive/Opts.pm
Getopt-Long-Descriptive-0.086/lib/Getopt/Long/Descriptive/Usage.pm

  CPAN.pm: Going to build R/RJ/RJBS/Getopt-Long-Descriptive-0.086.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Getopt::Long::Descriptive
cp lib/Getopt/Long/Descriptive/Opts.pm blib/lib/Getopt/Long/Descriptive/Opts.pm
cp lib/Getopt/Long/Descriptive.pm blib/lib/Getopt/Long/Descriptive.pm
cp lib/Getopt/Long/Descriptive/Usage.pm blib/lib/Getopt/Long/Descriptive/Usage.pm
Manifying blib/man3/Getopt::Long::Descriptive::Opts.3pm
Manifying blib/man3/Getopt::Long::Descriptive.3pm
Manifying blib/man3/Getopt::Long::Descriptive::Usage.3pm
  RJBS/Getopt-Long-Descriptive-0.086.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ....... 1/1 # Testing Getopt::Long::Descriptive 0.086, Perl 5.010000, /usr/bin/perl
t/00-load.t ....... ok
t/descriptive.t ... ok
t/pod-coverage.t .. ok
t/pod.t ........... ok
All tests successful.
Files=4, Tests=44,  4 wallclock secs ( 0.14 usr  0.02 sys +  0.88 cusr  0.11 csys =  1.15 CPU)
Result: PASS
  RJBS/Getopt-Long-Descriptive-0.086.tar.gz
  /usr/bin/make test -- OK
Running make install
Prepending /root/.cpan/build/Getopt-Long-Descriptive-0.086-yuRghB/blib/arch /root/.cpan/build/Getopt-Long-Descriptive-0.086-yuRghB/blib/lib to PERL5LIB for 'install'
Installing /usr/local/share/perl/5.10.0/Getopt/Long/Descriptive.pm
Installing /usr/local/share/perl/5.10.0/Getopt/Long/Descriptive/Usage.pm
Installing /usr/local/share/perl/5.10.0/Getopt/Long/Descriptive/Opts.pm
Installing /usr/local/man/man3/Getopt::Long::Descriptive::Opts.3pm
Installing /usr/local/man/man3/Getopt::Long::Descriptive.3pm
Installing /usr/local/man/man3/Getopt::Long::Descriptive::Usage.3pm
Appending installation info to /usr/lib/perl/5.10/perllocal.pod
  RJBS/Getopt-Long-Descriptive-0.086.tar.gz
  /usr/bin/make install  -- OK
Running install for module 'Term::ReadKey'
Running make for J/JS/JSTOWE/TermReadKey-2.30.tar.gz
Fetching with LWP:
  ftp://ftp.jaist.ac.jp/pub/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz
Fetching with LWP:
  ftp://ftp.jaist.ac.jp/pub/CPAN/authors/id/J/JS/JSTOWE/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz ok
TermReadKey-2.30/
TermReadKey-2.30/genchars.pl
TermReadKey-2.30/Makefile.PL
TermReadKey-2.30/Configure.pm
TermReadKey-2.30/test.pl
TermReadKey-2.30/ReadKey.pm
TermReadKey-2.30/META.yml
TermReadKey-2.30/ReadKey.xs
TermReadKey-2.30/ppport.h
TermReadKey-2.30/MANIFEST
TermReadKey-2.30/README

  CPAN.pm: Going to build J/JS/JSTOWE/TermReadKey-2.30.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Term::ReadKey
cp ReadKey.pm blib/lib/Term/ReadKey.pm
AutoSplitting blib/lib/Term/ReadKey.pm (blib/lib/auto/Term/ReadKey)
/usr/bin/perl -I/usr/share/perl/5.10 genchars.pl

Writing termio/termios section of cchars.h... Done.
Checking for sgtty...
        Sgtty NOT found.
Writing sgtty section of cchars.h... Done.
/usr/bin/perl /usr/local/share/perl/5.10.0/ExtUtils/xsubpp -noprototypes -typemap /usr/share/perl/5.10/ExtUtils/typemap  ReadKey.xs > ReadKey.xsc && mv ReadKey.xsc ReadKey.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"2.30\" -DXS_VERSION=\"2.30\" -fPIC "-I/usr/lib/perl/5.10/CORE"   ReadKey.c
In file included from ReadKey.xs:6:
ppport.h:230:1: warning: "PERL_UNUSED_DECL" redefined
In file included from ReadKey.xs:4:
/usr/lib/perl/5.10/CORE/perl.h:299:1: warning: this is the location of the previous definition
Running Mkbootstrap for Term::ReadKey ()
chmod 644 ReadKey.bs
rm -f blib/arch/auto/Term/ReadKey/ReadKey.so
cc  -shared -O2 -g -L/usr/local/lib ReadKey.o  -o blib/arch/auto/Term/ReadKey/ReadKey.so        \
                \

chmod 755 blib/arch/auto/Term/ReadKey/ReadKey.so
cp ReadKey.bs blib/arch/auto/Term/ReadKey/ReadKey.bs
chmod 644 blib/arch/auto/Term/ReadKey/ReadKey.bs
Manifying blib/man3/Term::ReadKey.3pm
  JSTOWE/TermReadKey-2.30.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" -w test.pl
1 .. 8
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
  JSTOWE/TermReadKey-2.30.tar.gz
  /usr/bin/make test -- OK
Running make install
Prepending /root/.cpan/build/TermReadKey-2.30-ecL7RY/blib/arch /root/.cpan/build/TermReadKey-2.30-ecL7RY/blib/lib to PERL5LIB for 'install'
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib/perl/5.10.0/auto/Term/ReadKey/ReadKey.so
Installing /usr/local/lib/perl/5.10.0/auto/Term/ReadKey/ReadKey.bs
Installing /usr/local/lib/perl/5.10.0/Term/ReadKey.pm
Installing /usr/local/lib/perl/5.10.0/auto/Term/ReadKey/autosplit.ix
Installing /usr/local/man/man3/Term::ReadKey.3pm
Appending installation info to /usr/lib/perl/5.10/perllocal.pod
  JSTOWE/TermReadKey-2.30.tar.gz
  /usr/bin/make install  -- OK
Running make for R/RJ/RJBS/CPAN-Uploader-0.102150.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/CPAN-Uploader-0.102150-arOBEv

  CPAN.pm: Going to build R/RJ/RJBS/CPAN-Uploader-0.102150.tar.gz

cp lib/CPAN/Uploader.pm blib/lib/CPAN/Uploader.pm
cp bin/cpan-upload blib/script/cpan-upload
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/cpan-upload
Manifying blib/man1/cpan-upload.1p
Manifying blib/man3/CPAN::Uploader.3pm
  RJBS/CPAN-Uploader-0.102150.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ............. ok
t/release-pod-syntax.t .. skipped: these tests are for release candidate testing
All tests successful.
Files=2, Tests=1,  0 wallclock secs ( 0.07 usr  0.02 sys +  0.26 cusr  0.04 csys =  0.39 CPU)
Result: PASS
  RJBS/CPAN-Uploader-0.102150.tar.gz
  /usr/bin/make test -- OK
Running make install
Prepending /root/.cpan/build/CPAN-Uploader-0.102150-arOBEv/blib/arch /root/.cpan/build/CPAN-Uploader-0.102150-arOBEv/blib/lib to PERL5LIB for 'install'
Installing /usr/local/share/perl/5.10.0/CPAN/Uploader.pm
Installing /usr/local/man/man1/cpan-upload.1p
Installing /usr/local/man/man3/CPAN::Uploader.3pm
Installing /usr/local/bin/cpan-upload
Appending installation info to /usr/lib/perl/5.10/perllocal.pod
  RJBS/CPAN-Uploader-0.102150.tar.gz
  /usr/bin/make install  -- OK

テストでアップロード。失敗するのはおそらくバージョンが古いから。

$ cpan-upload -v ******************************-0.05.tar.gz
registering upload with PAUSE web server
----- REQUEST BEGIN -----
Authorization: Basic ************************************
Content-Length: 45392
Content-Type: multipart/form-data; boundary=xYzZY

----- REQUEST END -------

POSTing upload for ******************************-0.05.tar.gz
request failed with error code 406
  Message: Not Acceptable

内容を適当に書き換えて再度アップロードチェック。今回は成功。その前にperl Makefile.PLから。

$ perl Makefile.PL
$ make
$ make test
$ make dist
$ cpan-upload -v ******************************-0.06.tar.gz
registering upload with PAUSE web server
----- REQUEST BEGIN -----
Authorization: Basic ************************************
Content-Length: 45399
Content-Type: multipart/form-data; boundary=xYzZY

----- REQUEST END -------

POSTing upload for ******************************-0.06.tar.gz
Looks OK!
----- RESPONSE BEGIN -----
Cache-Control: no-cache
Connection: close
Date: Thu, 18 Nov 2010 07:23:33 GMT
Pragma: no-cache
Accept: *
Server: Apache
Vary: accept-encoding
Content-Length: 22419
Content-Type: text/html; charset=ISO-8859-1
Expires: Thu, 18 Nov 2010 07:23:33 GMT
Last-Modified: Thu, 18 Nov 2010 07:23:33 GMT
Client-Date: Thu, 18 Nov 2010 07:24:24 GMT
Client-Peer: 195.37.231.65:80
Client-Response-Num: 1
Link: </pause/pause_favicon.jpg>; rel="shortcut icon"; type="image/jpeg"
Link: </pause/pause.css>; rel="stylesheet"; title="pause"; type="text/css"
Title: PAUSE: add_uri

----- RESPONSE END -------

PAUSE add message sent ok [200]

リファレンス

  1. モジュール作成からCPANに上げるまでの手順 - Dive into the Tech World!
  2. "cpan-upload-http" .pause - Google 検索

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2009-08-11T16:28:20+09:00
  2. Modified: 2009-08-11T16:28:20+09:00
  3. Generated: 2017-07-21T23:09:22+09:00