Summary:        A terminal multiplexer
Name:           tmux
Version:        3.3a
Release:        2%{?_dist_release}
Group:          accessories
Vendor:         Project Vine
Distribution:   Vine Linux

# 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://github.com/tmux/tmux
Source0:        https://github.com/tmux/tmux/releases/download/%{version}/tmux-%{version}.tar.gz
Patch1:         3.3a-master.patch

BuildRequires:  ncurses-devel
BuildRequires:  libevent-devel
BuildRequires:  byacc

%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.


%debug_package


%prep
%autosetup -p1


%build
autoreconf -vif
%configure
make %{?_smp_mflags}


%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALLBIN="install -p -m 755" INSTALLMAN="install -p -m 644"


%post
if [ ! -f %{_sysconfdir}/shells ] ; then
    echo "%{_bindir}/tmux" > %{_sysconfdir}/shells
else
    grep -q "^%{_bindir}/tmux$" %{_sysconfdir}/shells || echo "%{_bindir}/tmux" >> %{_sysconfdir}/shells
fi


%files
%defattr(-,root,root,-)
%license COPYING
%doc CHANGES README*
%{_bindir}/tmux
%{_mandir}/man1/tmux.1.*


%changelog
* Sat Apr 29 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3a-2
- imported Patch1 from upstream for ncurses-6.4.

* Sun Jun 12 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3a-1
- new upstream release.

* Thu Jun 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3-1
- new upstream release.

* Tue Jul 20 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2a-1
- new upstream release.

* Wed Apr 21 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2-1
- new upstream release.

* Tue Nov 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1c-1
- new upstream release.

* Fri Aug 21 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1b-1
- new upstream release.

* Tue Apr 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0a-1
- new upstream release.

* Fri Aug 30 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.9a-1
- new upstream release.

* Sun Nov 04 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.8-1
- new upstream release.
- built with libevent-2.1.8.

* Thu Mar 31 2016 Toshiharu Kudoh <toshi.kd2@gmail.com> 2.1-1
- new upstream release
- fixed %%doc in %%files

* Fri Oct  4 2013 IWAI, Masaharu <iwaim.sub@gmail.com> 1.8-1
- update to 1.8

* Fri Jan 18 2013 IWAI, Masaharu <iwai@alib.jp> 1.7-1
- initial build for Vine Linux

* Sat Oct 13 2012 Sven Lankes <sven@lank.es> 1.7-1
- New upstream release

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue Jan 31 2012 Sven Lankes <sven@lank.es> 1.6-1
- New upstream release

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Nov 01 2011 Sven Lankes <sven@lank.es> 1.5-1
- New upstream release
- Do the right thing (tm) and revert to $upstream-behaviour: 
   No longer install tmux setgid and no longer use /var/run/tmux 
   for sockets. Use "tmux -S /var/run/tmux/tmux-`id -u`/default attach"
   if you need to access an "old" tmux session
- tmux can be used as a login shell so add it to /etc/shells

* Sat Apr 16 2011 Sven Lankes <sven@lank.es> 1.4-4
- Add /var/run/tmp to tmpdir.d - fixes rhbz 656704 and 697134

* Sun Apr 10 2011 Sven Lankes <sven@lank.es> 1.4-3
- Fix CVE-2011-1496
- Fixes rhbz #693824

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Dec 28 2010 Filipe Rosset <rosset.filipe@gmail.com> 1.4-1
- New upstream release

* Fri Aug 06 2010 Filipe Rosset <filiperosset@fedoraproject.org> 1.3-2
- Rebuild for F-13

* Mon Jul 19 2010 Sven Lankes <sven@lank.es> 1.3-1
- New upstream release

* Sun Mar 28 2010 Sven Lankes <sven@lank.es> 1.2-1
- New upstream release
- rediff writehard patch

* Mon Nov 09 2009 Sven Lankes <sven@lank.es> 1.1-1
- New upstream release

* Sun Nov 01 2009 Sven Lankes <sven@lank.es> 1.0-2
- Add debian patches
- Add tmux group for improved socket handling

* Sat Oct 24 2009 Sven Lankes <sven@lank.es> 1.0-1
- New upstream release

* Mon Jul 13 2009 Chess Griffin <chess@chessgriffin.com> 0.9-1
- Update to version 0.9.
- Remove sed invocation as this was adopted upstream.
- Remove optflags patch since upstream source now uses ./configure and
  detects the flags when passed to make.

* Tue Jun 23 2009 Chess Griffin <chess@chessgriffin.com> 0.8-5
- Note that souce is mostly ISC licensed with some 2 and 3 clause BSD in
  compat/.
- Remove fixiquote.patch and instead use a sed invocation in setup.

* Mon Jun 22 2009 Chess Griffin <chess@chessgriffin.com> 0.8-4
- Add optimization flags by patching GNUmakefile and passing LDFLAGS
  to make command.
- Use consistent macro format.
- Change examples/* to examples/ and add TODO to docs.

* Sun Jun 21 2009 Chess Griffin <chess@chessgriffin.com> 0.8-3
- Remove fixperms.patch and instead pass them at make install stage.

* Sat Jun 20 2009 Chess Griffin <chess@chessgriffin.com> 0.8-2
- Fix Source0 URL to point to correct upstream source.
- Modify fixperms.patch to set 644 permissions on the tmux.1.gz man page.
- Remove wildcards from 'files' section and replace with specific paths and
  filenames.

* Mon Jun 15 2009 Chess Griffin <chess@chessgriffin.com> 0.8-1
- Initial RPM release.
