ROUTE 3390

備忘録的な用途で書いていますが、どなたかの役に立つ事があれば嬉しいです。

はじめてCPANにあげてみた 〜 そして早速バージョンアップもやってみた 〜

タイトルの通り、初めてCPANにあげてみたので、その備忘録です。


アップロードしたモジュールは前回作ったMojolicousのプラグインです。
プラグインの内容や、そもそもそんなのいらないとか、名前空間へんだよ、などなど、もしお気づきの点などあればご指摘頂けると幸いです。


それでは、既にモジュール(.pmファイル、テストなど)は出来ている前提で進めまっす。


STEP1. MANIFESTを作る

モジュールを置いたディレクトリにて
make manifestコマンドで作成できるので、難しいことはありませんでした。

shell> make manifest
/opt/local/bin/perl "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
Added to MANIFEST: lib/Mojolicious/Plugin/Message/Locale.pm
Added to MANIFEST: Makefile.PL
Added to MANIFEST: MANIFEST
Added to MANIFEST: t/000_use.t
Added to MANIFEST: t/001_message_locale.t
Added to MANIFEST: t/002_locale_is_ja.t
Added to MANIFEST: t/003_locale_file.t
Added to MANIFEST: t/004_default_message.t
Added to MANIFEST: t/locale.conf
Added to MANIFEST: t/other_locale.conf

もしモジュールに必要ないファイルなどがあれば
MANIFEST.SKIPという名前のファイルを作成し、
そこにMANIFESTに含めたくないファイルを指定します。
gitの.gitignoreみたいな感じ。


STEP2. tarball形式にする

CPANにアップロードするにはこの形式にする必要があります。

shell> make dist
/opt/local/bin/perl "-MExtUtils::Manifest=manicopy,maniread" \
		-e "manicopy(maniread(),'Mojolicious-Plugin-Message-Locale-0.01', 'best');"
mkdir Mojolicious-Plugin-Message-Locale-0.01
mkdir Mojolicious-Plugin-Message-Locale-0.01/t
mkdir Mojolicious-Plugin-Message-Locale-0.01/lib
mkdir Mojolicious-Plugin-Message-Locale-0.01/lib/Mojolicious
mkdir Mojolicious-Plugin-Message-Locale-0.01/lib/Mojolicious/Plugin
mkdir Mojolicious-Plugin-Message-Locale-0.01/lib/Mojolicious/Plugin/Message
Generating META.yml
Generating META.json
COPY_EXTENDED_ATTRIBUTES_DISABLE=1 COPYFILE_DISABLE=1 tar cvf Mojolicious-Plugin-Message-Locale-0.01.tar Mojolicious-Plugin-Message-Locale-0.01
a Mojolicious-Plugin-Message-Locale-0.01
a Mojolicious-Plugin-Message-Locale-0.01/lib
a Mojolicious-Plugin-Message-Locale-0.01/Makefile.PL
a Mojolicious-Plugin-Message-Locale-0.01/MANIFEST
a Mojolicious-Plugin-Message-Locale-0.01/META.json
a Mojolicious-Plugin-Message-Locale-0.01/META.yml
a Mojolicious-Plugin-Message-Locale-0.01/t
a Mojolicious-Plugin-Message-Locale-0.01/t/000_use.t
a Mojolicious-Plugin-Message-Locale-0.01/t/001_message_locale.t
a Mojolicious-Plugin-Message-Locale-0.01/t/002_locale_is_ja.t
a Mojolicious-Plugin-Message-Locale-0.01/t/003_locale_file.t
a Mojolicious-Plugin-Message-Locale-0.01/t/004_default_message.t
a Mojolicious-Plugin-Message-Locale-0.01/t/locale.conf
a Mojolicious-Plugin-Message-Locale-0.01/t/other_locale.conf
a Mojolicious-Plugin-Message-Locale-0.01/lib/Mojolicious
a Mojolicious-Plugin-Message-Locale-0.01/lib/Mojolicious/Plugin
a Mojolicious-Plugin-Message-Locale-0.01/lib/Mojolicious/Plugin/Message
a Mojolicious-Plugin-Message-Locale-0.01/lib/Mojolicious/Plugin/Message/Locale.pm
rm -rf Mojolicious-Plugin-Message-Locale-0.01
gzip --best Mojolicious-Plugin-Message-Locale-0.01.tar

