(Disclaimer: I'm running Mandrake 10.0, but I've altered these steps so that they should work for Redhat distros)
I'd suggest skipping the postfix tarball from postfix.org and get the SRPM package
Create the needed directories by running
Code:
mkdir -p ~/rpm/{BUILD,RPMS/i386,RPMS/noarch,SOURCES,SRPMS,SPECS,tmp}
And place the following two files in your home directory:
.rpmrc
Code:
buildarchtranslate: i386: i386
buildarchtranslate: i486: i386
buildarchtranslate: i586: i386
buildarchtranslate: i686: i386
.rpmmacros
Code:
%_topdir YOUR_HOME_DIR/rpm
%_tmppath YOUR_HOME_DIR/rpm/tmp
This lets you build RPMs as a regular user (a good thing). Once you've downloaded the source RPM, run
Code:
rpm -i /path/to/package/postfix-blah-blah-blah.src.rpm
cd ~/rpm/SPECS
ls
with your regular user (not as root). You should see a postfix .spec file listed. Open up the spec file in your favourite editor and look for a MYSQL option. I grabbed the Fedora Core 1 SRPM and it had the following in the spec file:
Code:
%define LDAP 2
%define MYSQL 0
%define PCRE 1
%define SASL 2
%define TLS 1
%define POSTDROP_GID 90
...(snip)...
%if %{MYSQL}
Requires: mysql, mysqlclient9
BuildRequires: mysql, mysqlclient9, mysql-devel
%endif
So changing the
%define MYSQL 0 to
%define MYSQL 1 should enable MYSQL support. Save the changed spec file and run
Code:
rpmbuild -ba postfix.spec
Note: Make sure you have the needed BuildRequires packages installed (in this case: mysql, mysqlclient9, mysql-devel). If everything goes well, you should wind up with a new RPM in ~/rpm/RPMS/i386.
Let me know if you have any problems.
--mascdman