5 dh_auto_install - automatically runs make install or similar
10 use Debian::Debhelper::Dh_Lib;
11 use Debian::Debhelper::Dh_Buildsystems;
17 B<dh_auto_install> [S<I<build system options>>] [S<I<debhelper options>>] [S<B<--> I<params>>]
21 B<dh_auto_install> is a debhelper program that tries to automatically install
22 built files. It does so by running the appropriate command for the build
23 system it detects the package uses. For example, if there's a F<Makefile> and
24 it contains a B<install> target, then this is done by running B<make> (or B<MAKE>,
25 if the environment variable is set). If there is a F<setup.py> or F<Build.PL>,
26 it is used. Note that the Ant build system does not support installation,
27 so B<dh_auto_install> will not install files built using Ant.
29 Unless B<--destdir> option is specified, the files are installed into
30 debian/I<package>/ if there is only one binary package. In the multiple binary
31 package case, the files are instead installed into F<debian/tmp/>, and should be
32 moved from there to the appropriate package build directory using
35 B<DESTDIR> is used to tell make where to install the files.
36 If the Makefile was generated by MakeMaker from a F<Makefile.PL>, it will
37 automatically set B<PREFIX=/usr> too, since such Makefiles need that.
39 This is intended to work for about 90% of packages. If it doesn't work, or
40 tries to use the wrong install target, you're encouraged to skip using
41 B<dh_auto_install> at all, and just run make install manually.
45 See L<debhelper(7)/B<BUILD SYSTEM OPTIONS>> for a list of common build
46 system selection and control options.
50 =item B<--destdir=>I<directory>
52 Install files into the specified I<directory>. If this option is not specified,
53 destination directory is determined automatically as described in the
54 L</B<DESCRIPTION>> section.
58 Pass I<params> to the program that is run, after the parameters that
59 B<dh_auto_install> usually passes.
67 buildsystems_init(options => {
68 "destdir=s" => \$destdir,
71 # If destdir is not specified, determine it automatically
73 my @allpackages=getpackages();
74 if (@allpackages > 1) {
75 $destdir="debian/tmp";
78 $destdir=tmpdir($dh{MAINPACKAGE});
81 $destdir = File::Spec->rel2abs($destdir, cwd());
83 buildsystems_do("install", $destdir);
89 This program is a part of debhelper.
93 Joey Hess <joeyh@debian.org>