From 50dc6a19cdf7a793a1ffcb8175826d9ab202c65b Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sat, 5 Feb 2022 18:12:29 +0100 Subject: [PATCH] Add script to rebuild msmtp from fedora --- docker_rpmbuild-rebuild_msmtp.sh | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 docker_rpmbuild-rebuild_msmtp.sh diff --git a/docker_rpmbuild-rebuild_msmtp.sh b/docker_rpmbuild-rebuild_msmtp.sh new file mode 100755 index 0000000..cd67eb7 --- /dev/null +++ b/docker_rpmbuild-rebuild_msmtp.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +FROMFEDORA='34' + +ABSDIR="$( dirname "$(readlink -f -- "$0")" )" +cd ${ABSDIR} + +type -P docker >/dev/null && DOCKER=$(which docker) +type -P podman >/dev/null && DOCKER=$(which podman) + +if ! type -P jq >/dev/null ; then + echo "Error : please install jq" + exit 1 +fi + +TMPFILE=/tmp/fedoraproject_msmtp_$$ + +curl -s https://src.fedoraproject.org/_dg/bodhi_updates/rpms/msmtp -o ${TMPFILE} +if ! jq -e .releases.F${FROMFEDORA} ${TMPFILE} >&/dev/null; then + echo "ERROR : No msmtp release available for Fedora ${FROMFEDORA}" + echo "Please check https://src.fedoraproject.org/rpms/msmtp to choose the right release." + exit 2 +fi + +if MSMTP=$(jq -re .updates.F${FROMFEDORA}.stable ${TMPFILE}); then + echo "Found ${MSMTP} for Fedora ${FROMFEDORA}" +else + echo "ERROR : No stable msmtp release available for Fedora ${FROMFEDORA}." + echo "Please check https://src.fedoraproject.org/rpms/msmtp to choose the right release." + exit 3 +fi +rm ${TMPFILE} + +MSMTP_VERSION=$(echo "${MSMTP}" | sed -e "s/msmtp-\(.*\)\.fc${FROMFEDORA}$/\1/") + +ARCH=$(${DOCKER} run --rm docker.io/library/rockylinux:8 uname -i) + +${DOCKER} build -t docker-msmtp-build -f- . <