v1.1.0
[app-cpan2pkg.git] / bin / cpan2pkg
blobccf7122be072596c93df1e101aa4fa753762d80e
1 #!/usr/bin/perl
3 # This file is part of App::CPAN2Pkg.
4 # Copyright (c) 2009 Jerome Quelin, all rights reserved.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the same terms as Perl itself.
11 use strict;
12 use warnings;
14 # for testing purposes
15 use FindBin qw{ $Bin };
16 use lib "$Bin/../lib";
18 use Getopt::Euclid;
19 use App::CPAN2Pkg::Curses;
20 use Hook::Output::File;
22 my $hook;
23 my $dir = _get_development_root();
24 if ( defined $dir ) {
25 $hook = Hook::Output::File->redirect(
26 stdout => "$dir/cpan2pkg.stdout",
27 stderr => "$dir/cpan2pkg.stderr",
29 warn '-' x 40 . "\n";
32 my $modules = $ARGV{'<module>'};
33 my $ui = App::CPAN2Pkg::Curses->spawn({modules=>$modules});
34 $ui->mainloop;
36 exit;
38 sub _get_development_root {
39 my $dir = "$Bin/..";
40 return $dir if -d "$dir/.git";
41 return;
44 __END__
46 =head1 NAME
48 cpan2pkg - generating native packages from cpan
51 =head1 DESCRIPTION
53 =head2 Purpose of the program
55 This script is a glue application around cpan2dist, interacting with
56 your upstream distribution. When calling this script, it will:
58 =over 4
60 =item *
62 check whether it's alrady packaged by your vendor, and install from it
63 if that's the case.
65 =item *
67 otherwise, build a native package with cpan2dist - this implies that
68 there is a working C<CPANPLUS::Dist> backend for your OS.
70 =item *
72 once built, import the module in upstream repository.
74 =item *
76 then submit module to upstream buildsystem.
78 =back
80 And this, while dealing with dependencies, all the way long, repeating
81 steps over and over as needed.
83 Read L<this blog entry|http://jquelin.blogspot.com/2009/01/cpan-modules-native-linux-
84 packages.html> for this module rationale.
89 =head2 How to use
91 See the options below (or C<cpan2pkg --help>) for more information on
92 how to launch the script. Once launched, you will get a curses
93 application, with a list on the left and some text on the right.
95 The left list contains all the modules currently being built / installed
96 / worked upon. You can get back to this list at any time by hitting the
97 F2 key. A plus (+) prefix means that module is available locally. A
98 minus (-) means that module is not yet available locally. A question
99 mark (?) prefix means that module needs help and that user should do
100 something before continuing.
102 The right list contains details on a given module: name, missing
103 prereqs, and everything being done for this module. One can change the
104 module shown by hitting the Enter key in the left list.
106 You can hit C<Ctrl+Q> at any time to quit the application. This will
107 also terminate all operations currently running.
111 =head1 REQUIRED ARGUMENTS
113 =over
115 =item <module>...
117 Module to install / build / package.
119 =back
122 =head1 OPTIONS
124 =over 4
126 =item --version
128 =item --usage
130 =item --help
132 =item --man
134 Print the usual program information
136 =back
140 =head1 AUTHOR
142 Jerome Quelin C<< <jquelin@cpan.org> >>
146 =head1 COPYRIGHT
148 Copyright (c) 2009 Jerome Quelin, all rights reserved.
150 This program is free software; you can redistribute it and/or modify it
151 under the same terms as Perl itself.