|
|
@ -1,6 +1,6 @@
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
|
|
FROMFEDORA='34'
|
|
|
|
FROMFEDORA='36'
|
|
|
|
PACKAGE='msmtp'
|
|
|
|
PACKAGE='msmtp'
|
|
|
|
|
|
|
|
|
|
|
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
|
|
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
|
|
@ -19,18 +19,26 @@ VERSION=$(echo "${JSONLINE}" | sed -e "s/^\s*\"stable\": \"${PACKAGE}-\(.*\)\.fc
|
|
|
|
|
|
|
|
|
|
|
|
ARCH=$(${DOCKER} run --rm docker.io/library/rockylinux:8 uname -i)
|
|
|
|
ARCH=$(${DOCKER} run --rm docker.io/library/rockylinux:8 uname -i)
|
|
|
|
|
|
|
|
|
|
|
|
${DOCKER} build -t docker-${PACKAGE}-build -f- . <<EOF
|
|
|
|
${DOCKER} build -t localhost/docker-${PACKAGE}-build -f- . <<EOF
|
|
|
|
FROM docker.io/library/rockylinux:8
|
|
|
|
FROM docker.io/library/rockylinux:8
|
|
|
|
RUN dnf install -y epel-release dnf-plugins-core && \
|
|
|
|
RUN dnf install -y epel-release dnf-plugins-core && \
|
|
|
|
dnf config-manager --set-enabled powertools && \
|
|
|
|
dnf config-manager --set-enabled powertools && \
|
|
|
|
dnf install -y rpm-build gcc make gettext gnutls-devel libgsasl-devel libidn-devel libsecret-devel && \
|
|
|
|
dnf install -y rpm-build gcc make gettext gnutls-devel libgsasl-devel libidn-devel libsecret-devel && \
|
|
|
|
useradd -m dontbuildasroot -s /bin/bash
|
|
|
|
useradd -m dontbuildasroot -s /bin/bash
|
|
|
|
USER dontbuildasroot
|
|
|
|
USER dontbuildasroot
|
|
|
|
RUN curl https://download-ib01.fedoraproject.org/pub/fedora/linux/updates/${FROMFEDORA}/Everything/SRPMS/Packages/m/${PACKAGE}-${VERSION}.fc${FROMFEDORA}.src.rpm -o /tmp/package.src.rpm && \
|
|
|
|
RUN rpmbuild --rebuild https://download-ib01.fedoraproject.org/pub/fedora/linux/updates/${FROMFEDORA}/Everything/source/tree/Packages/m/${PACKAGE}-${VERSION}.fc${FROMFEDORA}.src.rpm
|
|
|
|
rpmbuild --rebuild /tmp/package.src.rpm
|
|
|
|
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
${DOCKER} create -ti --name docker-${PACKAGE}-xfer docker-${PACKAGE}-build bash
|
|
|
|
[[ $? = 0 ]] && mkdir /tmp/dockerrpmbuild-$$
|
|
|
|
${DOCKER} cp docker-${PACKAGE}-xfer:/home/dontbuildasroot/rpmbuild/RPMS/${ARCH}/${PACKAGE}-${VERSION}.el8.${ARCH}.rpm ./files/
|
|
|
|
|
|
|
|
${DOCKER} rm -fv docker-${PACKAGE}-xfer
|
|
|
|
${DOCKER} build --no-cache -v /tmp/dockerrpmbuild-$$:/out:Z -t docker-${PACKAGE}-xfer -f- . <<EOF
|
|
|
|
${DOCKER} rmi -f docker-${PACKAGE}-build
|
|
|
|
FROM localhost/docker-${PACKAGE}-build
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
RUN mv /home/dontbuildasroot/rpmbuild/RPMS/*/*.rpm /out/
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[ $? == 0 ]] && mv -i /tmp/dockerrpmbuild-$$/*.rpm ${ABSDIR}/files/ &&
|
|
|
|
|
|
|
|
rm -rf /tmp/dockerrpmbuild-$$ &&
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
${DOCKER} rmi -f docker-${PACKAGE}-build &&
|
|
|
|
|
|
|
|
${DOCKER} rmi -f docker-${PACKAGE}-xfer
|
|
|
|