makedeb
prebuilt-mpr repo
Viewing /PKGBUILD
.
Click here to go back to the Git tree for prebuilt-mpr-repo.
# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
#_MANUALRELEASE='jammy'
#_MANUALRELEASE='focal'
#_MANUALRELEASE='bullseye'
pkgname=prebuilt-mpr-repo
_pkgver=0
pkgver=0
pkgrel=1
pkgdesc='prebuilt-mpr repo'
arch=('all')
license=('PD')
makedepends=('lsb-release' 'gpg' 'grep' 'sed' 'cat' 'printf')
#checkdepends=('curl')
source=('https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub')
b2sums=('8dc2aa6c58b240132d7c4973c526e5a776f435a9e08b305938a991564936bab0126f0d94c6bcecc3e4b7459abb80ceb77da13067411dc0d6bf0612248353230b')
prepare() {
printf "\33[2K\r\033[1;33m%s\033[0m" "Warning:" >&2
echo "Your system must be compatible with the available repos"
echo "see: https://docs.makedeb.org/prebuilt-mpr/getting-started/"
}
build() {
if [ -z $_MANUALRELEASE ]; then
_DISTRAW="$(lsb_release -i -s)"
case "$_DISTRAW" in
Ubuntu|Debian|Raspbian)
export _LNKREL="$(lsb_release -c -s)"
;;
Linuxmint)
# not tested
export _LNKREL="$(cat /etc/upstream-release/lsb-release | grep 'DISTRIB_RELEASE=' | sed 's!DISTRIB_RELEASE=!!')"
;;
*)
printf "\33[2K\r\033[1;31m%s\033[0m" "Warning:" >&2
echo "Oups, your variant was not recognized"
echo "try setting it manually with a compatible entry"
echo "like this \"export _MANUALRELEASE=jammy\""
echo " or this \"export _MANUALRELEASE=bullseye\""
echo "or define _MANUALRELEASE inside the PKGBUILD"
exit 1
;;
esac
else
export _LNKREL="$_MANUALRELEASE"
fi
}
# FIXME This doesn't work
#check() {
#if ! curl --output /dev/null --silent --head --fail "https://proget.makedeb.org/prebuilt-mpr/${_LNKREL}"
#then
# printf "\33[2K\r\033[1;31m%s\033[0m" "Warning:" >&2
# echo "Repo link doesn't exist"
# echo "Aborting"
# exit 1
#fi
#}
pkgver() {
_REALREL="$(lsb_release -c -s)"
echo "$_pkgver.${_REALREL}"
}
package() {
mkdir -p "${pkgdir}/etc/apt/sources.list.d"
echo "deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $_LNKREL" > "${pkgdir}/etc/apt/sources.list.d/prebuilt-mpr.list"
mkdir -p "${pkgdir}/usr/share/keyrings"
cat prebuilt-mpr.pub | gpg --dearmor > "${pkgdir}/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg" 2>/dev/null
}