fedora-rebuild-a-source-package

General instructions to rebuild a Fedora source rpm.

Note: This example uses the vlc source rpm, but it doesn’t work on my Fedora 8 system because there are problems installing dependencies, but the general commands should work on other packages

  1. Install build tools
    su -c 'yum install yum-utils rpmdevtools'
  2. Download source package. Either use yumdownloader to download from an existing repository:
    yumdownloader --source vlc

    or download directly from a server

    wget -nd ftp://ftp.pbone.net/mirror/rpm.livna.org/fedora/development/SRPMS/\
    vlc-0.9.0-0.5.20080802git.lvn10.src.rpm
  3. Install the source package. This will unpack the source into your /$HOME/rpmbuild directory.
    rpm -Uvh vlc-0.8.6i-1.lvn8.src.rpm
  4. Install build dependencies for the source package
    su -c 'yum-builddep vlc-0.8.6i-1.lvn8.src.rpm'
  5. Edit the spec file
    cd ~/rpmbuild/SPECS
    vim vlc.spec
  6. Add the new source package
    cd ../SOURCES
    wget -nd http://download.videolan.org/pub/videolan/vlc/0.9.2/vlc-0.9.2.tar.bz2
  7. Build the rpm
    cd ../SPECS
    rpmbuild -bb vlc.spec
  8. Install the rpm
    cd ../RPMS/x86_64
    rpm -Uvh vlc-0.9.2.fc8.x86_64.rpm

References:
Building a kernel from the src rpm
Fedora rpm guide