Newer
Older
echo " md5check Check md5sums"
echo " unpack Unpack sources to \$srcdir"
echo " build Compile and install package into \$pkgdir"
echo " listpkg List target packages"
echo " package Create package in \$PKGDEST"
echo " rootpkg Run '$0 build package' as fakeroot"
echo " clean Remove temp build and install dirs"
echo " cleanoldpkg Remove binary packages except current version"
echo " cleanpkg Remove already built binary and source package"
echo " cleancache Remove downloaded files from \$SRCDEST"
echo " srcpkg Make a source package"
echo " up2date Compare target and sources dates"
echo " installdeps Install packages listed in makedepends and depends"
echo " uninstalldeps Uninstall packages listed in makedepends and depends"
echo ""
exit 0
}
APKBUILD="${APKBUILD:-./APKBUILD}"
while getopts "dfFhi:kinp:P:qrRs:u" opt; do
'h') usage;;
'i') install_after="$install_after $OPTARG";;
'n') die "Use newapkbuild to create new aports";;
'p') PKGDEST=$OPTARG;;
'P') REPODEST=$OPTARG;;
'r') install_deps=1;;
'R') recursive=1;;
's') SRCDEST=$OPTARG;;
'u') upgrade=1
recursive=1;;
# check so we are not root
if [ "$(whoami)" = "root" ] && [ -z "$FAKEROOTKEY" ]; then
[ -z "$forceroot" ] && die "Do not run abuild as root"
SUDO=
FAKEROOT=
fi
# find startdir
[ -f "$APKBUILD" ] || die "Could not find $APKBUILD (PWD=$PWD)"
APKBUILD=$(readlink -f "$APKBUILD")
startdir="${APKBUILD%/*}"
srcdir=${srcdir:-"$startdir/src"}
pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
pkgrel=0
repo=${startdir%/*}
repo=${repo##*/}
SRCDEST=${SRCDEST:-$startdir}
PKGDEST=${PKGDEST:-$startdir}
cd "$startdir" || die
. "$APKBUILD"
# If REPODEST is set then it will override the PKGDEST
if [ -n "$REPODEST" ]; then
PKGDEST="$REPODEST/$repo"
fi
# If we are handling a sub package then reset subpackages and install
origsubpackages="$subpackages"
controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
fi
while [ $# -gt 0 ]; do
runpart $1
shift
done