Follow the same guidelines as normal for creating a Juju charm.
Structure your project should look similar to:
charm-project/ hooks/ install config-changed start stop tests/ 00-basic.test lib/ myplugin.pm t/ 00_unittest1.t config.yaml metadata.yaml LICENSE README.md
Hooks are written using perl with automatically imported helpers for convenience. When developing hooks they should reside in hooks.
A requirement for all charms using this library is to make sure to "bootstrap" the install hook. For example, edit hooks/install
#!/usr/bin/env perl # Setup correct paths use FindBin; use lib "$Bin/../lib"; use charm; pkg [ 'nginx-full', 'php-fpm', 'php-cgi', 'php-curl', 'php-gd', 'php-json', 'php-mcrypt', 'php-readline', 'php-mbstring', 'php-xml' ], ensure => "present", on_change => sub { say "All latest packages installed."; }; my $hook_path = $ENV{JUJU_CHARM_DIR};
To install App::CharmKit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::CharmKit
CPAN shell
perl -MCPAN -e shell install App::CharmKit
For more information on module installation, please visit the detailed CPAN module installation guide.