python-rpm-generators/tests/pythonabi.sh
Troy Dawson e25505c276 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/python-rpm-generators#bfb7f70b994d667b703a6b16c2b35d5056572800
2020-10-14 20:10:06 -07:00

20 lines
975 B
Bash
Executable File

#!/usr/bin/bash -eux
rpmbuild -ba pythonabi.spec
PYVER=$(rpm --eval '%python3_version')
RPMDIR=$(rpm --eval '%_topdir')/RPMS
ARCH=$(rpm --eval '%_arch')
ABI='^python(abi) = '${PYVER}'$'
rpm -qp --provides ${RPMDIR}/${ARCH}/python-interpreter-0-0.${ARCH}.rpm | grep "${ABI}"
rpm -qp --requires ${RPMDIR}/${ARCH}/python-interpreter-0-0.${ARCH}.rpm | grep "${ABI}" && exit 1 || true
rpm -qp --requires ${RPMDIR}/${ARCH}/python-arched-0-0.${ARCH}.rpm | grep "${ABI}"
rpm -qp --provides ${RPMDIR}/${ARCH}/python-arched-0-0.${ARCH}.rpm | grep "${ABI}" && exit 1 || true
rpm -qp --requires ${RPMDIR}/noarch/python-noarch-0-0.noarch.rpm | grep "${ABI}"
rpm -qp --provides ${RPMDIR}/noarch/python-noarch-0-0.noarch.rpm | grep "${ABI}" && exit 1 || true
rpm -qp --provides ${RPMDIR}/${ARCH}/python-misplaced-interpreter-0-0.${ARCH}.rpm | grep "${ABI}" && exit 1 || true
rpm -qp --requires ${RPMDIR}/noarch/python-misplaced-library-0-0.noarch.rpm | grep "${ABI}" && exit 1 || true