summaryrefslogtreecommitdiff
path: root/src/fullpkg/fullpkg
blob: 0572ddb2e4c0a649e4558438a06deeab701d1b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# Builds packages from ABS recursively. It tries to find dependencies that
# aren't built or need update and then makepkg them in order.

# Copyright (C) 2011 Nicolás Reynolds <fauno@parabola.nu>
# Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com>
#
# License: Unspecified

usage() {
	print "Usage: %s [OPTIONS] [BUILD_DIR]" "${0##*/}"
	print "A (libre)makepkg wrapper that will also build dependencies"
	echo
	prose "More directly, it wraps fullpkg-find and fullpkg-build;
	       fullpkg-find finds the dependencies, and sets them up in
	       BUILD_DIR; then fullpkg-build builds them."
	echo
	prose "This script will check dependencies, build them if possible and
	       stage the packages on its repo."
	echo
	prose "If no BUILD_DIR is specified, it will create a temporary
	       directory."
	echo
	print "Options:"
	flag '-h'           "Show this message"
}

while getopts 'h' arg; do
	case "$arg" in
		h) usage; exit 0 ;;
	esac
done

shift $(( OPTIND - 1 ))

build_dir="${1:-$(mktemp --tmpdir -d fullpkg.XXXXXXXXXX)}"
fullpkg-find "$build_dir" && fullpkg-build -N "$build_dir"

exit 0