Monday, February 15, 2010

RPM Development in Linux

1) You need EMAC editor.

2) Go to File and select New and type the file name as Test.spec.

3) Test.spec file is a file which as all the  specification required for ur RPM development.

4) Go to /usr/src/redhat/SPEC folder i.e. cd /usr/src/redhat/SPEC , copy that Test.spec to this directory.

5) Then,  go to SOURCE directory i.e. cd ../SOURCE , copy all the required files that u want it to be in ur RPM ex:- executable, library, sripts from ur HOME dir to  this SOURCE dir.


6) Open Test.spec in /usr/src/redhat/, define the name for the RPM package, version number etc. Specify for which architecture u want the RPM.

7) Create a tar file of the source directory which contains all the resources which are to be in ur RPM .
tar cvf name_RPM-version.tar.bz2  as in Test.spec source folder name .

8) Go to /usr/src/redhat/SPEC i.e. cd /usr/src/redhat/SPEC, run a rpmbuild command to build the RPM
rpmbuild -ba Test.spec.

9) RPM will be built and placed in /usr/src/redhat/RPMS/architecture folder i.e. if u have configured ur RPM for i386 arch then RPM built will be in /usr/src/redhat/RPMS/i386 folder.


** Any doubts and any help required for building RPM in Linux u r free to ask .
Even i developed my first RPM 3 months back... but still.... i learned more from it......