Install functions reference

The following functions are provided by the package manager to handle various install-related tasks. ${ED} is prepended automatically to the install location.

The do* functions, when given multiple arguments, will work upon multiple targets. The new* functions take exactly two arguments (except as noted) — the first is the source name, the second the name to use when installing.

The *into functions create the directory if it does not already exist.

Function Details
into Change install location for dobin, newbin, dosbin, newsbin, dolib, dolib.a, newlib.a, dolib.so, newlib.so
insinto Change install location for doins, newins
exeinto Change install location for doexe, newexe
docinto Change install location for dodoc, newdoc
insopts Specify arguments passed to install (eg -s, -m644)
diropts Specify arguments passed to install for directories
exeopts Specify arguments passed to install for executables
libopts Specify arguments passed to install for libraries Note: Banned in EAPI=7
dobin Install a binary into subdirectory bin of the location provided by into (resulting in /usr/bin by default) with mode 0755 and with ownership set to superuser or its equivalent on the system or installation at hand
doconfd Install an /etc/conf.d file
dodir Install a directory that will be non-empty when the package is merged. For directories that will be empty, please use keepdir instead.
dodoc Install a documentation file into /usr/share/doc/${PF}. The -r option allows directories to be installed recursively.
einstalldocs Installs the files and directories specified by the DOCS and HTML_DOCS variables into /usr/share/doc/${PF} recursively using dodoc -r. Note: Approved in EAPI 6.
doenvd Install an /etc/env.d file
doexe Install an executable into the location provided by exeinto, by default with mode 0755 or with the install options set by exeopts
doheader Install a header file into /usr/include. The -r option allows directories to be installed recursively.
dohtml Installs HTML document files into /usr/share/doc/${PF}/html The -r option allows directories to be installed recursively. Note: Deprecated in EAPI 6, switch to einstalldocs instead. Note: Banned in EAPI=7
doinfo Install a GNU Info document
doinitd Install an /etc/init.d file
doins Install a miscellaneous file. The -r option allows directories to be installed recursively. Any symlinks encountered are installed as symlinks, when installing recursively.
dolib Install a library file Note: Banned in EAPI=7
dolib.a Install a library (.a) file
dolib.so Install a library (shared object) file
doman

Install a man page into the appropriate section of /usr/share/man. e.g., foo.1 will be installed in /usr/share/man/man1/foo.1.

If the man page is named foo.<lang>.1 then it will be installed in /usr/share/man/<lang>/man1/foo.1, where <lang> is a language code. Option -i18n=<lang> can be used to explicitly specify a subdirectory (or to suppress it, if empty).

domo Install a Gettext .mo file. (EAPI=7) No longer looks at the value of into
dosbin Install an sbin/ file
dosym

Create a symlink to the target specified as the first parameter, at the path specified by the second parameter. With option -r (EAPI 8), an absolute path specified for the target will be converted to a path relative to the link location.

Note: Without option -r, an absolute link target is interpreted verbatim, i.e. it must include ${EPREFIX} when applicable.

fowners Call chown on the specified files in ${ED}
fperms Call chmod on the specified files in ${ED}
keepdir Install a directory that will be empty when the package is merged. This is like dodir, but for empty directories instead. The handling of empty directories is undefined by the package manager specification, and the keepdir function exists to ensure that the (otherwise empty) directory is tracked. This is accomplished by installing a hidden file prefixed with .keep to the directory in question.
newbin Install a binary using the second argument as the name
newconfd Install an /etc/conf.d entry using the second argument as the name
newdoc Install a documentation file using the second argument as the name
newenvd Install an /etc/env.d file using the second argument as the name
newexe Install an executable file using the second argument as the name
newheader Install a header file using the second argument as the name
newinitd Install an /etc/init.d file using the second argument as the name
newins Install a miscellaneous file using the second argument as the name
newlib.a Install a .a library file using the second argument as the name
newlib.so Install a .so library file using the second argument as the name
newman Install a manual page using the second argument as the name
newsbin Install an sbin file using the second argument as the name
docompress Controls compression of files. Normally executed to exclude from compression, e.g., docompress -x /usr/share/doc/${PF}/examples.
dostrip Controls stripping of executables. Normally used to exclude from stripping, e.g. dostrip -x /usr/$(get_libdir)/important.so. May also be used without the -x option to include binaries to strip when RESTRICT=strip is set. Provided paths are relative to ${ED}, even if they begin with a slash.