Skip to content
Snippets Groups Projects
abuild.in 25.3 KiB
Newer Older
	echo " -r  Install missing dependencies from system repository (using sudo)"
	echo " -R  Recursively build and install missing dependencies (using sudo)"
	echo " -s  Set source package destination directory"
	echo " -u  Recursively build and upgrade all dependencies (using sudo)"
Natanael Copa's avatar
Natanael Copa committed
	echo ""
	echo " -n  Create a new APKBUILD in a directory named PKGNAME"
	echo " -c  Copy a sample init.d, conf.d and install script to new directory"
	echo ""
Natanael Copa's avatar
Natanael Copa committed
	echo "Commands:"
	echo "  checksum    Generate checksum to be included in APKBUILD"
	echo "  fetch       Fetch sources to \$SRCDEST and verify checksums"
	echo "  sanitycheck Basic sanity check of APKBUILD"
	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"
Natanael Copa's avatar
Natanael Copa committed
	echo ""
	exit 0
}

APKBUILD="${APKBUILD:-./APKBUILD}"
unset force
unset recursive
while getopts "cdfhi:kin:p:P:qrRs:u" opt; do
Natanael Copa's avatar
Natanael Copa committed
	case $opt in
Natanael Copa's avatar
Natanael Copa committed
		'f') force=1;;
		'h') usage;;
		'i') install_after="$install_after $OPTARG";;
Natanael Copa's avatar
Natanael Copa committed
		'q') quiet=1;;
		'r') install_deps=1;;
		'R') recursive=1;;
Natanael Copa's avatar
Natanael Copa committed
	esac
done
shift $(( $OPTIND - 1 ))

# If REPODEST is set then it will override the PKGDEST
if [ -n "$REPODEST" ]; then
	PKGDEST="$REPODEST/$repo"
fi

# source the buildfile
if [ -z "$newname" ]; then
	[ -f "$APKBUILD" ] || die "Could not find $APKBUILD (PWD=$PWD)"
	. "$APKBUILD"
fi
# If we are handling a sub package then reset subpackages and install
if [ -n "$subpkgname" ]; then
	origsubpackages="$subpackages"
pkgdir="$pkgbasedir/$pkgname"
controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
Natanael Copa's avatar
Natanael Copa committed

trap 'die "Aborted by user"' INT
Linux User's avatar
Linux User committed
set_xterm_title "abuild: $pkgname"
Natanael Copa's avatar
Natanael Copa committed

if [ -z "$1" ] && [ -n "$newname" ]; then
	set "newaport"
fi
Natanael Copa's avatar
Natanael Copa committed

if [ -z "$1" ]; then
Natanael Copa's avatar
Natanael Copa committed
fi

while [ $# -gt 0 ]; do
	runpart $1
	shift
done

for i in $install_after; do
Natanael Copa's avatar
Natanael Copa committed
	post_add $i
Linux User's avatar
Linux User committed
cleanup
Natanael Copa's avatar
Natanael Copa committed