Src. rpm is the source package and can be used only after compilation. After installation, the source code is used. After rebuild, the rpm package will be generated.
Method:
Example 1:
Download complete:
[Root @ localhost beinan] # ls unrar *
Unrar-3.5.2-1.2.fc4.src.rpm unrar. spec
Install the source package unrar-3.5.2-1.2.fc4.src.rpm; Have a look at where installed?
[Root @ localhost beinan] # rpm-ivh unrar-3.5.2-1.2.fc4.src.rpm
Install it here:
[Root @ localhost beinan] # ls/usr/src/redhat/SOURCES/unrar
Unrarsrc-3.5.2.tar.gz
Then we use unrar. spec to execute it. In fact, it is a compiled script;
[Root @ localhost beinan] # rpmbuild -- ba unrar. spec
Compilation completed:
[Root @ localhost beinan] # ls/usr/src/redhat/RPMS/i386/
Unrar-3.5.2-1.i386.rpm unrar-debuginfo-3.5.2-1.i386.rpm
Can it be installed?
[Root @ localhost beinan] # rpm-ivh/usr/src/redhat/RPMS/i386/unrar-3.5.2-1.i386.rpm
Preparing... ######################################## ### [100%]
1: unrar ####################################### #### [100%]
Is it available?
[Root @ localhost beinan] # unrar x mydoc.rar
Clean up junk files: If you often use this method to compile RPM packages, you can mainly clean up the contents of various directories in/usr/src/redhat;
Example 2:
Method 1:
1. Execute rpm-I your-package.src.rpm
2. cd/usr/src/redhat/SPECS
3. rpmbuild-bp your-package.specs A specs file with the same name as your package
4. cd/usr/src/redhat/BUILD/your-package/a directory with the same name as your package
5 ../configure this step is the same as compiling common source code software. You can add Parameters
6. make
7. make install
Method 2:
1. Execute rpm-I you-package.src.rpm
2. cd/usr/src/redhat/SPECS
The first two steps are the same as method 1.
3. rpmbuild-bb your-package.specs A specs file with the same name as your package
At this time, in/usr/src/redhat/RPM/i386/(depending on the specific package, it may be i686, noarch, etc)
There is a new rpm package under this Directory, which is a compiled binary file.
Run the rpm-I new-package.rpm to complete the installation.
This article is from the WebOS blog