~ubuntu-core-dev/ubuntu/maverick/apport/ubuntu

« back to all changes in this revision

Viewing changes to debhelper/dh_apport

  • Committer: Martin Pitt
  • Date: 2010-02-10 17:00:58 UTC
  • mfrom: (1570.1.2 debhelper)
  • Revision ID: martin.pitt@canonical.com-20100210170058-omiyynsm9izlvasz
Add a dh_apport debhelper program, and a sequence addon making it
possible to use 'dh --with apport'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
 
 
3
=head1 NAME
 
4
 
 
5
dh_installapport - install apport package hooks
 
6
 
 
7
=cut
 
8
 
 
9
use strict;
 
10
 
 
11
use Debian::Debhelper::Dh_Lib;
 
12
 
 
13
=head1 SYNOPSIS
 
14
 
 
15
B<dh_apport> [S<B<debhelper options>>]
 
16
 
 
17
=head1 DESCRIPTION
 
18
 
 
19
dh_apport is a debhelper program that installs apport package hooks into
 
20
package build directories.
 
21
 
 
22
=head1 FILES
 
23
 
 
24
=over 4
 
25
 
 
26
=item debian/I<package>.apport
 
27
 
 
28
Installed into /usr/share/apport/package-hooks/I<package>.py in the package
 
29
build directory. This file is used to control apport's bug filing for this
 
30
package.
 
31
 
 
32
=item debian/source.apport
 
33
 
 
34
Installed into /usr/share/apport/package-hooks/source_I<src>.py (where
 
35
I<src> is the current source package name) in the package build directory of
 
36
the first package dh_apport is told to act on. By default, this is the first
 
37
binary package in debian/control, but if you use -p, -i, or -a flags, it
 
38
will be the first package specified by those flags. This file is used to
 
39
control apport's bug filing for all binary packages built by this source
 
40
package.
 
41
 
 
42
=back
 
43
 
 
44
=cut
 
45
 
 
46
init();
 
47
 
 
48
foreach my $package (@{$dh{DOPACKAGES}}) {
 
49
        next if is_udeb($package);
 
50
 
 
51
        my $tmp=tmpdir($package);
 
52
        my $hooksdir="$tmp/usr/share/apport/package-hooks";
 
53
        my $file=pkgfile($package,"apport");
 
54
 
 
55
        if ($file ne '') {
 
56
                if (! -d $hooksdir) {
 
57
                        doit("install","-d",$hooksdir);
 
58
                }
 
59
                doit("install","-p","-m644",$file,"$hooksdir/$package.py");
 
60
        }
 
61
 
 
62
        if (-e "debian/source.apport") {
 
63
                if (! -d $hooksdir) {
 
64
                        doit("install","-d",$hooksdir);
 
65
                }
 
66
                my $src=sourcepackage();
 
67
                doit("install","-p","-m644","debian/source.apport","$hooksdir/source_$src.py");
 
68
        }
 
69
}
 
70
 
 
71
=head1 SEE ALSO
 
72
 
 
73
L<debhelper(1)>
 
74
 
 
75
This program is a part of apport.
 
76
 
 
77
=head1 AUTHOR
 
78
 
 
79
Colin Watson <cjwatson@ubuntu.com>
 
80
 
 
81
Copyright (C) 2009 Canonical Ltd., licensed under the GNU GPL v2 or later.
 
82
 
 
83
=cut