You can use the following steps to compile tmux 1.7 on CentOS 5.8:
Install developer tools
yum groupinstall "Development Libraries"
yum groupinstall "Development Tools"
yum install rpm-build gcc
Setup .rpmmacros file
$ cat > /home/<myusername>/.rpmmacros << EOF
%packager Your Name
%vendor Your Orgnazation
%_topdir /home/<myusername>/rpmbuild
%_signature gpg
%_gpg_name Your Packaging Dept
%_gpg_path /home/mockbuild/.gnupg
%dist build_id
%buildroot
EOF
NOTE: Make sure you substitute your $HOME path into <myusername>
.
Setup rpmbuild area
mkdir -p $HOME/rpmbuild/{BUILD,RPMS/i386,SOURCES,SPECS,SRPMS}
Build libevent 2.x RPM
# d/l package
wget http://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.10-stable.tar.gz/download
mv libevent-2.0.10-stable.tar.gz rpmbuild/SOURCES/
# download .spec file
wget http://geekery.altervista.org/specs/libevent2010.spec
mv libevent2010.spec rpmbuild/SPECS
# build RPM
rpmbuild -bb rpmbuild/SPECS/libevent2010.spec
Install libevent packages
cd $HOME/rpmbuild/RPMS/x86_64
rpm -ivh libevent-devel-2.0.10-1build_id.x86_64.rpm libevent-2.0.10-1build_id.x86_64.rpm
Download tmux SRPM
For this we're going to download the SRPM for Fedora, but extract the contents of it out and reuse it's .spec file to build tmux for CentOS 5.x.
cd $HOME/rpmbuild
wget ftp://ftp.muug.mb.ca/mirror/fedora/linux/development/19/source/SRPMS/t/tmux-1.7-2.fc19.src.rpm
mkdir -p temp && cd temp
rpm2cpio ../tmux-1.7-2.fc19.src.rpm | cpio -idmv
mv tmux.spec ../SPECS/ && mv tmux-1.7.tar.gz ../SOURCES/
cd ../SPECS/ && rmdir ../temp/
Edit tmux.spec
vim tmux.spec
I ran into several issues with this tmux.spec file. Not sure if it was my setup or not so I made these changes but you may not require them.
# Added these lines after the BuildRequires
BuildRoot: %{buildroot}
Prefix: /usr
# added DESTDIR=%{buildroot}
make %{?_smp_mflags} LDFLAGS="%{optflags}" DESTDIR=%{buildroot}
# changed this line
%{_bindir}/bin/tmux
# to this line
/usr/bin/tmux
Save this file.
Building tmux RPM
cd $HOME/rpmbuild
rpmbuild -ba SPECS/tmux.spec
rpm -ivh RPM/x86_64/tmux-1.7-2.x86_64.rpm
prebuilds
Given the number of steps to do this I'm going to do you a favor and provide these RPMs in my yum repository.
References