From f52926495d9fe7c393a2f91999a545da0104c57a Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Fri, 16 Aug 2019 10:55:09 +0200 Subject: [PATCH] New tmux rpm --- centos/SPECS/tmux.spec | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 centos/SPECS/tmux.spec diff --git a/centos/SPECS/tmux.spec b/centos/SPECS/tmux.spec new file mode 100644 index 0000000..70f840f --- /dev/null +++ b/centos/SPECS/tmux.spec @@ -0,0 +1,72 @@ +%global _hardened_build 1 + +Name: tmux +Version: 3.0 +Release: 1%{?dist} +Summary: A terminal multiplexer + +# Most of the source is ISC licensed; some of the files in compat/ are 2 and +# 3 clause BSD licensed. +License: ISC and BSD +URL: https://tmux.github.io/ +Source0: https://github.com/tmux/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz +# Examples has been removed - so include the bash_completion here +Source1: bash_completion_tmux.sh + +BuildRequires: gcc +BuildRequires: pkgconfig(libevent) +BuildRequires: pkgconfig(tinfo) +BuildRequires: pkgconfig(ncurses) +BuildRequires: pkgconfig(ncursesw) +BuildRequires: libutempter-devel + +%description +tmux is a "terminal multiplexer." It enables a number of terminals (or +windows) to be accessed and controlled from a single terminal. tmux is +intended to be a simple, modern, BSD-licensed alternative to programs such +as GNU Screen. + +%prep +%autosetup + +%build +./autogen.sh +%configure +%make_build + + +%install +%make_install +# bash completion +install -Dpm 644 %{SOURCE1} %{buildroot}%{_datadir}/bash-completion/completions/tmux + +%post +if [ "$1" = 1 ]; then + if [ ! -f %{_sysconfdir}/shells ] ; then + touch %{_sysconfdir}/shells + fi + for binpath in %{_bindir} /bin; do + if ! grep -q "^${binpath}/tmux$" %{_sysconfdir}/shells; then + (cat %{_sysconfdir}/shells; echo "$binpath/tmux") > %{_sysconfdir}/shells.new + mv %{_sysconfdir}/shells{.new,} + fi + done +fi + +%postun +if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then + sed -e '\!^%{_bindir}/tmux$!d' -e '\!^/bin/tmux$!d' < %{_sysconfdir}/shells > %{_sysconfdir}/shells.new + mv %{_sysconfdir}/shells{.new,} +fi + +%files +%doc CHANGES README example_tmux.conf SYNCING +%{_bindir}/tmux +%{_mandir}/man1/tmux.1.* +%{_datadir}/bash-completion/completions/tmux + +%changelog +* Fri Aug 16 2019 Daniel Steiner +- Initial to version 3.0 for CentOS. + +