I’ve Built SRPM package for postfix 2.8.0 on my spare time today, based on Simon J. Mudd’s template of course 🙂
The Hardest parts was testing and applies the right patches, but it seems okay when it compiled
Here’s the srpm file:
postfix-2.8.0 (1 download )This how to rebuild the source :
$ rpm -Uvh postfix-2.8.0.src.rpm
Set the environments
$ export POSTFIX_SMTPD_MULTILINE_GREETING=1 $ export POSTFIX_LDAP=1 $ export POSTFIX_MYSQL_REDHAT=1 $ export POSTFIX_PCRE=1 $ export POSTFIX_PGSQL=1 $ export POSTFIX_RBL_MAPS=1 $ export POSTFIX_SASL=2 $ export POSTFIX_TLS=1 $ export POSTFIX_VDA=1 $ export POSTFIX_DB=4
Create postfix.spec file and go to rpm spec directory
$ sh `rpm --eval '%{_sourcedir}'`/make-postfix.spec $ cd `rpm --eval '%{_specdir}'`
rebuild rpms/srpms
$ rpmbuild -ba postfix.spec
done
note: tested only on centos 4.7 i386 machine, initial rpm source was build on centos 5.4 x86_64 (ibm blade) but not installed, you might want to test/check it first before installing on production machine
gak paham… sepertinya nyasar ke website alien..
:hammer:
hah?
Hi. Thank for you manual.
But i have a some trouble. When i do a build postfix.spec i got a error:
error: Failed build dependencies:
/usr/bin/cc is needed by postfix-2:2.8.0-1.db4.pcre.pgsql.mysql.sasl2.vda.x86_64
gcc&c++ installed. Maybe you have idea how to fix it.
Many thanks for you help.
it seem that you don’t have cc installed. it’s part of gcc.
this is mine:
install gcc, it will do the job. if you’re connected to internet you can use “yum install gcc” it’ll install gcc and all its dependencies.
Hi again.
This step not help to me.
error: Failed build dependencies:
/usr/bin/cc is needed by postfix-2:2.8.0-1.db4.pcre.pgsql.mysql.sasl2.vda.x86_64
[root@mail SPECS]# /usr/bin/cc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-amazon-linux/4.7.2/lto-wrapper
Target: x86_64-amazon-linux
Configured with: ../configure –prefix=/usr –mandir=/usr/share/man –infodir=/usr/share/info –with-bugurl=http://bugzilla.redhat.com/bugzilla –enable-bootstrap –enable-shared –enable-threads=posix –enable-checking=release –disable-build-with-cxx –disable-build-poststage1-with-cxx –with-system-zlib –enable-__cxa_atexit –disable-libunwind-exceptions –enable-gnu-unique-object –enable-linker-build-id –with-linker-hash-style=gnu –enable-languages=c,c++,objc,obj-c++,,fortran,ada,go,lto –enable-plugin –enable-initfini-array –disable-libgcj –without-ppl –without-cloog –with-tune=generic –with-arch_32=i686 –build=x86_64-amazon-linux
Thread model: posix
gcc version 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC)
rpm -qf /usr/bin/cc
file /usr/bin/cc is not owned by any package
Maybe you have another idea ?
Thanks for your help.
that’s strange, you have cc but it’s not belong to any package.
try removing /usr/bin/cc from BuildRequires from postfix.spec
original
edited
hope it help.
Not help.
I tried to do it before.
thank you
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.TxlWxy
+ umask 022
+ cd /root/rpmbuild/BUILD
+ umask 022
+ ‘[‘ 0 ‘!=’ 0 ‘]’
+++ rpm –eval /root/rpmbuild/SOURCES
++ sh /root/rpmbuild/SOURCES/postfix-get-distribution
+ distribution=’ERROR: postfix-get-distribution – unable to determine distribution, exiting’
error: Bad exit status from /var/tmp/rpm-tmp.TxlWxy (%prep)
RPM build errors:
line 142: prereq is deprecated: PreReq: chkconfig, initscripts, shadow-utils
line 143: prereq is deprecated: PreReq: /etc/init.d, /sbin/service, chkconfig >= 1.3
Bad exit status from /var/tmp/rpm-tmp.TxlWxy (%prep)
what kind of distro are you using?the srpm package based on simon j mudd’s package. looks like postfix-get-distribution script cannot decide what kind of distro you are using. do you following steps in tutorial or just compile with rpmbuild –rebuild postfix-2.8.0.src.rpm? just curious..
cat /etc/*release
Amazon Linux AMI release 2011.09
all steps as tutorial without trouble, error only when compile postfix.
from postfiz i need only support TCP table for implementation SRS (http://blog.phusion.nl/2012/09/10/mail-in-2012-from-an-admins-perspective/)
i’m afraid your linux distribution is not supported. if the distribution provide stock postfix in it, you can hack it.
this is an example on how to do it:
http://www.kutukupret.com/2010/02/08/compiling-postfix-2-7-0-as-rpm-package/
I decided to take a different.
Built SRPM package for postfix on another servers (CentOS) and copy lib and bin file to this server.
postconf -m
btree
cidr
environ
hash
ldap
mysql
nis
pcre
pgsql
proxy
regexp
static
tcp
unix
YES, i see tcp support, but still have error:
main.cf
recipient_canonical_maps = hash:/etc/postfix/pfix-no-srs.cf, tcp:127.0.0.1:10002
recipient_canonical_classes = envelope_recipient
sender_canonical_maps = hash:/etc/postfix/pfix-no-srs.cf, tcp:127.0.0.1:10002
sender_canonical_classes = envelope_sender
postfix/smtpd[28991]: fatal: unsupported dictionary type: tcp
ohohoho, i am confusion, maybe you have any idea ??? many thanks
postfix executables linked to many system libraries at configure/compile time, they might be in different path in various system. you cannot just plugged the executables/libs into another different system. you better trying build from source first. sorry cannot help you much, i’ve never used linux distribution like yours. 😀