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
|
|
|
|
|
|
|
|
pushd "$PKGDOWNLOADDIR" > /dev/null
|
|
|
|
echo "$SHA256SUM ${TARBALL}" > "${TARBALL}.sha256"
|
|
|
|
sha256sum -c --quiet "${TARBALL}.sha256"
|
|
|
|
rm "${TARBALL}.sha256"
|
|
|
|
popd > /dev/null
|
|
|
|
|
|
|
|
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"
|
|
|
|
prepare "$SCRIPTDIR/$PKGDIR/$PKGNAME" &>> "$LOGFILE" < /dev/null
|
2017-12-09 21:51:48 +01:00
|
|
|
popd > /dev/null
|
|
|
|
fi
|
|
|
|
}
|