3 # vim: set ts=4 sw=4 et:
6 # $1 - pkgname [REQUIRED]
7 # $2 - cross target [OPTIONAL]
9 if [ $# -lt 1 -o $# -gt 2 ]; then
10 echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
17 for f
in $XBPS_SHUTILSDIR/*.sh
; do
21 setup_pkg
"$PKGNAME" $XBPS_CROSS_BUILD
23 for f
in $XBPS_COMMONDIR/environment
/extract
/*.sh
; do
27 XBPS_EXTRACT_DONE
="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_extract_done"
29 if [ -f $XBPS_EXTRACT_DONE ]; then
33 # Run pre-extract hooks
34 run_pkg_hooks pre-extract
36 # If template defines pre_extract(), use it.
37 if declare -f pre_extract
>/dev
/null
; then
41 # If template defines do_extract() use it rather than the hooks.
42 if declare -f do_extract
>/dev
/null
; then
43 [ ! -d "$wrksrc" ] && mkdir
-p "$wrksrc"
47 if [ -n "$build_style" ]; then
48 if [ ! -r $XBPS_BUILDSTYLEDIR/${build_style}.sh
]; then
49 msg_error
"$pkgver: cannot find build helper $XBPS_BUILDSTYLEDIR/${build_style}.sh!\n"
51 .
$XBPS_BUILDSTYLEDIR/${build_style}.sh
53 # If the build_style script declares do_extract(), use it rather than hooks.
54 if declare -f do_extract
>/dev
/null
; then
57 # Run do-extract hooks
58 run_pkg_hooks
"do-extract"
63 [ -d "$wrksrc" ] && cd "$wrksrc"
65 # If template defines post_extract(), use it.
66 if declare -f post_extract
>/dev
/null
; then
70 # Run post-extract hooks
71 run_pkg_hooks post-extract
73 touch -f $XBPS_EXTRACT_DONE