%if 0%{!?mkrel:1}
%define mkrel(c) %{1}%{?dist}
%endif

Summary:	Terminal multiplexer
Name:		tmux
Version:	3.5a
Release:	%mkrel 1
License:	BSD
Group:		Terminals
Url:		https://tmux.github.io/
Source0:	https://github.com/%{name}/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
BuildRequires:  (gcc or clang)
BuildRequires:  pkgconfig(pkg-config)
BuildRequires:	pkgconfig(ncurses)
BuildRequires:	pkgconfig(libevent) >= 2
BuildRequires:	pkgconfig(libsystemd)
BuildRequires:	(utempter-devel or libutempter-devel or /usr/include/utempter.h)
BuildRequires:  (pkgconfig(utf8proc) or utf8proc-devel or /usr/include/utf8proc.h)
BuildRequires:  pkgconfig(jemalloc)
BuildRequires:	(yacc or bison)

%description
tmux is a "terminal multiplexer". It allows a number of terminals (or
windows) to be accessed and controlled from a single terminal. It is
intended to be a simple, modern, BSD-licensed alternative to programs
such as GNU screen.


%prep
%setup -q
%autopatch -p1

%build
%configure --enable-systemd \
%if 0%{?mageia} < 10
	--enable-utf8proc \
%endif
	--enable-sixel --enable-jemalloc
%make_build

%install
%make_install

%files
%doc README CHANGES
%license COPYING
%{_bindir}/tmux
%{_mandir}/man1/tmux.*