6.1. Step 1: Prepare Your Environment to Build The Package
To build RPM s, you need a special structure of directories and some configurations on your environment. You should do everything as a regular user, in all steps. In fact, we recommend that you do not do this as root .
To create this directories, do this:
bash$ cd ~
bash$ mkdir -p src/rpm
bash$ cd src/rpm
bash$ cp -r /usr/src/redhat/* .
bash$ ls
BUILD/ RPMS/ SOURCES/ SPECS/ SRPMS/
bash$
(the "~" is an alias to the current user's home directory name, and the command line knows it should interpret it this way)
Of course this is on a Red Hat system, but the important point is to have the following directories under src/rpm :
BUILD/
RPMS/noarch/
SRPMS/
Then, you'll have to create the .rpmmacros file in you home directory, with this single line content:
%_topdir YOUR_HOME_DIR_HERE/src/rpm
And you should substitute YOUR_HOME_DIR_HERE with the absolute name of your $HOME directory. So as an example, my .rpmmacros file contains this line:
%_topdir /home/aviram/src/rpm
* License

