Day 15 of 60: Installing Sendmail
I’ve spent some time today getting Sendmail+DTrace to install properly.
This wasn’t quite as straightforward as it could be, requiring a little build infrastructure hacking.
The general stanza to build and install Sendmail after extracing the source code is:
% sh Build
% make install
This will overwrite your existing Sendmail installation. That’s not what I want. For the time being I want Sendmail to install itself somewhere different so that the base Sendmail configuration is not changed.
The Sendmail build system supports a DESTDIR variable. Set that, and it’s (in theory) prepended to all the paths that are created/installed. I ran in to one small problem with this.
The install infrastructure creates various links in $DESTDIR/usr/bin. And a bug meant that $DESTDIR was not being prepended to the link source. This meant that if I did this:
% sh Build
% make DESTDIR=$HOME/sendmail install
I’d see this:
% cd $HOME/sendmail/usr/bin
% ls -l # Some columns elided from output
total 408
lrwxrwxrwx 1 root root hoststat -> /usr/lib/sendmail*
lrwxrwxrwx 1 root root mailq -> /usr/lib/sendmail*
lrwxrwxrwx 1 root root newaliases -> /usr/lib/sendmail*
lrwxrwxrwx 1 root root purgestat -> /usr/lib/sendmail*
-r-xr-xr-x 1 bin bin vacation*
That’s no good — those links all point to the system copy of Sendmail. Change 1060 fixes this in the build infrastructure, creating the links correctly. The result is this:
% cd $HOME/sendmail/usr/bin
% ls -l # Some columns elided from output
total 408
lrwxrwxrwx 1 root root hoststat -> /home/nik/usr/lib/sendmail*
lrwxrwxrwx 1 root root mailq -> /home/nik/usr/lib/sendmail*
lrwxrwxrwx 1 root root newaliases -> /home/nik/usr/lib/sendmail*
lrwxrwxrwx 1 root root purgestat -> /home/nik/usr/lib/sendmail*
-r-xr-xr-x 1 bin bin vacation*
Trackbacks
Use this link to trackback from your own site.
[…] As mentioned previously, Sendmail supports a DESTDIR variable, which you can set on the make command line, to specify a prefix to be added to the all the installation paths. […]