unpack Extracts the sources to a subdirectory in the build directory (BUILD_PREFIX) by running the src_unpack() function in the ebuild file. If no src_unpack() function has been specified, a default src_unpack() function is used that extracts all the files specified in SRC_URI. The sources are normally extracted to ${BUILD_PREFIX}/[package]-[version-rev]/work. This particu‐ lar directory can be referenced by using the ${WORKDIR} vari‐ able. If you're creating an ebuild, you'll want to make sure that the S (source directory) variable defined at the top of your ebuild script points to the directory that contains your extracted sources. This directory is defined by default to be ${WORKDIR}/${P}, so it is not often required. The src_unpack() function is also responsible for making the appropriate patches to the sources so that they're ready for compilation. prepare Prepares the extracted sources by running the src_prepare() function specified in the ebuild file. When src_prepare() starts, the current working directory will be set to ${S}. This function is supported beginning with EAPI 2. This should be updated to reflect changes committed since EAPI=6.