Do not set RPMDIST to '%dist' when dist is not set by the distribution.
diff --git a/Makefile b/Makefile
index c04c8bc10336d0..a7a193fcc21283 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ endif
 # RPM build parameters
 RPMSPECDIR= packaging/rpm
 RPMSPEC = $(RPMSPECDIR)/ansible.spec
-RPMDIST = $(shell rpm --eval '%dist')
+RPMDIST = $(shell rpm --eval '%{?dist}')
 RPMRELEASE = 1
 ifeq ($(OFFICIAL),)
     RPMRELEASE = 0.git$(DATE)
