If you haven't done so before: It is easy to build or rebuild RPMS from SRPMS. Let's get a quick overview how we build RPMS in our HOWTO.
![]() | Important |
|---|---|
Never build RPMS as root. | |
Log into your machine as a regular user.
create a mirror image of the main RPM directory structure in your $HOME and
tell RPM to use these directories instead of the original ones.
RPM needs a certain directory structure to build RPMS from SOURCE or from SRPMS. When we build them as non-root user, we cannot use the default location because only root is allowed to write to those directories. So we create the same directory structure in our regular users $HOME-directory:
[user@example.com]$ mkdir $HOME/rpm $HOME/rpm/SOURCES $HOME/rpm/SPECS $HOME/rpm/BUILD $HOME/rpm/SRPMS $HOME/rpm/RPMS $HOME/rpm/RPMS/i386
When we are done with this, the directory tree of the new rpm directory in our $HOME-directory should look like that:
Now we need to tell the RPM-Manager that the non-root user wants this location to build RPMS instead of the default location.
[user@example.com]$ echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros
![]() | Note |
|---|---|
If you want to dig deeper into building RPMS you can find excellent information in the Maximum RPM HOWTO at rpm.org. | |
That's it, you are ready to build RPMS.