3 # vim: set ts=4 sw=4 et:
6 # $1 - pkgname [REQUIRED]
7 # $2 - subpkg mode [REQUIRED]
8 # $2 - cross target [OPTIONAL]
10 if [ $# -lt 2 -o $# -gt 3 ]; then
11 echo "${0##*/}: invalid number of arguments: pkgname subpkg-mode [cross-target]"
19 for f
in $XBPS_SHUTILSDIR/*.sh
; do
23 setup_pkg
"$PKGNAME" $XBPS_CROSS_BUILD
25 for f
in $XBPS_COMMONDIR/environment
/install
/*.sh
; do
29 XBPS_INSTALL_DONE
="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_install_done"
33 if [ "$SUBPKG_MODE" = "no" ]; then
34 if [ ! -f $XBPS_INSTALL_DONE ] ||
[ -f $XBPS_INSTALL_DONE -a -n "$XBPS_BUILD_FORCEMODE" ]; then
35 mkdir
-p $XBPS_DESTDIR/$XBPS_CROSS_TRIPLET/$pkgname-$version
37 run_step
install "" skip
39 touch -f $XBPS_INSTALL_DONE
44 XBPS_SUBPKG_INSTALL_DONE
="${XBPS_STATEDIR}/${PKGNAME}_${XBPS_CROSS_BUILD}_subpkg_install_done"
46 # If it's a subpkg execute the pkg_install() function.
47 if [ ! -f $XBPS_SUBPKG_INSTALL_DONE ]; then
48 if [ "$sourcepkg" != "$PKGNAME" ]; then
49 # Source all subpkg environment setup snippets.
50 for f
in ${XBPS_COMMONDIR}/environment
/setup-subpkg
/*.sh
; do
57 source_file
$XBPS_COMMONDIR/environment
/build-style
/${build_style}.sh
59 install -d $PKGDESTDIR
60 if declare -f pkg_install
>/dev
/null
; then
61 run_pkg_hooks pre-install
65 setup_pkg_depends
${pkgname:=$PKGNAME} ||
exit 1
66 run_pkg_hooks post-install
67 touch -f $XBPS_SUBPKG_INSTALL_DONE