File tnftp.spec of Package tnftp

#
# spec file for package tnftp
#
# Copyright (c) 2012 SUSE LINUX Products 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 http://bugs.opensuse.org/
#


Name:           tnftp
Version:        20100108
Release:        0
Summary:        Enhanced FTP Client
License:        BSD-3-Clause
Group:          Productivity/Networking/Ftp/Clients
Url:            ftp://ftp.netbsd.org/pub/NetBSD/misc/tnftp/
Patch0:         tnftp-20100108-am_and_libedit.patch
Source0:        ftp://ftp.netbsd.org/pub/NetBSD/misc/tnftp/%{name}-%{version}.tar.gz
Source1:        ftp://ftp.netbsd.org/pub/NetBSD/misc/tnftp/%{name}-%{version}.tar.gz.asc
Source2:        tnftp.keyring
BuildRequires:  libedit-devel
BuildRequires:  pkgconfig
BuildRequires:  update-alternatives
BuildRequires:	autoconf
BuildRequires:	automake
BuildRequires:	libtool
%if 0%{?suse_version} >= 1230
BuildRequires:  gpg-offline
%endif
Conflicts:      ftp
Provides:       lukemftp = 1.6
Provides:       nkitb:/usr/bin/ftp
Obsoletes:      lukemftp <= 1.5
Requires(pre):  update-alternatives
Requires(pre):  coreutils
Requires(post):  update-alternatives
Requires(post):  coreutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description


%prep
%if 0%{?suse_version} >= 1230
%gpg_verify %{SOURCE1}
%endif

%setup -q
%patch0

%build
#axe bundled library
%__rm -rf libedit
autoreconf -fiv
%configure
%__make %{?_smp_mflags}

%install
%makeinstall
touch ${RPM_BUILD_ROOT}%{_bindir}/ftp

%post
test -L %{_bindir}/ftp || rm -f %{_bindir}/ftp
update-alternatives --install  %{_bindir}/ftp ftp %{_bindir}/%{name} 10 \
  --slave %{_mandir}/man1/ftp.1.gz ftp.1 %{_mandir}/man1/%{name}.1.gz
update-alternatives --auto ftp

%preun
if [ $1 -eq 0 ]; then
  update-alternatives --remove ftp %{_bindir}/%{name}
fi

%clean
%__rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc COPYING ChangeLog NEWS README THANKS
%ghost %attr(0755,root,root) %{_bindir}/ftp
%{_bindir}/%{name}
%{_mandir}/man1/*

%changelog
openSUSE Build Service is sponsored by