App-makedist

 view release on metacpan or  search on metacpan

bin/makedist  view on Meta::CPAN


    if(-e $_) {
      print '   ' . ok($_) if $opt_verbose;
      push(@files_in_dist, $_);
    }
    else {
      printf("%s %s from MANIFEST. Aborting.\n", bold($_), bg('red1', 'MISSING'));
      exit;
    }
  }
  if($opt_verbose) {
    print "  All files in MANIFEST present!\n";
    printf("  %d files to be added to distribution.\n", scalar @files_in_dist);
  }
}
#>



sub config_init { #< config
  my $config;
  if(-f "$ENV{XDG_CONFIG_HOME}/makedist/makedist.conf") {
    $config = "$ENV{XDG_CONFIG_HOME}/makedist/makedist.conf";
  }
  elsif(-f "$ENV{HOME}/.makedist.conf") {
    $config = "$ENV{HOME}/.makedist.conf";
  }
  else {
    print "makedist: no configuratino file found.\n";
  }
  require($config);
  warn "$@" if $@;
}
#>


sub ok {
  my $str = shift;
  return sprintf("%4s %s\n", fg('greenyellow', 'OK'), ls_color($str));
}




__END__


=pod

=head1 NAME

makedist - make cpan distribution

=head1 USAGE

    makedist [OPTIONS]

=head1 DESCRIPTION

makedist automates the process of creating a distribution to be
uploaded to CPAN.

The MANIFEST file is inspected for files to be included.

We make an attempt to extract the package name from any perl module
file found, and the package name must follow this convention:

    package File::LsColor;

If extraction fails, we use the basename of the current working
directory as a distribution name:

    ~/dev/makedist  => App-makedist

Version number is extracted from a perl module file if it exists, else
an App:: distribution is assumed and version is extracted from the bin/
directory.


=head1 CONFIGURATION

makedist looks for a configuration file in the following locations, in
order of precedence:

  $XDG_CONFIG_HOME/makedist/makedist.conf
  $HOME/.makedist.conf

Various options can be set in the makedist.conf configuration file.

By default, two variables can be accessed and modified in the
configuration file:

    # the basename of the gzipped tarball, i.e File-LsColor-0.192.tar.gz
    $finished_product

    # code to execute on success. A few examples are provided in the
    # configuration file.
    $command_on_success

The author uses the $command_on_success coderef like this:

    our $command_on_success = sub {
      copy();   # copy the dist to a local dir
      scp();    # scp the dist to a remote server
      upload(); # upload the dist to cpan
    }

An example configuration file is provided with this distribution.


=head1 OPTIONS

        --noconfig skip config file

    -v, --verbose explain what is being done
    -h, --help    show this help and exit

=head1 REPORTING BUGS

Report bugs and/or feature requests on L<https://github.com/trapd00r/makedist>,
the repository issue tracker or directly to L<m@japh.se>

=head1 AUTHOR

  Magnus Woldrich
  CPAN ID: WOLDRICH
  m@japh.se
  http://japh.se
  http://github.com/trapd00r

=head1 CONTRIBUTORS

None required yet.

=head1 COPYRIGHT

Copyright 2018 B<THIS APPLICATION>s L</AUTHOR> and L</CONTRIBUTORS> as listed
above.

=head1 LICENSE

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=head1 SEE ALSO

L<~/|http://japh.se>

=cut



( run in 1.545 second using v1.01-cache-2.11-cpan-b16cb0d3907 )