Debian/Perl.pm

filter: Statementstmt 66.6% 20 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 53.8% 7 / 13 Podpod 0.0% 0 / 2 totaltotal 60.0% 27 / 45 CC 1 SCAR 3.8
CC
1
Cov
67%
build
2.0
release
2.0
make_debian
2.0
CRAP 1.5
« Module/Install/Debian/Perl.pm ↑ Summary
1 ##
2 # name: Debian::Perl
3 # abstract: Package Perl Modules for Debian. Painlessly!
4 # author: Ingy döt Net
5 # license: perl
6 # copyright: 2011
7 # see:
8 # - DhMakePerl
9 # - Module::Install::Debian::Perl
10  
11 package Debian::Perl;
12 1 ▶use 5.008003;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 our $VERSION = '0.01';
14 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 0 ▶sub build {
Subroutine build: not called CC=1 SCAR=6.9
17 0 print "\nBuilding your Debian Package...\n";
18 0 sleep 1;
19 0 print "\n...just kidding. coming soon though!\n\n";
20 }
21  
22 0 ▶sub release {
Subroutine release: not called CC=1 SCAR=6.9
23 0 print "\nReleasing your Debian Package...\n";
24 0 sleep 1;
25 0 print "\n...just kidding. coming soon though!\n\n";
26 }
27  
28 sub make_debian {
29 Debian::Perl->new->build;
30 }
31  
32 sub make_release {
33 Debian::Perl->new->release;
34 }
35  
36 #-----------------------------------------------------------------------------
37 # App::Cmd support for the `debian-perl` command.
38 #-----------------------------------------------------------------------------
39 0 ▶sub make_debian {
Subroutine make_debian: not called CC=1 SCAR=6.9
40 0 Debian::Perl->new->build;
41 }
42  
43 0 ▶sub make_release {
Subroutine make_release: not called CC=1 SCAR=6.9
44 0 Debian::Perl->new->release;
45 }
46  
47 package Debian::Perl::Cmd;
48 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
49 extends 'MouseX::App::Cmd';
50  
51 package Debian::Perl::Cmd::Command;
52 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
53 extends 'MouseX::App::Cmd::Command';
54  
55 1 ▶use constant abstract => '';
Subroutine BEGIN: called CC=1 SCAR=0.0
56  
57 package Debian::Perl::Cmd::Command::build;
58 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
59 extends 'Debian::Perl::Cmd::Command';
60  
61 0 ▶sub execute {
Subroutine execute: not called CC=1 SCAR=6.9
Pod undocumented
62 0 Debian::Perl->new->build;
63 }
64  
65 package Debian::Perl::Cmd::Command::release;
66 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
67 extends 'Debian::Perl::Cmd::Command';
68  
69 0 ▶sub execute {
Subroutine execute: not called CC=1 SCAR=6.9
Pod undocumented
70 0 Debian::Perl->new->release;
71 }
72  
73 1;
74  
75 =head1 SYNOPSIS
76  
77 From the command line:
78  
79 > debian-perl build
80 > debian-perl release
81  
82 From a Perl module directory:
83  
84 > Perl Makefile.PL
85 > make debian
86 > make release
87  
88 =head1 DESCRIPTION
89  
90 If you are a Perl module author, you probably know quite a bit about Perl,
91 modules and CPAN. You probably know about Debian Linux. There's even a decent
92 chance you've used it. However, there's only a very slim chance that you
93 maintain Debian packages for your modules.
94  
95 Let's assume that this at least vaguely describes you. If someone told you
96 that you could flip a switch, and then every time you released a module to
97 CPAN, it went to Debian (perfectly packaged to their standards), you'd
98 probably flip that switch.
99  
100 This module aspires to be that switch. It wants you to be a Debian Maintainer
101 for free. You may end up becoming a full fledged Debian guru one day, but for
102 now you just want to see your code available to a whole new world, without
103 having to know the details. As long as this switch doesn't tell you
104 otherwise, you know that you did the all right things.
105  
106 This module is just a helping hand that automates all the standard best
107 practices for you. It bends over backwards to help you get that module to
108 Debian without having to know any more than is expected of a busy Perl module
109 author, like you.
110  
111 Specifically it uses things like C<dh-make-perl>, C<debuild>, C<pbuilder> and
112 C<lintian>. If you've never heard of these things, that's ok. Until this week,
113 neither did I. They all do a lot of work, and they aren't that hard to use,
114 but the learning curve is quite high. As soon as Debian::Perl is stable and
115 shipping all my CPAN modules to Debian, I plan to forget about them as quickly
116 as possible. :)
117  
118 =head1 USAGE
119  
120 There are two ways to use this module. There is a command called
121 C<debian-perl> that you can use to prepare, build, test and release Debian
122 packages from your Perl module. There is also a Module::Install plugin that
123 allows you to simply do:
124  
125 > make debian
126  
127 See L<Module::Install::Debian::Perl>
128  
129 =head1 MORE DOCUMENTATION
130  
131 Coming soon...
132  
133 =head1 STATUS
134  
135 This module is brand new and in heavy development. Nothing to see here. Move
136 along.
137  
138 =head1 KUDOS
139  
140 Many thanks to the great folks at Strategic Data for supporting the creation
141 of this module.
142  
143 Extra special thanks to Andrew Pam, the resident Debian guru at Strategic
144 Data, for providing all the right pointers.
145  
146 Also a nod to Jeremiah Foster whose article in The Perl Review from the Spring
147 2009 issue, not only pointed me in the right directions, but also convinced me
148 that the process was still not quite consumable by the masses. I look forward
149 to working with you and the debian-perl team.
« Module/Install/Debian/Perl.pm ↑ Summary