Commit e3d82c60 authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Jean-Paul Saman

Improved detection for RPM build binary and capabilities.

parent 29e58960
......@@ -114,6 +114,10 @@ package-rpm: FORCE
echo "Creating RPM build environment"; \
mkdir -p src/rpm/BUILD src/rpm/SOURCES src/rpm/SPECS src/rpm/RPMS src/rpm/SRPMS; \
fi
if test -z "$(RPMBUILD)"; then
echo "Cannot build rpm packages without rpm binary capable of building packages. Please install rpm-build (for rpm version 4 and higher)."
exit 1
fi
$(MAKE) -C src rpm
echo -n "Clearing out rpm/BUILD/ ..."
#$(MAKE) -C src clean-rpm
......
......@@ -225,7 +225,25 @@ elif test -x /usr/sbin/rpm; then
elif test -x /bin/rpm; then
RPMBUILD="/bin/rpm"
fi
# check rpm version
rpmver=
if ! test -z "$RPMBUILD"; then
rpmver=`$RPMBUILD --version 2>/dev/null | sed -e 's/RPM version //'`
rpmtest=`basename $RPMBUILD`
case $rpmver in
4.*|4.*.*|4.*.*.*|4.*.*.*)
if ! test "$rpmtest" = "rpmbuild"; then
echo "Unable to build RPM package because rpmbuild binary is not avaible. Please install rpm-build package."
exit 1
fi
;;
*)
echo "Unable to buld RPM packages"
RPMBUILD=
exit 1
;;
esac
echo "RPMBUILD = $RPMBUILD" >> config.mak
DOMAINNAME=`dnsdomainname`
if test -z "$DOMAINNAME"; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment