Building RPMs as unprivileged user

16 Jan 2009

It’s not recommended to build RPMS as root. Packages can be easily builded as unprivileged user, to accomplish this, we need to create a file called .rpmmacros in our home directory

$ cat ~/.rpmmacros
%_topdir /home/vitalie/rpmbuild
%_tmppath %{_topdir}/tmp

Then create required directories:

$ mkdir -p ~/rpmbuild/{BUILD,RPMS/{noarch,i386,i586,i686,x86_64},SOURCES,SPECS,SRPMS,tmp}

We are ready to build RPMs as simple user.