File tnt.spec of Package tnt

#
# spec file for package tnt
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           tnt
Version:        1.9.2
Release:        0
Summary:        Terminal program for packet radio
License:        GPL-2.0-only
Group:          Productivity/Hamradio/Packet
URL:            http://www.wspse.de/WSPse/Packet.php3
Source:         ftp://ftp.wspse.de/pub/packet_radio/tnt/CVS/tnt-1.9.2.tar.bz2
Source99:       tnt-rpmlintrc
Patch0:         tnt-%{version}-install.dif
Patch1:         tnt-window.dif
Patch2:         tnt_bufferoverflows.diff
Patch3:         tnt-%{version}-configure-header-check.dif
Patch4:         tnt-%{version}-gettext-0_18.dif
Patch5:         tnt-%{version}-gettext-0_19.dif
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  bison
BuildRequires:  fdupes
BuildRequires:  gettext
BuildRequires:  libax25-devel
BuildRequires:  libtool
BuildRequires:  ncurses-devel
BuildRequires:  texinfo
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
%if 0%{?suse_version} <= 1230
BuildRequires:  sysvinit
%endif

%description
TNT is a console based packet radio terminal for hostmode tncs. It
supports virtual channels and socket communication. It also can be used
with ax25 kernel or kiss interfaces together with TFkiss.

%lang_package

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
# gettext 0.18 for openSUSE==13.1
%if 0%{?suse_version} == 1310
%patch4 -p1
%endif
# gettext 0.19 for openSUSE>13.1 (Note: 1315 = Leap 42.1)
%if 0%{?suse_version} > 1310
%patch5 -p1
%endif

%build
autoreconf -fiv
test -f po/Makevars || mv po/Makevars.template po/Makevars
%configure \
  --enable-ax25k2 \
  --enable-hibaud
# --enable-dpboxt
make %{?_smp_mflags}

%install
%make_install
rm -f examples/Makefile* examples/*.in examples/sounds/Makefile* examples/sounds/*.in
%find_lang %{name}
%fdupes -s %{buildroot}

%post
%install_info --info-dir=%{_infodir} %{_infodir}/tntdoc.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/tntdoc.info-1.gz
%install_info --info-dir=%{_infodir} %{_infodir}/tntdoc.info-2.gz
%install_info --info-dir=%{_infodir} %{_infodir}/tntdoc.info-3.gz
%install_info --info-dir=%{_infodir} %{_infodir}/tntdoc.info-4.gz

%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/tntdoc.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/tntdoc.info-1.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/tntdoc.info-2.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/tntdoc.info-3.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/tntdoc.info-4.gz

%files
%license COPYING
%doc AUTHORS AX25-NOTES ChangeLog NEWS README TODO
%{_bindir}/tnt
%{_bindir}/tntc
%{_sbindir}/tnt_setup.*
%{_includedir}/tntrun.h
%{_infodir}/tntdoc.info*
%{_prefix}/lib/tnt/
%dir %{_datadir}/tnt/
%config %{_datadir}/tnt/conf/
%{_datadir}/tnt/doc/
%{_datadir}/tnt/sounds/
%{_localstatedir}/spool/tnt/

%files lang -f %{name}.lang
%changelog
openSUSE Build Service is sponsored by