]> git.donarmstrong.com Git - debhelper.git/blob - dh_auto_install
Merge branch 'master' into buildsystems
[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<build system options>>] [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. It does so by running the appropriate command for the build
22 system it detects the package uses. For example, if there's a Makefile and
23 it contains a "install" target, then this is done by running make (or MAKE,
24 if the environment variable is set). If there is a setup.py or Build.PL,
25 it is used. Note that the Ant build system does not support installation,
26 so dh_auto_install will not install files built using Ant.
27
28 The files are installed into debian/<package>/ if there is only one binary
29 package. In the multiple binary package case, the files are instead
30 installed into debian/tmp/, and should be moved from there to the
31 appropriate package build directory using L<dh_install(1)>.
32
33 DESTDIR is used to tell make where to install the files. 
34 If the Makefile was generated by MakeMaker from a Makefile.PL, it will
35 automatically set PREFIX=/usr too, since such Makefiles need that.
36
37 This is intended to work for about 90% of packages. If it doesn't work, or
38 tries to use the wrong install target, you're encouraged to skip using
39 dh_auto_install at all, and just run make install manually.
40
41 =head1 OPTIONS
42
43 See L<debhelper(7)/BUILD SYSTEM OPTIONS> for a list of common build
44 system selection and control options.
45
46 =over 4
47
48 =item B<--> I<params>
49
50 Pass "params" to the program that is run. These can be used to supplement
51 or override the any standard parameters that dh_auto_install passes.
52
53 =back
54
55 =cut
56
57 buildsystems_init();
58
59 my $destdir;
60 my @allpackages=getpackages();
61 if (@allpackages > 1) {
62         $destdir="debian/tmp";
63 }
64 else {
65         $destdir=tmpdir($dh{MAINPACKAGE});
66 }
67 $destdir=cwd()."/".$destdir;
68
69 buildsystems_do("install", $destdir);
70
71 =head1 SEE ALSO
72
73 L<debhelper(7)>
74
75 This program is a part of debhelper.
76
77 =head1 AUTHOR
78
79 Joey Hess <joeyh@debian.org>
80
81 =cut