2. rpmmacros

As far as I am concerned, ~/.rpmmacros gives us a chance to avoid using the usual build location. I know going into this that I will fail many times and I have no intention of fooling with my root partition. It's almost full anyway.

So, what goes in ~/.rpmmacros? Mine is :

# Copied directly from http://www.hut.fi/~tkarvine/rpm-build-as-user.html
# /etc/rpm/macros # (c) GPL 2003 Tero.Karvinen at-sign iki.fi
%packager %(echo "$USER")
%_topdir %(echo "$HOME")/rpmbuild
%_rpmtopdir %{_topdir}/%{name}
%_builddir %{_rpmtopdir}/BUILD
%_rpmdir %{_rpmtopdir}
%_sourcedir %{_rpmtopdir}
%_specdir %{_rpmtopdir}
%_srcrpmdir %{_rpmtopdir}
%_tmppath %{_rpmtopdir}/TMP
%_buildroot %{_tmppath}/%{name}-root

		

You must also create the ~/rpmbuild directory.

mkdir ~/rpmbuild
		

This setup puts BUILD and everything else inside the rpm top directory, which is handy for starting over. When I screw up I just delete the ~/rpmbuild/kernel directory and start over. However I'm always having to recreate the ~/rpmbuild/kernel/BUILD directory.