Feb 232010
 

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:

[download#9]

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

  12 Responses to “postfix-2.8.0.src.rpm”

Comments (12)
  1. gak paham… sepertinya nyasar ke website alien..
    :hammer:

  2. hah?

  3. 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.

  4. it seem that you don’t have cc installed. it’s part of gcc.
    this is mine:

    # whereis cc
    cc: /usr/bin/cc
    # rpm -qf /usr/bin/cc
    gcc-x.x.x-xx.el5
    

    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.

  5. 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.

  6. 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

    BuildRequires: /usr/bin/cc, gawk, sed, ed, patch, rpm >= 4
    

    edited

    BuildRequires: gawk, sed, ed, patch, rpm >= 4
    

    hope it help.

  7. 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)

  8. 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..

  9. 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/)

  10. 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/

  11. 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

  12. 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. 😀

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*