LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to build RPM from Postfix SRPM with PostgreSQL Support? (https://www.linuxquestions.org/questions/linux-general-1/how-to-build-rpm-from-postfix-srpm-with-postgresql-support-729429/)

justemail 05-29-2009 08:52 PM

How to build RPM from Postfix SRPM with PostgreSQL Support?
 
I do not know how to put this question but I am going to try!

I have SRPM for Postfix-2.5.? from Simon Mudd web site. I want to install Postfix with Postgres-8.3.7 support. I already have PostgreSQL installed on a LINUX CentOS 5.3 machine.

1. Can somebody either point me to a document which describe the procedure of creating a RPM from SRPM as described above -OR- instructions as how to do it,

knudfl 05-30-2009 02:38 AM

'postfix.spec', ref. specfile from postfix-2.5.5-1.fc10.src.rpm

Probably edit line 1 and 2
%{?!MYSQL: %define MYSQL 1}
%{?!PGSQL: %define PGSQL 0}

to
%{?!MYSQL: %define MYSQL 0}
%{?!PGSQL: %define PGSQL 1}

And keep the modified spec file in /home/"username"/
and point to it when doing # rpmbuild -bb postfix.spec

... Interesting 'postfix.spec', you can get it with

wget http://download.fedora.redhat.com/pu...1.fc10.src.rpm

and unpack the ' src.rpm ' with
rpm2cpio <package> | cpio -idmv
.....
Will build in 2 minutes with the above package on CentOS5.x.
( I have postgresql-8.1.11, don't know, if any problems with 8.3.7 ).
Result : postfix-2.5.5-1.i386.rpm postfix-pflogsumm-2.5.5-1.i386.rpm
You can edit line 43 " Release: 1%{?dist} " to Release: 1pg%{?dist}
( or your choice ) if you want a unique package identifier.
Buildrequires : postgresql-devel setup openldap-devel
pcre-devel cyrus-sasl-devel openssl-devel .
.....
Good luck !
.....

Berhanie 05-30-2009 11:57 PM

In case you decide to go with Simon J. Mudd, the instructions for building the rpm from the srpm are here. Just export the variables you need -- at least POSTFIX_PGSQL=1, in your case. You might as well install postfix-2.6.1.

justemail 05-31-2009 09:33 AM

I looked at Simon Mudd's instructions. I am not very experienced so they seem to be out of my league. This is what I did:

Go to http://ftp.w10.org/official/2.5/SRPM....6.1-1.srm.rpm
Click OK ; Down load SRPM file
Note: The file will start downloading.

Now rebuild the Postfix application:
%> rpmbuild --rebuild --define “with_pgsql 1” \
> --define “with_devecot 1” --define “with_sasl 1” \
> --define “with_devecot 1” --define “with_tls 1” \
> postfix-2.6.1-1.src.rpm

This will take a long time. If the installation is without errors: SUCCESS

Install the new RPM file created.
=======

Would somebody is kind enough to let me know if this installation is correct or not?

Jennifer K.

justemail 05-31-2009 10:41 AM

Quote:

Originally Posted by Berhanie (Post 3557912)
In case you decide to go with Simon J. Mudd, the instructions for building the rpm from the srpm are here. Just export the variables you need -- at least POSTFIX_PGSQL=1, in your case. You might as well install postfix-2.6.1.


I experimented with Simon Mudds instructions line-by-line and it seems to work. I need help with one item:

How to add a line to include 'Dovecot'?

I input the line as follows:

% export POSTFIX_dovecot=1

and it did not work.

Jennifer K.

Berhanie 05-31-2009 12:46 PM

Looks like you need to use capital letters. This is from make-postfix.spec:
Code:

...
#
# POSTFIX_ALT_PRIO      allow the alternative's priority to be changed (default 30)
# POSTFIX_CDB          support for Constant Database, CDB, by Michael Tokarev
#                      <mjt@corpit.ru>, as originally devised by djb.
# POSTFIX_DOVECOT      include support for Dovecot SASL
# POSTFIX_LDAP          include support for openldap packages
# POSTFIX_MYSQL        include support for MySQL's MySQL packages
# POSTFIX_MYSQL_REDHAT  include support for RedHat's mysql packages
# POSTFIX_MYSQL_PATHS  include support for locally installed mysql binary,
#                      providing the colon seperated include and
#                      library directories ( /usr/include/mysql:/usr/lib/mysql )
# POSTFIX_PCRE          include support for pcre maps
# POSTFIX_PGSQL        include support for PostGres database
# POSTFIX_SASL          include Cyrus SASL/AUTH support
#                              0 to disable sasl,
#                              1 for sasl v1, or
#                              2 for sasl v2
# POSTFIX_SMTPD_MULTILINE_GREETING
#                      include support for multitline SMTP banner
# POSTFIX_SPF          include support for libspf2
# POSTFIX_TLS          include support for TLS
# POSTFIX_VDA          include support for Virtual Delivery Agent
#
...



All times are GMT -5. The time now is 01:26 PM.