3
  6   ;ˆl–Ðz¾” ”Ê:”Ê�jãm\ŠbÑ¿�þY�ÇÖnP´ø€1�ùÚ„bÿÙ¿× ;i    ;#!/usr/bin/perl

=head1 NAME

dh_strip - strip executables, shared libraries, and some static libraries

=cut

use strict;
use warnings;
use File::Find;
use Debian::Debhelper::Dh_Lib;

our $VERSION = DH_BUILTIN_VERSION;

=head1 SYNOPSIS

B<dh_strip> [S<I<debhelper options>>] [B<-X>I<item>] [B<--dbg-package=>I<package>] [B<--keep-debug>]

=head1 DESCRIPTION

B<dh_strip> is a debhelper program that is responsible for stripping
out debug symbols in executables, shared libraries, and static
libraries that are not needed during execution.

This program examines your package build directories and works out what
to strip on its own. It uses L<file(1)> and file permissions and filenames
to figure out what files are shared libraries (F<*.so>), executable binaries,
and static (F<lib*.a>) and debugging libraries (F<lib*_g.a>, F<debug/*.so>), and
strips each as much as is possible. (Which is not at all for debugging
libraries.) In general it seems to make very good guesses, and will do the
right thing in almost all cases.

Since it is very hard to automatically guess if a file is a
module, and hard to determine how to strip a module, B<dh_strip> does not
currently deal with stripping binary modules such as F<.o> files.

=head1 OPTIONS

=over 4

=item B<-X>I<item>, B<--exclude=>I<item>

Exclude files that contain I<item> anywhere in their filename from being
stripped. You may use this option multiple times to build up a list of
things to exclude.

=item B<--dbg-package=>I<package>

B<This option is a now special purpose option that you normally do not
need>.  In most cases, there should be little reason to use this
option for new source packages as debhelper automatically generates
debug packages ("dbgsym packages").  B<If you have a manual
--dbg-package> that you want to replace with an automatically
generated debug symbol package, please see the B<--dbgsym-migration>
option.

Causes B<dh_strip> to save debug symbols stripped from the packages it acts on
as independent files in the package build directory of the specified debugging
package.

For example, if your packages are libfoo and foo and you want to include a
I<foo-dbg> package with debugging symbols, use B<dh_strip --dbg-package=>I<foo-dbg>.

This option implies B<--no-automatic-dbgsym> and I<cannot> be used
with B<--automatic-dbgsym> or B<--dbgsym-migration>.

=item B<-k>, B<--keep-debug>

B<This option is a now special purpose option that you normally do not
need>.  In most cases, there should be little reason to use this
option for new source packages as debhelper automatically generates
debug packages ("dbgsym packages").  B<If you have a manual
--dbg-package> that you want to replace with an automatically
generated debug symbol package, please see the B<--dbgsym-migration>
option.

Debug symbols will be retained, but split into an independent
file in F<usr/lib/debug/> in the package build directory. B<--dbg-package>
is easier to use than this option, but this option is more flexible.

This option implies B<--no-automatic-dbgsym> and I<cannot> be used
with B<--automatic-dbgsym>.

=item B<--dbgsym-migration=>I<package-relation>

This option is used to migrate from a manual "-dbg" package (created
with B<--dbg-package>) to an automatic generated debug symbol
package. This option should describe a valid B<Replaces>- and
B<Breaks>-relation, which will be added to the debug symbol package to
avoid file conflicts with the (now obsolete) -dbg package.

This option implies B<--automatic-dbgsym> and I<cannot> be used with
B<--keep-debug>, B<--dbg-package> or B<--no-automatic-dbgsym>.

Examples:

  dh_strip --dbgsym-migration='libfoo-dbg (<< 2.1-3~)'

  dh_strip --dbgsym-migration='libfoo-tools-dbg (<< 2.1-3~), libfoo2-dbg (<< 2.1-3~)'

=item B<--automatic-dbgsym>, B<--no-automatic-dbgsym>

Control whether B<dh_strip> should be creating debug symbol packages
when possible.

The default is to create debug symbol packages.

=item B<--ddebs>, B<--no-ddebs>

Historical name for B<--automatic-dbgsym> and B<--no-au