summaryrefslogtreecommitdiff
path: root/src/fullpkg/fullpkg
blob: e053c6e87cc234488dd1173dd492efbed7848f51 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/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: GNU GPLv3+
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

. libremessages

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