I am a newbie on RPM

I want to build a RPM of tmux and libevent for centos 6.5 which does not ship.

The problem is tmux needs libevent 2.0+ which centos 6.5 does not ship either. So I wrote rpm spec for both package here: https://github.com/sprhawk/RPMSPECs/tree/master/SPECS

However, centos 6.0 shipped a libevent 1.4 which is required by nfs package, and yum refused to update libevent.

How could I install libevent 2.0+ while reserving system provided libevent 1.4 ?

Updated #1:

  1. Why I didn't use /usr/local?

    Because I want to use %{_libdir} to indicate the lib dir to lib64 instead of lib automatically.


The simplest way to get tmux is to enable the EPEL package repository. That package is here: http://dl.fedoraproject.org/pub/epel/6/x86_64/repoview/tmux.html

But, it's easiest to install the EPEL release package, which you can read about here: https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F

EPEL currently has a slightly older version of tmux, but it does everything I've ever needed to do, and seems extremely stable (I've never seen it misbehave).

If you really needed a newer version of tmux and libevent, the standard way to build alternative library versions is to call the package something like libevent2, and include version information in the library filenames (libevent-2.0.so.5, for example). configure provides options for this in some cases; libtool is used by some libraries to assist with this. A quick googling reveals that libevent now uses libtool as of somewhere on the 2.0.x tree, so it should be reasonably easy to get an alternate named library.

Here's some documentation on packaging multiple library versions with RPM, with some decent examples: http://en.opensuse.org/openSUSE:Shared_library_packaging_policy

And, the official RPM docs on the subject of multiple versions (but it does not cover libraries directly): http://rpm.org/wiki/PackagerDocs/MultipleVersions

Finally, if I were setting out to build a libevent 2.0 package, I would start with the one found in the current CentOS 7 repository, and add the additional version info to the package name to make it installable simultaneously. You can find examples of packages that have multiple versions to see how this might be done. gtk2 and gtk3 are commonly available on most RPM-based systems, for example, though they're so large they get put into their own directories in lib or lib64, which is probably not useful or necessary with libevent.

| improve this answer | |
  • I have done: 1. set the package name to libevent2 2. set the prefix to /usr/local the prevent from overwriting libs and headers – sprhawk Aug 8 '14 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.