In this how to i will describe how to create binary rpm (installable) using source rpm i.e *.src.rpm. Source rpm is collection of source files in tar.gz, patches and spec file. Spec file defines how the source code will compile with current machine, defining depencies and generate rpm from source rpm. Usually we do this when we need to have some custom changes to be made in required software.
First of all you should have install rpm-devel and rpm-build rpms from your distro repository. Confirm it using following command
rpm -qa | grep rpm
If you see required rpms in the list then you are good to go with source rpm compilation, else you have to install required rpms.
yum -y install rpm-build rpm-devel
rpm -ivh /path/rpm-build* /path/rpm-devel*
The rpm-build and rpm-devel also build following directories for source rpm compilations.
2) Compiling the source
Get your source rpm which you need to compile. Here i will get the ffmpeg source rpm from http://dag.wieers.com/rpm/packages/ffmpeg/ because i need to add libamr-nb and libamr-wb support for converting 3gp clips.
rpm -ivh ffmpeg-0.4.9-0.9.20070530.rf.src.rpm
It will install source files tar.gz, patch files in
and spec file in
I have to add –with-libamrnb and –with-libamrwb in ./configure command specified in ffmpeg.spec and you can edit whatever you are going to change/edit.
After editing now compile the sources and generate rpm using spec file.
rpmbuild -bb ffmpeg.spec
The above command will apply patches if any and compile the source and generate rpm under /usr/src/redhat/RPMS sub-directories regarding to your architecture i.e
/usr/src/redhat/RPMS/i386 for i386,i686
/usr/src/redhat/RPMS/x86_64 for x86_64 etc.
While compiling you will see the verbose output of compilation and you should see clean compilation with notifying of generating rpm at the end.
4 Responses to How To Create RPM Using Source RPM
Leave a Reply
« How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on CentOS 5.x How To Bind MAC with IP in SQUID »
DNS installed successfully, now I want to made him PDC,
secondly I don’t have direct internet connection e.g. through wireless I download the package and then copy it and then try to install that software. b/c wireless card is not installed in centos.
1. samba is in trar.gz extenstion.
how to install that
i give tar -zxvf sambas-3.5.3.tar.gz
what step next.?
secondly I install the LDAP and
in third step I want to install the LDAP tools but all are in norch extension. so HOW TO INSTALL THESE.
waiting for your earlier response.
wget does not install srpms…
@Chris: Yes wget wont install srpms, its to download any piece of file :). rpmbuild which build a rpm file from srpm and then you can install with rpm command. Kindly read full blog and you will find a way to compile and install srpms.
I did read it in full. Please refer to “2) Compiling the source”. You state “wget http://dag.wieers.com/rpm/packages/ffmpeg/ffmpeg-0.4.9-0.9.20070530.rf.src.rpm” and then say “It will install source files tar.gz, patch files in…”
And I repeat, wget will NOT “install source files tar.gz, patch files” anywhere.rpmbuild in