build: FreeBSD does not have /etc/os-release

So "manually" set requirements

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
This commit is contained in:
Willem Jan Withagen 2019-03-02 15:37:38 +01:00
parent 5de132944a
commit 46b3d671b4

View File

@ -6,24 +6,33 @@ if test -e build; then
fi
PYBUILD="2"
source /etc/os-release
case "$ID" in
fedora)
if [ "$VERSION_ID" -ge "29" ] ; then
PYBUILD="3"
fi
;;
rhel|centos)
MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
if [ "$MAJOR_VER" -ge "8" ] ; then
PYBUILD="3"
fi
;;
opensuse*|suse|sles)
PYBUILD="3"
WITH_RADOSGW_AMQP_ENDPOINT="OFF"
;;
esac
if [ -r /etc/os-release ]; then
source /etc/os-release
case "$ID" in
fedora)
if [ "$VERSION_ID" -ge "29" ] ; then
PYBUILD="3"
fi
;;
rhel|centos)
MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
if [ "$MAJOR_VER" -ge "8" ] ; then
PYBUILD="3"
fi
;;
opensuse*|suse|sles)
PYBUILD="3"
WITH_RADOSGW_AMQP_ENDPOINT="OFF"
;;
esac
elif [ "$(uname)" == FreeBSD ] ; then
PYBUILD="3"
WITH_RADOSGW_AMQP_ENDPOINT="OFF"
else
echo Unknown release
exit 1
fi
if [ "$PYBUILD" = "3" ] ; then
ARGS="$ARGS -DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3"
fi