分类:
2006-03-26 21:31:08
If you have downloaded the .src.rpm
package and want to build the
binary package follow the following steps:
postfix-.....src.rpm
%{_sourcedir}
and %{_specdir}
,
ready for starting the package build. See below for the exact location
that rpm uses.
rpm -Uvh postfix-...src.rpm
postfix.spec
file.
Create the specific postfix.spec file: cd `rpm --eval '%{_sourcedir}'`
# set the required build options
export POSTFIX_SMTPD_MULTILINE_GREETING=1 # for exmaple
# export POSTFIX_IPV6=1
# export POSTFIX_LDAP=1
# export POSTFIX_MYSQL=1
# export POSTFIX_MYSQL_REDHAT=1
# # if used provide the directories of the mysql include and lib files
# # - only 2 directories are allowed and the order should be as stated
# export POSTFIX_MYSQL_PATHS=/include/directory:/lib/directory
# export POSTFIX_PCRE=1
# export POSTFIX_PGSQL=1
# export POSTFIX_RBL_MAPS=1
# There is support for building Postfix with SASL v1 or v2.
# - select the correct version
# export POSTFIX_SASL=1 # to enable support for SASL v1
# export POSTFIX_SASL=2 # to enable support for SASL v2
# export POSTFIX_SPF=1
# export POSTFIX_TLS=1
# export POSTFIX_VDA=1
# DB library support is determined by default according to your distribution
# however to modify the default library used you can do the following:
# export POSTFIX_DB=3 # to enable support for db3
# export POSTFIX_DB=4 # to enable support for db4
# this creates %{_specdir}/postfix.spec
sh `rpm --eval '%{_sourcedir}'`/make-postfix.spec
cd `rpm --eval '%{_specdir}'`
rpmbuild -ba postfix.spec
The binary and source rpms are put in %{_rpmdir}/i386
and %{_srcrpmdir}
respectively.
rpm -Uvh `rpm --eval '%{_rpmdir}'`/i386/postfix-...i386.rpm
On RedHat Linux the standard directory structure used by rpm is:
RPM Macro | Standard Directory or Value | |
%{_sourcedir} | /usr/src/redhat/SOURCES | |
%{_specdir} | /usr/src/redhat/SPECS | |
%{_rpmdir} | /usr/src/redhat/RPMS |
These values can be obtained from rpm by the following command:
rpm --eval '%{name}'