Issue #2382 - fix qpid amqp path

Former-commit-id: b9f4e93687 [formerly b9f4e93687 [formerly 263ce6e82d1ecf3164961b599c2d4aac7d61f783]]
Former-commit-id: b002df8a06
Former-commit-id: 8ce22ec91a
This commit is contained in:
Bryan Kowal 2013-09-17 17:51:43 -05:00
parent 499377b332
commit f10a1a5ac2

View file

@ -96,19 +96,27 @@ mkdir -p %{_build_root}/awips2/python/share/amqp
cp -prv %{_python_build_loc}/${QPID_SPECS}/* \
%{_build_root}/awips2/python/share/amqp
%pre
%post
# get the path to the awips2-python that is installed
PYDIR="/awips2/python"
# get the python version so we can fix the amqp xml/dtd
PYTHON_VERSION=$( LD_LIBRARY_PATH=${PYDIR}/lib ${PYDIR}/bin/python -c "from distutils.sysconfig import get_python_version; print get_python_version()" )
if [ $? -ne 0 ]; then
exit 1
fi
# the file /awips2/python/lib/python$PYTHON_VERSION/site-packages/qpid_config.py is wrong
# this substitution will put the correct path in the file qpid_config.py
# otherwise it will generate AMQP errors when run, it won't find the directory
sed -i "s|^AMQP_SPEC_DIR=.*/share/amqp\"|AMQP_SPEC_DIR=\"${PYDIR}/share/amqp\"|g" \
${PYDIR}/lib/python${PYTHON_VERSION}/site-packages/qpid_config.py
sed -i "s|^AMQP_SPEC_DIR=.*/amqp\"|AMQP_SPEC_DIR=\"${PYDIR}/share/amqp\"|g" \
%{_build_root}/${PYDIR}/lib/python${PYTHON_VERSION}/site-packages/qpid_config.py
if [ $? -ne 0 ]; then
exit 1
fi
%pre
%post
%preun