Previous: Setting up Mysql Replication

Building a Custom RPM

Sometimes the vendor provided RPM is not sufficient. Here’s directions of how to create a customized RPM:
  1. Download the source RPM

    Some sources:

    $ wget ftp://download.fedora.redhat.com/pub/fedora/linux/development/source/SRPMS/python-2.5.1-24.fc9.src.rpm
    
  2. Unpack the source RPM into a local build directory

    $ rpm --define '_topdir /home/chen23/mybuild' -ivh cracklib-2.8.12-2.src.rpm
    
  3. Modify the specfile and/or add patches (use “/usr/local/” and add “-chen23” when possible)

    sample changes to python.spec:

    %define _prefix /usr/local
    %define _libdir /usr/local/lib64
    %define _mandir /usr/local/man
    %define _docdir /usr/local/share/doc
    %define _bindir /usr/local/bin
    %define _includedir /usr/local/include
    
    Name: %{python}-chen23

    It is often necessary to change the setup portion to change the name, i.e.:

    %setup -q -n cracklib-%{version}

    sample changes to Django.spec:

    %define _prefix /usr/local
    %define _libdir /usr/local/lib64
    %define _mandir /usr/local/man
    %define _bindir /usr/local/bin
    %define _includedir /usr/local/include
    %define __python /usr/local/bin/python
    
    BuildRequires:  python-chen23-devel
  4. Build new RPM

    $ rpmbuild –define ‘_topdir /home/chen23/mybuild’ -ba python.spec