5 dh_auto_install - automatically runs make install or similar
10 use Debian::Debhelper::Dh_Lib;
15 B<dh_auto_install> [S<I<debhelper options>>] [S<B<--> I<params>>]
19 dh_auto_install is a debhelper program that tries to automatically install
20 built files. If there's a Makefile and it contains a "install" target,
21 then this is done by running make (or MAKE, if the environment variable is
22 set). If there is a setup.py, it is used.
24 The files are installed into debian/<package>/ if there is only one binary
25 package to act on. In the multiple binary package case, the files are
26 instead installed into debian/tmp/, and should be moved from there to the
27 appropriate package build directory using L<dh_install(1)> or
30 DESTDIR is used to tell make where to install the files.
31 If the Makefile was generated by MakeMaker from a Makefile.PL, it will
32 automatically set PREFIX=/usr too, since such Makefiles need that.
34 This is intended to work for about 90% of packages. If it doesn't work, or
35 tries to use the wrong clean target, you're encoruaged to skip using
36 dh_auto_install at all, and just run make install manually.
44 Pass "params" to the program that is run. These can be used to suppliment
45 or override the any standard parameters that dh_auto_clean passes.
54 if (@{$dh{DOPACKAGES}} > 1) {
55 $destdir="debian/tmp";
58 $destdir=tmpdir($dh{MAINPACKAGE});
60 $destdir=cwd()."/".$destdir;
62 if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") {
63 $ENV{MAKE}="make" unless exists $ENV{MAKE};
64 my @params="DESTDIR=$destdir";
65 # Special case for MakeMaker.
66 if (-e "Makefile.PL") {
67 push @params, "PREFIX=/usr";
69 foreach my $target (qw{install}) {
70 # Use make -n to check to see if the target would do
71 # anything. There's no good way to test if a target exists.
72 my $ret=`$ENV{MAKE} -s -n $target 2>/dev/null`;
75 doit($ENV{MAKE}, $target,
82 elsif (-e "setup.py") {
83 doit("python setup.py", "install",
85 "--no-compile", "-O0",
94 This program is a part of debhelper.
98 Joey Hess <joeyh@debian.org>