]> git.donarmstrong.com Git - debhelper.git/blob - dh_auto_install
merge master
[debhelper.git] / dh_auto_install
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_auto_install - automatically runs make install or similar
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11 use Debian::Debhelper::Dh_Buildsystems;
12 use Cwd;
13
14 =head1 SYNOPSIS
15
16 B<dh_auto_install> [S<I<debhelper options>>] [S<B<--> I<params>>]
17
18 =head1 DESCRIPTION
19
20 dh_auto_install is a debhelper program that tries to automatically install
21 built files. If there's a Makefile and it contains a "install" target,
22 then this is done by running make (or MAKE, if the environment variable is
23 set). If there is a setup.py or Build.PL, it is used.
24
25 The files are installed into debian/<package>/ if there is only one binary
26 package. In the multiple binary package case, the files are instead
27 installed into debian/tmp/, and should be moved from there to the
28 appropriate package build directory using L<dh_install(1)> or
29 L<dh_movefiles(1)>.
30
31 DESTDIR is used to tell make where to install the files. 
32 If the Makefile was generated by MakeMaker from a Makefile.PL, it will
33 automatically set PREFIX=/usr too, since such Makefiles need that.
34
35 This is intended to work for about 90% of packages. If it doesn't work, or
36 tries to use the wrong install target, you're encouraged to skip using
37 dh_auto_install at all, and just run make install manually.
38
39 =head1 OPTIONS
40
41 =over 4
42
43 =item B<--> I<params>
44
45 Pass "params" to the program that is run. These can be used to supplement
46 or override the any standard parameters that dh_auto_install passes.
47
48 =back
49
50 =cut
51
52 buildsystems_init();
53
54 my $destdir;
55 my @allpackages=getpackages();
56 if (@allpackages > 1) {
57         $destdir="debian/tmp";
58 }
59 else {
60         $destdir=tmpdir($dh{MAINPACKAGE});
61 }
62 $destdir=cwd()."/".$destdir;
63
64 buildsystems_do("install", $destdir);
65
66 =head1 SEE ALSO
67
68 L<debhelper(7)>
69
70 This program is a part of debhelper.
71
72 =head1 AUTHOR
73
74 Joey Hess <joeyh@debian.org>
75
76 =cut