That was the solution as /tmp was mounted noexec. The actual working solution was to create an .rpmmacros file in /root with the following line:
Setting $TMP or $TMPDIR as an environment variable doesn't work. I would think it could also be set in ImageMagick.spec.