Users should turn these into SRPMS instead

Story: Build Postfix From Source on CentOSTotal Replies: 1
Author Content
hughesjr

Oct 04, 2009
8:32 AM EDT
The ability to build things from source is what open source software is all about. However, CentOS uses an RPM database to track all the items installed on your machine, and using make and make install from the tarball bypasses the ability to let the rest of the system know you have this package (or it's Shared Libraries and Development Headers installed).

If you only do this (install directly from source) with a couple of programs it can be very manageable, but in my opinion it is much better to build a Source RPM (SRPM) package and use that to build Binary RPM package(s) for installation.

I would find the RPM version of postfix from a Red Hat family (Red Hat, Fedora, CentOS, Scientific Linux, etc.) that closely matches the postfix version you want to build and use applicable SRPM to build the package.

Another thing that can be quite important is to control which packages are installed (and therefore linked against) when building your package, especially if you are going to make it available to others. RHEL, CentOS, Fedora, and Scientific Linux use a program called mock to do this:

http://fedoraproject.org/wiki/Projects/Mock

Mock will build a clean "chroot" environment for building packages. This chroot will contain only the minimal base packages required to initialize the os and build packages plus any dependencies defined for building in your SRPM.

This process is a bit more complex, but produces consistent binaries (since the build chroot always contains the same packages every time you build it) and prevents stray links to installed libraries that you might not want.

If you are going to software to install on an RPM based distribution, you should take the time to learn how to build it using the method that distribution uses to track package deployment. I am a CentOS developer, but I would recommend the same thing if you are doing the build and install of postfix on Ubuntu/Debian (do it via a deb file) or Gentoo (do it using the ebuild system) too ... build and install via the normal mechanism used on that Linux distribution, not directly via 'make' and 'make install'.
jdixon

Oct 04, 2009
1:25 PM EDT
While the dedicated build system is the best way to handle things, I've found that for one off packages which you might wish to keep on hand (for reinstalls and the like) checkinstall (http://www.asic-linux.com.mx/~izto/checkinstall/) has been a more convenient solution.

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!