diff --git a/python-magnumclient.spec b/python-magnumclient.spec
index ca7cf6e8837b4e41b52002b1bc6560458d889e05..ea8f829669f7ccbde7de74faea38d968209d33e2 100644
--- a/python-magnumclient.spec
+++ b/python-magnumclient.spec
@@ -181,7 +181,7 @@ Requires:  python3-prettytable
 %py3_build
 %endif
 # generate html docs
-%{__python2} setup.py build_sphinx -b html
+sphinx-build -W -b html doc/source doc/build/html
 # Fix hidden-file-or-dir warnings
 rm -rf doc/build/html/.{doctrees,buildinfo}