[ale] SUCCESSFUL: My first custom recompile of an RPM. Was: Anyone have experience hosting email for multiple domains?

Richard Bronosky Richard at Bronosky.com
Thu Sep 10 13:48:44 EDT 2009


You are correct... again. ;-) I did overlook the part about
centosplus. I am glad that I went through the exercise however. It was
frustrating to have to learn on my own, but it's a skill I've needed
to have. We have often encountered needs for custom builds of mod_php,
mod_python, image magick, and others. I (repeated and repeated and
repeated and) documented my process in order to get comfortable with
it. I now feel like I could apply patches to MySQL and deploy the
custom builds myself. (Which is good because I am a MySQL DBA.) Where
before I didn't do that kind of R&D because I would have had to assign
it to one of the Sys Admins that I manage (my other other role).

I really feel like I ought to be able to do everything that those who
report to me do (except that I would have to Google way too much to
meet any deadlines). That is why the article that was sent yesterday
resonated with me so much:
http://www.computerworld.com/s/article/print/9137708/Opinion_The_unspoken_truth_about_managing_geeks
When the technology is Free, there is no excuse for not learning
constantly. I even started watching this video series on C++
programming. http://showmedo.com/videotutorials/series?name=7Ja4c8YuL
just to get a refresher on how C++ differs from C. (I highly recommend
that video series, BTW.)

.!# RichardBronosky #!.



On Thu, Sep 10, 2009 at 11:28 AM, Brandon Checketts
<brandon at brandonchecketts.com> wrote:
> Richard,
>
> Glad that worked out for you.   The first step in the guide is enabling the
> centosplus repository which should contain a Postfix package with MySQL support
> compiled in.  My guess is postfix was installed prior to enabling that
> repository, so the general package without MySQL support was already installed.
>  Does that sound correct?
>
> Glad you got it working without it though.  I've made a couple of notes in the
> guide to mention that.
>
> Thanks,
> Brandon Checketts
>
>
> Richard Bronosky wrote:
>> A big THANK YOU to Brandon Checketts! The guide you wrote was really
>> great. I decided to install CentOS on my slicehost server 1. because
>> that's what I use at work, and 2. to challenge myself. I didn't
>> realize how much I was going to have to learn so early into the setup.
>> However, rebuilding RPMs has been something that intimidated me, and I
>> always handed off to one of my direct reports.
>>
>> Brandon, it turns out that the postfix RPM in the CentOS 5 base repo
>> is not compiled with MySQL support, so that pretty much invalidated
>> your guide for that version of CentOS. I've included my script for
>> rebuilding the RPM with MySQL support. It can be found (without mail
>> line wrapping) at http://dpaste.com/91687/
>>
>> As always, I welcome anyone's thoughts.
>>
>> ################
>> #!/bin/bash
>>
>> # Because the postfix offered by CentOS 5 is not built with MySQL
>> support, we must compile it ourselves.
>>
>> # My hope is that this process should work with other packages. So,
>> I've built in a lot of flexability.
>>
>> # Define the package you need to custom build:
>> package=postfix
>> specfile=rpmbuild/SOURCES/$package.spec
>> # A base CentOS install doesn't define source repos. This will infer
>> the url for the source RPM.
>> url=$(yumdownloader --urls $package |sed
>> '$!d;s?/os/.*/?/os/SRPMS/?;s/[^.]*\.rpm$/src.rpm/')
>>
>> cd
>> # Building in your $HOME instead of as root protects your system.
>> # You must mimic the structure found in the default "topdir" of /usr/src/redhat
>> for d in $(ls /usr/src/redhat); do mkdir -p  rpmbuild/$d; done
>> # The rpmbuild command will take cues from the .rpmmacros file
>> echo %_topdir  $HOME/rpmbuild >> .rpmmacros
>> wget -P ~/rpmbuild/SRPMS $url
>> ( cd rpmbuild/SOURCES; rpm2cpio ../SRPMS/${url##*/} | cpio -idmv )
>>
>> # The following is the only part that is specific to postfix
>> if [[ $package == 'postfix' ]];
>> then
>>     # Enable MySQL support
>>     sed -i '/define MYSQL 0/s/0/1/' $specfile
>>     # If you don't want to include the "Postfix MTA logfile summary"
>> tool, do:    sed -i '/define PFLOGSUMM 1/s/1/0/' $specfile
>> fi
>> # If you build it...
>> rpmbuild -bb --clean --rmspec --rmsource $specfile | tee /tmp/$package-build.log
>> # ...they will come.
>> sudo yum localinstall $(awk '/^Wrote: /{print $2;quit}' /tmp/$package-build.log)
>>
>> # Uncomment the following to do some automatic clean up:
>>      rm -rf ~/rpmbuild /tmp/$package-build.log
>>      sed -i '$d' .rpmmacros
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
>



More information about the Ale mailing list