cpan-mirror-tiny - CPAN::Mirror::Tiny command line interface
$ cpan-mirror-tiny inject [option] url1 url2 ... $ cpan-mirror-tiny gen-index [option] $ cpan-mirror-tiny cat-index [option] $ cpan-mirror-tiny list [option] $ cpan-mirror-tiny server [option]
-h, --help show help -v, --version show version -a, --author specify author, default: VENDOR -b, --base base directory, default: $ENV{PERL_CPAN_MIRROR_TINY_BASE} or ./darkpan
$ cpan-mirror-tiny inject cpan:Plack $ cpan-mirror-tiny inject cpan:Plack@1.0039 $ cpan-mirror-tiny inject --author YOU http://exmpale.com/Module-0.01.tar.gz $ cpan-mirror-tiny inject --author YOU git://github.com/you/Module.git@develop $ cpan-mirror-tiny inject --author YOU /path/to/local/Module-0.01.tar.gz $ cpan-mirror-tiny inject --author YOU /path/to/local/dir
This is a command line interface for CPAN::Mirror::Tiny. You can easily create your darkpan with this script.
Let's create your darkpan in ./darkpan directory.
./darkpan
First inject distributions into your darkpan with inject command:
inject
# from github, with optional ref (revision/tag/branch) $ cpan-mirror-tiny inject --author SKAJI git://github.com/skaji/cpm.git $ cpan-mirror-tiny inject --author SKAJI https://github.com/skaji/cpm@0.118 # from cpan, with optional version (author is automatically guessed) $ cpan-mirror-tiny inject cpan:Plack $ cpan-mirror-tiny inject cpan:Dist::Zilla@5.046 # from http server $ cpan-mirror-tiny inject --author YOU http://example.com/path/to/Your-Module-0.01.tar.gz # from local file/directory $ cpan-mirror-tiny inject --author YOU /path/to/local/Module-0.01.tar.gz $ cpan-mirror-tiny inject --author YOU /path/to/local/dir
Second, create the index file 02packages.details.txt.gz by gen-index command:
gen-index
$ cpan-mirror-tiny gen-index
Check your darkpan with list command:
list
$ cpan-mirror-tiny list
Now your darkpan has your own distributions. Let's install distributions with CPAN client cpm:
$ cpm install --resover 02packages,file://$PWD/darkpan --resover metadb Your::Module
If you want to use your darkpan in other hosts, run a http server first:
[host1]$ cpan-mirror-tiny server HTTP::Server::PSGI: Accepting connections at http://0:5000/
Then
[host2]$ cpm install --resolver 02packages,http://host1:5000 --resolver metadb Your::Module
Moreover you can inject/upload your modules against http://host1:5000/upload:
http://host1:5000/upload
[host2]$ curl --data-urlencode 'module=git://github.com/skaji/Carl.git' \ --data-urlencode 'author=SKAJI' http://host1:5000/upload
[host2]$ export CPAN_UPLOADER_UPLOAD_URI=http://host1:5000/upload [host2]$ cpan-upload --user SKAJI --password dummy /path/to/local/Module-0.01.tar.gz
Note that cpan-mirror-tiny server accepts the same options as plackup such as --port, --server:
cpan-mirror-tiny server
plackup
--port
--server
[host1]$ cpan-mirror-tiny server --server Starman --port 8888
To install CPAN::Mirror::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Mirror::Tiny
CPAN shell
perl -MCPAN -e shell install CPAN::Mirror::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.