こんな感じでMojolicious-Plugin-Message-Locale-0.01.tar.gzが作成されました。


STEP3. PAUSEにアップロードする

あ、PAUSEというCPAN AUTHERを管理するサイトでアカウントを作っておいてくださいね(言うのおそい)


User menu > Files > Upload a file to CPAN へ遷移し、
Upload MaterialのIf your browser can handle file upload, 〜 という項目のところで
先ほど作成されたtar.gzファイルを選択し、「Upload this file from my disk」ボタンでアップロード!


User menu > Files > Delete Files へ遷移してみると、アップロードしたファイルが確認出来ます。


STEP4. PAUSEで名前空間の申請
いよいよ大詰め!

User menu > Modules > Register Namespace へ遷移して、モジュールについて入力します。
下記が項目と今回僕が入力した内容です。

▼Name of the module : 名前空間
Mojolicious::Plugin::Message::Locale

▼Module List Chapter:モジュールの種類を選択肢から
015 World_Wide_Web_HTML_HTTP_CGI

▼Development Stage (Note: No implied timescales):モジュールの開発状態
b -- beta(これもてきとう、、)

▼Support Level:サポートレベル
d -- developer(だんだんよくわからなくなってきた、、)

▼Language Used:使用言語
p -- perl

▼Interface Style:モジュールの使い方
f -- functions

▼Public license:モジュールに適用するライセンス
p -- Standard-Perl

▼Description in Module List(44 chars limit):モジュールについて簡単に説明
localize messages in Mojolicious app(こ、これで通じるのか、、?)

▼Places where this module has been or will be discussed publicly:なんかgithubとかのURLでいいっぽい
未入力

▼Modules with similar functionality:似たようなモジュールがあればリストアップする
未入力

▼Rationale:モジュールに対する熱い気持ち
Mojolicious::Plugin::Message::Locale is a plugin for Mojolicious apps to localize messages.
It's a very simple modules, become very useful to localize the message.

最後に「Submit to modules@perl.org」ボタンを押して完了!


数分経過したところで「Module submission Mojolicious::Plugin::Message::Locale
」というタイトルのメールが来ました。


そして翌朝。。。。


アップしてから7時間くらいが経過したところで、CPANにアップされているのを確認!!(とくに連絡はこなかった)

あれ、、SYNOPSISに記載した日本語が文字化けてる、、

どうやらpodの先頭で =encoding utf8 としないとpodに記述したマルチバイト化けてしまうらしい。。

というわけで早速ver0.02を作成。。



修正したら、再びPAUSEへログイン
User menu > Files > Upload a file to CPAN へ遷移し、
最初の時と同じように
Upload MaterialのIf your browser can handle file upload, 〜 という項目のところで
Ver0.02のtar.gzファイルを選択し、「Upload this file from my disk」ボタンでアップロード!

そして続けて
If you have already uploaded のラジオボタンで今アップしたモジュールを選択し、「Upload the checked file」をポチっと


今度は「CPAN Upload: S/SA/SASAKURE/Mojolicious-Plugin-Message-Locale-0.02.tar.gz」というタイトルのメールがきました


数分後に「PAUSE indexer report SASAKURE/Mojolicious-Plugin-Message-Locale-0.02.tar.gz」というタイトルのメールも来ました。
内容は、、なにやらVer0.02について承知したよ!的な、、


さらに数分後「New module Mojolicious::Plugin::Message::Locale」というタイトルのメールがきました。
今度はなんだなんだ、心配になってくる、、、、えっと 新しいモジュールについて、何日何時何分受け付けたよ。公開までは少しかかるよ 的な事が書いてある。なるほど。待ちましょう



しばし待ちます。。 4時間くらい経過して


ちゃんと更新されて、文字化けも直ったー!!

という感じでした。