2017-12-09 21:51:48 +01:00
|
|
|
fetch_package() {
|
2018-01-24 21:48:10 +01:00
|
|
|
echo "$PKGNAME - download"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
|
|
|
if [ -z "$TARBALL" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e "$PKGDOWNLOADDIR/$TARBALL" ]; then
|
|
|
|
curl -o "$PKGDOWNLOADDIR/$TARBALL" --silent --show-error \
|
|
|
|
-L "$URL/$TARBALL"
|
|
|
|
fi
|
|
|
|
|
2018-12-29 13:07:53 +01:00
|
|
|
echo "$SHA256SUM $PKGDOWNLOADDIR/${TARBALL}" | sha256sum -c --quiet "-"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
|
|
|
if [ ! -e "$PKGSRCDIR/$SRCDIR" ]; then
|
2018-01-24 21:48:10 +01:00
|
|
|
local LOGFILE="$PKGLOGDIR/${PKGNAME}-prepare.log"
|
2017-12-09 21:51:48 +01:00
|
|
|
|
2018-01-24 21:48:10 +01:00
|
|
|
echo "$PKGNAME - unpack"
|
2017-12-09 21:51:48 +01:00
|
|
|
tar -C "$PKGSRCDIR" -xf "$PKGDOWNLOADDIR/$TARBALL"
|
|
|
|
|
|
|
|
pushd "$PKGSRCDIR/$SRCDIR" > /dev/null
|
2018-01-24 21:48:10 +01:00
|
|
|
echo "$PKGNAME - prepare"
|
2018-02-15 23:47:54 +01:00
|
|
|
prepare "$SCRIPTDIR/pkg/$PKGNAME" &>> "$LOGFILE" < /dev/null
|
2017-12-09 21:51:48 +01:00
|
|
|
popd > /dev/null
|
2019-03-09 17:18:16 +01:00
|
|
|
|
|
|
|
gzip -f "$LOGFILE"
|
2017-12-09 21:51:48 +01:00
|
|
|
fi
|
|
|
|
}
|