Chapter 3. What about working with sources?

Table of Contents
3.1 Installing the Source RPM
3.2 Installing patches using spec files
3.3 Building the RPM
3.4 Now What?
3.5 What's next?

The latest source for sendmail is always available at but if you're using Red Hat Linux why not work with the source RPM? The beautiful part of working this way is that any changes you make can easily be moved to other platforms via FTP. For those of you using older versions of Red Hat Linux but would like to upgrade to a newer version of sendmail, this section is for you.

For everyone's benefit, we're going to install a useful patch to sendmail in this section.

3.1 Installing the Source RPM

The source RPM for sendmail is on the second CD-ROM and we will need it for this. Mount the CD-ROM. Here is a step by step series of commands which shows the process:

    [root@boss /root]# mount /mnt/cdrom
    [root@boss /root]# cd /mnt/cdrom
    [root@boss cdrom]# ls
    [root@boss cdrom]# cd SRPMS
    [root@boss SRPMS]# ls sendmail*
    [root@boss SRPMS]# rpm -i sendmail-8.9.3-15.src.rpm
    [root@boss SRPMS]# cd /usr/src/redhat/SPECS
    [root@boss SPECS]# ls
    [root@boss SPECS]# ls /usr/src/redhat/SOURCES/
    aliases                          sendmail-8.9.3-cf.patch 
    check.tar                        sendmail-8.9.3-db1.patch          sendmail.8.9.3.tar.gz
    sendmail-8.7.1-makemapman.patch  sendmail-8.9.3-etc-mail-Makefile  sendmail.init
    sendmail-8.7.1-smrsh.patch       sendmail-8.9.3-redhat.patch       sendmail.sysconfig
    sendmail-8.8.7-rmail.patch       sendmail-8.9.3-smrsh.patch

The installation of the src.rpm did install some things. If you're new to all of this you may have installed a src.rpm before and expected something entirely different. If that has happened to you, you should now have a much better idea where the src.rpm installed its files. We need to add a patch file to this directory. Here's where to get it:˜ca/email/patches/mrbl.p3

The author did this quickly with the following commands:

    [root@boss SPECS]# cd /usr/src/redhat/SOURCES/
    [root@boss SOURCES]# wget˜ca/email/patches/mrbl.p3
               => `mrbl.p3'
    Connecting to connected
    HTTP request sent, awaiting response... 200 OK
    Length: 6,040 [text/plain]
	  0K -> .....                                                  [100%]
    18:56:00 (11.17 KB/s) - `mrbl.p3' saved [6040/6040]

For our purposes this is all very important, but we are particularly interested in the file:


because if we're really going to patch the RPM, we need to edit the spec file.