LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-11-2004, 11:05 PM   #1
hct224
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 87

Rep: Reputation: 15
building POSTFIX rpm package for Redhat


I download postfix source file from postfix.com site and want to know what command should I use to build a rpm package which has MySQL support. How am I going to do that?

thank you

ps. I want to build Postfix RPM package which has MySQL support because the RPM package which come with Redhat does NOT have this feature.
 
Old 06-13-2004, 09:46 PM   #2
mascdman
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Ubuntu 6.06 LTS
Posts: 152

Rep: Reputation: 30
(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 packageCreate 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
 
Old 06-14-2004, 12:26 AM   #3
hct224
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 87

Original Poster
Rep: Reputation: 15
Thank you. I'm going to try tomorrow and will post here the result.
 
Old 06-14-2004, 06:57 PM   #4
hct224
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 87

Original Poster
Rep: Reputation: 15
It works. I can send mail out but postfix mail server deny to receive mail(it said: Remote host said: 554 <mailme@mydomain(edited).com>: Relay access denied. I think I need to look closer the main.cf file


Thank you
 
Old 06-14-2004, 09:21 PM   #5
mascdman
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Ubuntu 6.06 LTS
Posts: 152

Rep: Reputation: 30
Try adding mydomain.com to the mydestination line in main.cf. This should make Postfix receive mail for mydomain.com and deliver it locally.

--mascdman
 
Old 06-16-2004, 01:14 AM   #6
hct224
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 87

Original Poster
Rep: Reputation: 15
Actualy, I did setup Postfix before but NEVER done with MySQL.

I just look through all my setup and NOW it's working OK. The last thing I have to do is setting up Pop-Before-SMTP to send mail out(I did before so I don't thing I will have trouble with it).


Thank you
 
Old 06-16-2004, 01:32 AM   #7
mascdman
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Ubuntu 6.06 LTS
Posts: 152

Rep: Reputation: 30
You're welcome

--mascdman
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Building Postfix with SASL + TLS mcd Linux - Networking 0 10-08-2005 09:43 PM
package building dockpunk Slackware 10 03-23-2005 09:46 AM
building rpm package question hct224 Linux - Newbie 2 09-02-2004 05:41 AM
can reinstall the rpm package without delete the rpm package eye Red Hat 1 10-20-2003 07:53 AM
Building own RPM package hems Linux - Newbie 1 11-28-2002 03:16 AM


All times are GMT -5. The time now is 11:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration