Building RPMS from Source

From MythTV Official Wiki
Revision as of 19:52, 15 January 2010 by Newbury (talk | contribs) (Created page with 'Category: Building RPMS from Source If you usually use the atrpms or rpmfusion repositories to obtain mythtv rpm files, but need to make some changes to one or a few files, …')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


If you usually use the atrpms or rpmfusion repositories to obtain mythtv rpm files, but need to make some changes to one or a few files, it is not difficult to amend and re-create an rpm.

You will need the rpm-build utilities, the source rpm for the package you wish to revise and the specific directory layout used by rpm.

1. yum install rpm-build


2. Download the source SRPM to your computer. Use a browser to find it at atrpms or rpmfusion and 'save as' to your computer at, say /tmp


3. Create a build tree in a user home directory:

       cd /home/mythtv
       mkdir rpm
       cd rpm
       mkdir SOURCES SPECS BUILD SRPMS RPMS
       mkdir -p RPMS/i386 RPMS/athlon RPMS/i586 RPMS/i686 RPMS/noarch


4. Create an rpm-macro to point to this spot, whichever login user you are:

       echo  "%_topdir /home/geoffrey/rpm" > /home/mythtv/.rpmmacros
    or 
       echo  "%_topdir /home/geoffrey/rpm" > /root/.rpmmacros
   (The latter will fail if you are not root, of course.)

5. Cd to whereever the source rpm is:

       cd /tmp

6. Install the source rpm.

       rpm -i whatever.fc12.i386.src.rpm

7. cd to /home/mythtv/rpm/SOURCES and make whatever changes are required.

8. cd /home/mythtv/rpm/SPECS

9. Build the revised rpm

       rpmbuild -bb whatever.spec


10. Change to the correct architecture folder.

       cd ../RPMS/i386

11. Install the revised rpm.

       rpm -Uvh *rpm