void-packages

Void Source Packages
git clone git://ezup.dev/void-packages.git
Log | Files | Refs | README | LICENSE

xbps-src-prepkg.sh (1068B)


      1#!/bin/bash
      2#
      3# vim: set ts=4 sw=4 et:
      4#
      5# Passed arguments:
      6#	$1 - pkgname [REQUIRED]
      7#	$2 - cross target [OPTIONAL]
      8
      9if [ $# -lt 1 -o $# -gt 2 ]; then
     10    echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
     11    exit 1
     12fi
     13
     14PKGNAME="$1"
     15XBPS_CROSS_BUILD="$2"
     16
     17for f in $XBPS_SHUTILSDIR/*.sh; do
     18    . $f
     19done
     20
     21setup_pkg "$PKGNAME" $XBPS_CROSS_BUILD
     22
     23for f in $XBPS_COMMONDIR/environment/install/*.sh; do
     24    source_file "$f"
     25done
     26
     27
     28XBPS_PREPKG_DONE="${XBPS_STATEDIR}/${PKGNAME}_${XBPS_CROSS_BUILD}_prepkg_done"
     29
     30if [ -z "$XBPS_BUILD_FORCEMODE" -a -f $XBPS_PREPKG_DONE ]; then
     31    exit 0
     32fi
     33
     34# If it's a subpkg execute the pkg_install() function.
     35if [ "$sourcepkg" != "$PKGNAME" ]; then
     36    # Source all subpkg environment setup snippets.
     37    for f in ${XBPS_COMMONDIR}/environment/setup-subpkg/*.sh; do
     38        source_file "$f"
     39    done
     40
     41    ${PKGNAME}_package
     42    pkgname=$PKGNAME
     43fi
     44
     45source_file $XBPS_COMMONDIR/environment/build-style/${build_style}.sh
     46setup_pkg_depends $pkgname || exit 1
     47run_pkg_hooks pre-pkg
     48
     49touch -f $XBPS_PREPKG_DONE
     50
     51exit 0