2009-01-15 15:45:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2009-01-23 08:56:55 +00:00
|
|
|
# check if what we need is here
|
|
|
|
needed="cramfs syslinux cdrkit"
|
|
|
|
for i in $needed; do
|
|
|
|
if ! apk info -e $i; then
|
|
|
|
missing="$missing $i"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# try install the missing parts
|
|
|
|
if [ -n "$missing" ]; then
|
|
|
|
if ! sudo apk add $missing; then
|
|
|
|
echo "Need $missing to build alpine" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-01-15 15:45:38 +00:00
|
|
|
# first look for alpine.mk in current dir. Fallback to /usr/share/abuild
|
|
|
|
mk=./alpine.mk
|
|
|
|
if ! [ -f $mk ]; then
|
|
|
|
mk=/usr/share/abuild/alpine.mk
|
|
|
|
fi
|
|
|
|
|
|
|
|
make -f "$mk" APK_BIN= $@
|
2009-01-23 08:56:55 +00:00
|
|
|
rc=$?
|
|
|
|
|
|
|
|
# uninstall the stuff we installed
|
|
|
|
[ -n "$missing" ] && sudo apk del $missing
|
|
|
|
|
|
|
|
exit $?
|