projects/aports·blob v1.15.2 · refs

40 lines · 684 B

1#!/bin/sh
2
3# check if what we need is here
4needed="cramfs syslinux cdrkit"
5for i in $needed; do
6 if ! apk info -e $i; then
7 missing="$missing $i"
8 fi
9done
10
11# try install the missing parts
12if [ -n "$missing" ]; then
13 if ! sudo apk add $missing; then
14 echo "Need $missing to build alpine" >&2
15 exit 1
16 fi
17fi
18
19# first look for alpine.mk in current dir. Fallback to /usr/share/abuild
20mk=./alpine.mk
21if ! [ -f $mk ]; then
22 mk=/usr/share/abuild/alpine.mk
23fi
24
25make -f "$mk" APK_BIN= $@
26rc=$?
27
28# beep when done
29if [ $rc -eq 0 ]; then
30 for i in $(seq 0 3); do
31 echo -n -e "\007"
32 sleep 0.2
33 done
34fi
35
36# uninstall the stuff we installed
37[ -n "$missing" ] && sudo apk del $missing
38
39
40exit $?