summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-12-13 07:35:09 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-12-13 07:35:09 +0000
commita111620bc8b8bbd72295c899acf5a7dca87e210c (patch)
tree3e4add689e54e86e7a313f4bafaaabf610d03855 /abuild.in
parent8f17e03078f0b466e38c14e89e260465c4d8b4ab (diff)
downloadabuild-a111620bc8b8bbd72295c899acf5a7dca87e210c.tar.gz
abuild-a111620bc8b8bbd72295c899acf5a7dca87e210c.tar.bz2
abuild-a111620bc8b8bbd72295c899acf5a7dca87e210c.tar.xz
abuild-a111620bc8b8bbd72295c899acf5a7dca87e210c.zip
abuid: check that CARCH and CHOST is set
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/abuild.in b/abuild.in
index c01c9bf..fa85f59 100755
--- a/abuild.in
+++ b/abuild.in
@@ -94,7 +94,7 @@ die() {
# check if apkbuild is basicly sane
sanitycheck() {
- local i
+ local i suggestion
msg "Checking sanity of $APKBUILD..."
[ -z "$pkgname" ] && die "Missing pkgname in APKBUILD"
[ -z "${pkgname##* *}" ] && die "pkgname contains spaces"
@@ -108,6 +108,16 @@ sanitycheck() {
[ -z "$url" ] && die "Missing url in APKBUILD"
[ -z "$license" ] && die "Missing license in APKBULID"
+ # check if CARCH, CBUILD, CHOST and CTARGET is set
+ if [ -z "$CARCH" ]; then
+ case "$(uname -m)" in
+ i[0-9]86) suggestion=" (Suggestion: CARCH=x86)";;
+ x86_64) suggestion=" (Suggestion: CARCH=x86_64)";;
+ esac
+ die "Please set CARCH in /etc/abuild.conf$suggestion"
+ fi
+ [ -z "$CHOST" ] && die "Please set CHOST in /etc/abuild.conf"
+
for i in $install; do
[ -e "$startdir/$i" ] || die "install script $startdir/$i is missing"
done