In RPM, the %_specfile macro will tell you the location of the current spec file.
It would be so nice if a list of such macros and their descriptions existed somewhere, instead of having to %dump and then search its output.
It would be also nice if the official docs told you about existence of %dump and you didn't have to rely on info from a random blog post from 2011 that you find on google.