void-packages/common/hooks
Đoàn Trần Công Danh 509f79078c hooks: do-extract: extract to temp dir then rename
Extracting to temporary directory then renaming to real $wrksrc,
will make the do-extract steps works atomicity. Either $wrksrc is there
and complete, or it's not there.

Accidentally, this change has a side effect, we can no longer care about
the name of top-level components of a tarball, since we will rename the
top level directory in question to $wrksrc. IOW, we don't need to set
$wrksrc any longer.  The side effect of above side effect: we can starting
to build multiple packages that have same top-level's name without clean
from now on.

In another hand, we only rename the inner directory if the extracted
file hierarchy has single top-level directory, we will use the
renamed-temporary directory as the $wrksrc, $create_wrksrc variable is
no longer relevant, and do-clean will always work probably instead of
leaving some trash behind like before.
2022-11-08 22:30:37 +07:00
..
do-build
do-check
do-configure
do-extract hooks: do-extract: extract to temp dir then rename 2022-11-08 22:30:37 +07:00
do-fetch xbps-src: try to fix multiple distfiles 2022-09-09 22:17:53 +02:00
do-install
do-patch common/do-patch: handle spaces in patch filename 2022-05-19 20:56:42 +02:00
do-pkg xbps-src: overwrite packages in local repo 2021-09-13 23:04:48 +02:00
post-build
post-check
post-configure
post-extract
post-fetch
post-install 11-pkglint-elf-in-usrshare: use file --no-pad so we don't have to strip it 2022-09-03 15:30:51 +02:00
post-patch
post-pkg common/hooks: simplify setting arch for binpkg 2021-09-13 23:04:48 +02:00
pre-build
pre-check
pre-configure python3: update to 3.11.0. 2022-11-05 08:21:20 -04:00
pre-extract
pre-fetch
pre-install common/00-libdir: only create lib{32,64} symlink if not exists 2021-02-10 14:38:59 +01:00
pre-patch
pre-pkg hooks/99-pkglint.sh: error out if /usr/usr path is used 2022-11-01 15:40:29 +01:00
README

README

HOOKS
=====

This directory contains shell hooks that are processed after or before the
specified phase. The shell hooks are simply shell snippets (must not be
executable nor contain a shebang) that are processed lexically by xbps-src.
Only files with the `.sh` extension are processed.

A shell hook must provide a `hook()` function which is the entry point to
execute it via xbps-src.

The following directories are used to set the order in which the hooks
should be processed by xbps-src:

	* pre-fetch		(before running fetch phase)
	* do-fetch		(running fetch phase)
	* post-fetch		(after running fetch phase)

	* pre-extract		(before running extract phase)
	* do-extract		(running extract phase)
	* post-extract		(after running extract phase)

	* pre-configure		(before running configure phase)
	* do-configure		(running configure phase)
	* post-configure	(after running configure phase)

	* pre-build		(before running build phase)
	* do-build		(running build phase)
	* post-build		(after running build phase)

	* pre-install		(before running install phase)
	* do-install		(running install phase)
	* post-install		(after running install phase)

	* pre-pkg		(before running pkg phase)
	* do-pkg		(running pkg phase)
	* post-pkg		(after running pkg phase)

NOTES
~~~~~
* Symlinks can be created (relative) to make a hook available in multiple phases.

* The phases do-fetch, do-extract, do-configure, do-build, and do-install can
  be overwritten by the template file. That means if a template contains a
  do_install function, the hooks defined for do-install won't be executed.
  Note that this is only true for the do-* hooks.

* the pre_* function of the template will be run *after* the corresponding
  pre-* hooks.

* the post_* function of the template will be run *before* the corresponding
  post-* hooks.