]> git.donarmstrong.com Git - debhelper.git/blob - dh_installinfo
Merge commit 'remotes/modestas/buildsystems' into buildsystems
[debhelper.git] / dh_installinfo
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_installinfo - install info files
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_installinfo> [S<I<debhelper options>>] [B<-A>] [S<I<file ...>>]
15
16 =head1 DESCRIPTION
17
18 dh_installinfo is a debhelper program that is responsible for installing
19 info files into usr/share/info in the package build directory.
20
21 Any filenames specified as parameters will be installed into the first
22 package dh_installinfo is told to act on. By default, this is the first
23 binary package in debian/control, but if you use -p, -i, or -a flags, it
24 will be the first package specified by those flags.
25
26 Files named debian/package.info can list other files to be installed.
27
28 =head1 OPTIONS
29
30 =over 4
31
32 =item B<-A>, B<--all>
33
34 Install all files specified by command line parameters in ALL packages
35 acted on.
36
37 =item I<file ...>
38
39 Install these info files into the first package acted on. (Or in
40 all packages if -A is specified).
41
42 =back
43
44 =cut
45
46 init();
47
48 foreach my $package (@{$dh{DOPACKAGES}}) {
49         my $tmp=tmpdir($package);
50         my $file=pkgfile($package,"info");
51
52         my @info;
53         
54         if ($file) {
55                 @info=filearray($file, ".");
56         }
57
58         if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
59                 push @info, @ARGV;
60         }
61
62         if (@info) {
63                 if ( ! -d "$tmp/usr/share/info") {
64                         doit("install","-d","$tmp/usr/share/info");
65                 }
66                 doit("cp",@info,"$tmp/usr/share/info");
67                 doit("chmod","-R", "go=rX","$tmp/usr/share/info/");
68                 doit("chmod","-R", "u+rw","$tmp/usr/share/info/");
69                 # For transition, could be removed later.
70                 addsubstvar($package, "misc:Depends", "dpkg (>= 1.15.4) | install-info");
71         }
72 }
73
74 =head1 SEE ALSO
75
76 L<debhelper(7)>
77
78 This program is a part of debhelper.
79
80 =head1 AUTHOR
81
82 Joey Hess <joeyh@debian.org>
83
84 =cut