Installing mock is the way to go, if you are interested in making the same package as Fedora's (as opposed to just creating an rpm). When installing that, the package creates a mock user which happens to partially fix the problem. According to the Fedora wiki page Using Mock to test package builds, you should add yourself to the mock group:
Add your user name to the mock group
sudo usermod -a -G mock myusername
Doing that fixed the warnings which I got in a rebuild of Fedora's ncurses source-packages. Depending on the version of mock (and the packages built using it), there may be a mockbuild account referenced in the source-rpms:
commit c33ccca2d36250e9d9fb7dec85fa72c311d43adb
Author: Miroslav Suchý
Date: Thu Nov 13 14:59:00 2014 +0100
run --shell as root with --new-chroot
Until now --new-chroot run --shell as 'mockbuild' user. This is
regression from --old-chroot, where it was run as root user.
Further reading:
On 11/13/2010 18:15, Christopher Stolzenberg wrote:
yum install mock
useradd mockbuild
usermod -G mock mockbuild
Unless you want to ``su'' to a dedicated mockbuild account every time
you want to build you should add your usual account to the mock group
instead.
mock rebuild -r epel-6-x86_64 /home/mockbuild/kernel 2.6.32-71.7.1.el6.src.rpm
Mock typically grabs packages from CentOS, so until CentOS 6 is out
you're going to have to build using RHEL 6.
The Fedora project's page says to add your user to mock. You can skip this, but to avoid errors later (when installing srpms), add a mockbuild user. The mockbuild user doesn't need a password.
sudo useradd mockbuild