A Go implementation of cpanminus, a lightweight CPAN client.
THIS IS A WORK IN PROGRESS
go-cpanm aims to provide the same functionality as cpanminus (the Perl-based CPAN client), but implemented as a single Go executable with no external dependencies. It allows you to download, build, and install Perl modules from CPAN.
- Download Perl modules from CPAN
- Resolve dependencies
- Build and install modules1
- Support for various installation targets (local, global)2
- Single binary executable with no runtime dependencies
- [ ]Works with standard Perl module installation (ExtUtils::MakeMaker and Module::Build)
-
Clone the repository:
git clone https://github.com/perigrin/go-cpanm.git cd go-cpanm
-
Build the executable:
go build -o go-cpanm ./cmd/cpanm
-
Install to your PATH:
sudo cp go-cpanm /usr/local/bin/
go-cpanm [options] Module::Name
Options:
--local-lib, -l DIR Specify the install base to install modules
--target DIR Specify the target directory to install modules
--sudo sudo to install modules to system directories
--force Force install modules
--verbose Verbose output
--quiet Suppress output
--notest Skip the testing
--installdeps Only install dependencies
--help Show this help message
--version Show version
Install a module:
go-cpanm Moose
Install multiple modules:
go-cpanm Moose Plack DBI
Install a module and its dependencies in a local directory:
go-cpanm --local-lib=~/perl5 Moose
Force installation even if tests fail:
go-cpanm --force Moose
Show verbose output:
go-cpanm --verbose Moose
Skip running tests:
go-cpanm --notest Moose
Only install dependencies:
go-cpanm --installdeps Moose
go-cpanm is implemented in Go and consists of several components:
- Fetcher: Downloads module metadata and tarballs from CPAN
- Parser: Parses module metadata and extracts tarballs
- Builder: Builds Perl modules
- Installer: Installs Perl modules
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Tatsuhiko Miyagawa for creating the original cpanminus
- The Perl community for maintaining CPAN