New tmux rpm

This commit is contained in:
2019-08-16 10:55:09 +02:00
parent 9101332866
commit f52926495d

72
centos/SPECS/tmux.spec Normal file
View File

@@ -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 <daniel.steiner@daniel-steiner.org>
- Initial to version 3.0 for CentOS.