# Maintainer: exponential #_MANUALREPO='Debian_12' #_MANUALREPO='Ubuntu_22.04' pkgname=ueberzugpp-repo _pkgver=0.2 pkgver=0.2bookworm pkgrel=1 pkgdesc="Repo fo a command line util which allows to display images in combination with X11 written in C++" arch=('all') license=('GPL3') makedepends=('lsb-release' 'gpg' 'sed' 'grep' 'cat' 'printf') checkdepends=('curl') source=("https://download.opensuse.org/repositories/home:justkidding/Debian_Unstable/Release.key") b2sums=('e7ab05d83e1416d8956f7d73756bd2a10e691ddf398c26cf187748ee7bcedbe4ecdd1f503ce334e53da8b1d107eca7cee44cf40aa7e0b87fa510c7d95e0e3583') 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://software.opensuse.org//download.html?project=home%3Ajustkidding&package=ueberzugpp" echo "even if incompatible, a package will be build anyway." } build() { if [ -z $_MANUALREPO ]; then _DISTRAW="$(lsb_release -i -s)" case "$_DISTRAW" in Ubuntu) _RELNUM="$(lsb_release -r -s)" export _LNKNAME="xUbuntu_${_RELNUM}" ;; Debian) _RELNUM="$(lsb_release -r -s)" export _LNKNAME="${_DISTRAW}_${_RELNUM}" ;; Linuxmint) # not tested _DIST="$(cat /etc/upstream-release/lsb-release | grep 'DISTRIB_ID=' | sed 's!DISTRIB_ID=!!' | sed s!Ubuntu!xUbuntu! )" _RELNUM="$(cat /etc/upstream-release/lsb-release | grep 'DISTRIB_RELEASE=' | sed 's!DISTRIB_RELEASE=!!')" export _LNKNAME="${_DIST}_${_RELNUM}" ;; *) 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 _MANUALREPO=Debian_11\"" echo " or this \"export _MANUALREPO=Ubuntu_22.04\"" echo "or define _MANUALREPO inside the PKGBUILD" exit 1 ;; esac else export _LNKNAME="$(echo "$_MANUALREPO" | sed 's!Ubuntu!xUbuntu!')" fi } check() { if ! curl --output /dev/null --silent --head --fail "https://download.opensuse.org/repositories/home:/justkidding/${_LNKNAME}" then printf "\33[2K\r\033[1;31m%s\033[0m" "Warning:" >&2 echo "Repo doesn't exist" echo "https://download.opensuse.org/repositories/home:/justkidding/${_LNKNAME}" echo "Aborting" exit 1 fi } pkgver() { _RELNAME="$(lsb_release -c -s)" echo "$_pkgver${_RELNAME}" } package() { mkdir -p "${pkgdir}/etc/apt/sources.list.d" echo "deb [signed-by=/usr/share/keyrings/justkidding.gpg] http://download.opensuse.org/repositories/home:/justkidding/${_LNKNAME}/ /" > "${pkgdir}/etc/apt/sources.list.d/ueberzugpp.list" mkdir -p "${pkgdir}/usr/share/keyrings" cat Release.key | gpg --dearmor > "${pkgdir}/usr/share/keyrings/justkidding.gpg" 2>/dev/null }