1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563
|
#!/usr/bin/perl
use strict;
use warnings;
use DhMakePerl;
print "== dh-make-perl $DhMakePerl::VERSION ==\n";
exit DhMakePerl->run;
__END__
=encoding utf8
=head1 NAME
dh-make-perl - Create debian source packages from Perl modules
=head1 SYNOPSIS
=over
=item dh-make-perl [make] {I<SOURCE_DIR> | --cpan I<MODULE>|I<DIST>} I<options...>
=item dh-make-perl refresh {I<--only ...>} [directory]
=item dh-make-perl locate Foo::Bar ...
=item dh-make-perl refresh-cache
=item dh-make-perl dump-config
=item dh-make-perl help
=item cpan2deb I<MODULE>|I<DIST> I<options...>
=item cpan2dsc I<MODULE>|I<DIST> I<options...>
=back
=head1 DESCRIPTION
B<dh-make-perl> will create the files required to build
a debian source package out of a Perl module or CPAN distribution.
This works for most simple packages and is also useful
for getting started with packaging Perl modules.
You can specify a module or distribution name with the L<--cpan>
switch and B<dh-make-perl> will download it for you from a CPAN mirror, or you
can specify the directory with the already unpacked sources. If neither
L<--cpan> nor a directory is given as argument, B<dh-make-perl>
tries to create a Perl package from the data in the current directory.
You can build and install the debian binary package using the
L</--build> and L</--install> command line switches.
If B<dh-make-perl> is called as
cpan2deb <options...> Foo::Bar
it behaves like
dh-make-perl make <options...> --build --cpan Foo::Bar
If B<dh-make-perl> is called as
cpan2dsc <options...> Foo::Bar
it behaves like
dh-make-perl make <options...> --build-source --cpan Foo::Bar
Using this program is no excuse for not reading the
debian developer documentation, including the Debian policy,
the Debian Perl policy, the packaging manual and so on.
=head2 COMMANDS
=over
=item make
Default command if no command is given. Creates debianisation from scratch.
Fails with an error if F<debian/> directory already exists.
=item refresh [directory]
For refreshing a package. C<directory> defaults to the current working
directory. Rebuilds F<debian/copyright>, F<debian/rules>, F<debian/compat>
using the current templates. Before any changes are made to these files, a
backup copy is created with a .bak suffix.
This is useful when F<debian/rules> was created using older templates and
doesn't contain much customisations. As always, you're strongly encouraged to
verify if F<debian/rules> looks sane.
C<refresh> also tries to update dependency lists in F<debian/control> from
F<META.yml>.
When updating F<debian/copyright> dh-make-perl tries to be clever about
remembering email addresses. It gets the list of copyright holders and their
emails for F<debian/*> from the sign off lines in F<debian/changelog>.
However to allow for email addresses changing, it looks for change lines
of the form
* Email change: Debbie Devlin -> devlin@debian.org
So now C<Debbie Devlin E<lt>devlin@debian.orgE<gt>> will be used in the copyright
instead of C<Debbie Devlin E<lt>debbie@devlin.orgE<gt>>.
=item B<--only> | B<-o> I<control|copyright|docs|examples|rules>
This option allows one to update only one or more file(s) in the debian/
directory when B<dh-make-perl> is run in L</refresh> mode. Filenames are
separated by a comma. The option can be given multiple times, accumulating
arguments.
=item locate I<MODULE> ...
Tries to locate the package that contains the given Perl I<MODULE>s.
Example:
dh-make-perl locate IPC::Run3 XML::Tidy
=item refresh-cache
B<dh-make-perl> parses the Contents files, fetched by L<apt-file(1)> and stores
the result in a cache. The cache is refreshed automatically if it is older than
any Contents file. However, if you run L<apt-file(1)> in your nightly cron job,
the first time you run B<dh-make-perl> during the day, you shall wait for the
cache to be reconstructed. With this option, you can move the cache re-creation
to the cron job, right after C<apt-file update>.
Does nothing if the cache is newer that the Contents files.
=item dump-config
Causes the current config, including any default settings to be printed to the
standard output.
Useful for populating L<dh-make-perl.conf> file.
=item help
Displays short usage information.
=back
=head2 OPTIONS
=over
=item B<--arch> I<any> | I<all>
This switches between arch-dependent and arch-independent packages. If B<--arch>
isn't used, B<dh-make-perl> uses a relatively good-working algorithms to
decide this alone.
=item B<--backups> | B<--no-backups>
In L</refresh> mode, create backups of F<debian/copyright> and
F<debian/rules> before overwritting them. On by default.
=item B<--basepkgs>
Explicitly gives a comma-separated list of packages to consider "base"
packages (i.e. packages that should always be available in Debian
systems). This option defaults to C<perl,perl-base> - it
is used to check for module dependencies. If a needed module is in the
C<basepkgs>, it won't be mentioned in the C<depends:> field of
C<debian/control>.
If this option is specified, the above mentioned default packages will
not be included (but will be mentioned as explicit dependencies in the
resulting package). You can, of course, mention your own modules
and explicitly specify the default values.
Note that this option should be used sparsingly and with care, as it
might lead to packages not being rebuildable because of unfulfilled
dependencies.
=item B<--bdepends> I<BUILD-DEPENDS>
Manually specify a string to be B<addedd> to the module's build-dependencies
(that is, the packages and their versions that have to be installed in order to
successfully build the package). Keep in mind that packages generated by
B<dh-make-perl> require debhelper to be specified as a build dependency. Same note
as for --depends applies here - use only when needed.
=item B<--bdependsi> I<BUILD-DEPENDS-INDEP>
Manually specify a string to be B<addedd> to the module's build-dependencies
for architecture-independent builds. Same notes as those for the --depends
and --bdepends options apply here.
=item B<--build>
Builds the binary package (i.e. the .deb file) after setting the
package directory up.
NB: This builds only a binary package (by calling "fakeroot debian/rules
binary") and does not sign the package. It is meant for a quick local
install of a package, not for creating a package ready for submission to the
Debian archive.
=item B<--build-source>
Builds the source package (i.e. the .dsc and .debian.tar.gz files)
after setting the package directory up.
NB: This builds only a source package (by calling "dpkg-source -b")
and does not sign the package. It is meant for a quick local install
of a source package to be thrown into e.g. a pbuilder, not for
creating a source package ready for submission to the Debian archive.
=item B<--closes> I<ITPBUG>
Manually specify the ITP bug number that this package closes. If not
given, B<dh-make-perl> will try to connect to bugs.debian.org to fetch the
appropriate bug number, using WWW::Mechanize.
=item B<--core-ok>
Allows building core Perl modules. By default, B<dh-make-perl> will not allow
building a module that is shipped as part of the standard Perl library; by
specifying this option, B<dh-make-perl> will build them anyway.
Note that, although it is not probable, this might break unrelated items in
your system - if a newer version of a core module breaks the API, all kinds
of daemons might get upset ;-)
=item B<--cpan> I<MODULE>|I<DIST>
Instructs B<dh-make-perl> to fetch and extract the given CPAN module or
distribution. Works both with C<Foo::Bar> and C<Foo-Bar>.
=item B<--cpan-mirror> I<MIRROR>
Specifies a CPAN site to use as mirror.
=item B<--data-dir> I<DIRECTORY>
Use another data directory, instead of the default, C</usr/share/dh-make-perl>
Data directory is were B<dh-make-perl> looks for its default rules.* templates.
It is similar to B<--home-dir>, but does not change the location of the APT
Contents cache file. If both are given, B<--home-dir> takes precedence.
=item B<--depends> I<DEPENDS>
Manually specify a string to be B<addedd> to the module's dependencies. This
should be used when building modules where B<dh-make-perl> cannot guess the Perl
dependencies (such as modules built using L<Module::Install>), or when the
Perl code depends on non-Perl binaries or libraries. Usually, B<dh-make-perl>
will figure out the dependencies by itself. If you need to pass B<dh-make-perl>
dependency information, you must do it using the debian package format. i.e.
dh-make-perl --depends libtest-more-perl
=item B<--desc> I<SHORT DESCRIPTION>
Uses the argument to --desc as short description for the package.
=item B<--dh> I<VERSION>
Set desired debhelper compatibility level. The default is 11.
Since version 0.77, B<dh-make-perl> only supports debhelper compatibility
levels B<< >=8 >>.
See L<debhelper(1)>.
=item B<--dist> I<DISTRIBUTION>
Limit the distributions whose C<Contents> files are parsed. The argument is a distribution name.
Default: empty, meaning no filtering.
Example:
dh-make-perl --dist etch
=item B<--email> | B<-e> I<EMAIL>
Manually specify the Maintainer email address to use in debian/control and
in debian/changelog.
=item B<--exclude> | B<-i> [I<REGEX>]
This allows you to specify a PCRE to exclude some files from the search for
docs and stuff like that. If no argument is given (but the switch is specified
- not specifying the switch will include everything), it defaults to
dpkg-source's default values.
=item B<--install>
Installs the freshly built package. Specifying --install implies --build - The
package will not be installed unless it was built (obviously ;-) )
=item B<--install-deps>
Install all dependencies for the module, as long as those dependencies are
available as Debian packages.
=item B<--install-build-deps>
Install dependencies required for building the module, as long as those dependencies
are available as Debian packages.
=item B<--intrusive>
When determining module dependencies, if L<Module::Depends> fails, tries again
with L<Module::Depends::Intrusive>. M:D:I loads all .pm files, intercepting
loading of other modules, effectively running untrusted code on your behalf.
Use with caution.
=item B<--network>
Enables querying of Debian WNPP lists for ITP and similar bugs. Enabled by
default, use C<--no-network> to disable.
=item B<--notest>
This option for not running the automatic testing of the module as part of
the build script has been removed in 0.54. Please put nocheck in the
DEB_BUILD_OPTIONS environment variable if you want to skip the tests when
building a package.
=item B<--home-dir> I<DIRECTORY>
Where APT Contents and other caches are stored.
Default: ~/.dh-make-perl
=item B<--packagename> | B<-p> I<PACKAGENAME>
Manually specify the Package Name, useful when the module has dashes in its
name.
=item B<--pkg-perl>
Useful when preparing a package for the Debian Perl Group
L<https://perl-team.pages.debian.net/>.
Sets C<Maintainer>, C<Uploaders>, C<Vcs-Git> and C<Vcs-Browser> fields in
F<debian/control> accordingly. Also, when C<--vcs git> is used (the default),
sets up a Git remote pointing to the right place on I<salsa.debian.org>.
=item B<--recursive>
Valid only in L</make> mode with L</--cpan> or I<directory> arguments. Causes
dh-make-perl to try to create packaging (and possibly build and install the
packages if L</--build> and L</--install> options are also given) for any
dependencies which are missing packages.
This works like this: when the 'main' package is constructed, any missing
packages are put in a list, and then the debianisation procedure is run in turn
on each of them, recursively.
=item B<--requiredeps>
Fail if a dependency Perl package was not found.
=item B<--revision> I<REVISION>
Specifies the debian revision of the resulting package.
Useful when you want to let dh-make-perl discover the ustream version, but
still enforce a specific debian revision, e.g. when backporting.
Overridden by L<--version>.
=item B<--source-format> I<format>
When creating or refreshing packaging, use the specified source format.
Defaults to C<3.0 (quilt)>.
=item B<--vcs> I<VCS>
In B<--pkg-perl> mode, use the specified version control system in the
generated I<Vcs-*> fields. The default is C<git>.
If I<VCS> is C<git>, C<dh-make-perl> will setup a Git repository with three
branches:
=over
=item upstream
The initial branch containing upstream sources
=item master
The branch where packaging is done, forked off C<upstream> and with the
contents of the C<debian/> directory added.
=item pristine-tar
A branch to keep L<pristine-tar(1)> data.
=back
If B<--pkg-perl> is also given, an C<origin> remote is added pointing to the
repository on I<salsa.debian.org>.
=item B<--verbose> | B<--no-verbose>
Print additional information while processing.
--verbose is on by default in L</make> mode, off otherwise.
=item B<--version> I<VERSION>
Specifies the version of the resulting package.
Usually calculated correctly but B<--version> can override wrong guesses.
I<Note> that this is not the upstream version. For a non-native package you
need to include the Debian revision here, e.g. for a new package of
upstream's x.y release this would be B<x.y-1>.
=back
=head2 DEPENDENCY RESOLUTION
For mapping upstream build, test, and runtime requirements to build and
runtime dependencies on Debian packages, B<dh-make-perl> can use APT's
F<Contents> files, if L<apt-file(1)> is installed, and additionally
F</var/lib/dpkg/available>, if C<libdpkg-parse-perl> is installed.
=head1 FILES
The following directories will be searched to find additional files
required by B<dh-make-perl>:
/usr/share/dh-make-perl/
$HOME/.dh-make-perl/
=over 4
=item * dh-make-perl.conf
User configuration. The file is in YAML format. The keys are option names,
as documented in L</OPTIONS> (without leading I<-->).
See the output of C<dh-make-perl --dump-config>, which can also be used for
population of F<dh-make-perl.conf>.
=back
=head1 ENVIRONMENT
HOME - get user's home directory
DEBFULLNAME - get the real name of the maintainer
LOGNAME or USER - get the username
DEBEMAIL or EMAIL - get the email address of the user
=head1 BUGS
Several, let me know when you find them.
=head1 AUTHOR
Paolo Molaro E<lt>lupus@debian.orgE<gt> (MIA)
Maintained for a time by Ivan Kohler E<lt>ivan-debian@420.amE<gt>.
Maintained for a time by Marc Brockschmdit E<lt>marc@dch-faq.deE<gt>.
Maintained for a time by Gunnar Wolf E<lt>gwolf@gwolf.orgE<gt>.
Now team-maintained by the Debian Perl Group, https://salsa.debian.org/perl-team/modules/packages/dh-make-perl
Patches from:
=over
=item Adam Sjoegren E<lt>asjo@koldfront.dkE<gt>
=item Adrian Phillips E<lt>adrianp@powertech.noE<gt>
=item Amos Shapira E<lt>amos.shapira@gmail.comE<gt>
=item Ansgar Burchardt E<lt>ansgar@debian.orgE<gt>
=item Axel Beckert E<lt>abe@debian.orgE<gt>
=item Carnë Draug E<lt>carandraug+dev@gmail.comE<gt>
=item Christian Kurz E<lt>shorty@debian.orgE<gt>
=item Christopher Hoskin E<lt>mans0954@debian.orgE<gt>
=item Damyan Ivanov E<lt>divanov@creditreform.bgE<gt>
=item David Paleino E<lt>d.paleino@gmail.comE<gt>
=item David Pashley E<lt>david@davidpashley.comE<gt>
=item Dima Kogan E<lt>dima@secretsauce.netE<gt>
=item Edward Betts E<lt>edward@debian.orgE<gt>
=item Fermin Galan E<lt>galan@dit.upm.esE<gt>
=item Geoff Richards E<lt>qef@ungwe.orgE<gt>
=item Gergely Nagy E<lt>algernon@bonehunter.rulez.orgE<gt>
=item gregor herrmann E<lt>gregoa@debian.orgE<gt>
=item Hilko Bengen E<lt>bengen@debian.orgE<gt>
=item Kees Cook E<lt>keex@outflux.netE<gt>
=item Jesper Krogh E<lt>jesper@krogh.ccE<gt>
=item Johnny Morano E<lt>jmorano@moretrix.comE<gt>
=item Juerd E<lt>juerd@ouranos.juerd.netE<gt>
=item Marc Chantreux (mail withheld)
=item Matt Hope E<lt>dopey@debian.orgE<gt>
=item Matthew Gabeler-Lee E<lt>cheetah@fastcat.orgE<gt>
=item Maximilian Gass E<lt>mxey@cloudconnected.orgE<gt>
=item Noel Maddy E<lt>noel@zhtwn.comE<gt>
=item Oleg Gashev E<lt>oleg@gashev.netE<gt>
=item Oliver Gorwits E<lt>oliver.gorwits@oucs.ox.ac.ukE<gt>
=item Paul Fenwick E<lt>pjf@perltraining.com.auE<gt>
=item Peter Flanigan E<lt>Support@RoxSoft.co.ukE<gt>
=item Peter Moerch E<lt>mn3k66i02@sneakemail.comE<gt>
=item Peter Pentchev E<lt>roam@ringlet.netE<gt>
=item Ryan Niebur E<lt>ryanryan52@gmail.comE<gt>
=item Salvatore Bonaccorso E<lt>carnil@debian.orgE<gt>
=item Stephen Oberholtzer E<lt>oliverklozoff@gmail.comE<gt>
=item Tim Retout E<lt>diocles@debian.orgE<gt>
=item Ton Nijkes E<lt>tonn@wau.mis.ah.nlE<gt>
=back
... And others who, sadly, we have forgot to add :-/
=cut
# vim: set ts=8 sw=4 et ft=perl :
|