星期六, 6月 09, 2007

Tips and Tricks: Building rpms without being root

Do the following:

mkdir -p $HOME/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo 「%home %(echo $HOME)」 >> $HOME/.rpmmacros

echo 「%_topdir %{home}/rpmbuild」 >> $HOME/.rpmmacros

Now when you install a src.rpm it will go to $HOME/rpmbuild/ instead of /usr/src/redhat/.