Summary:	A sophisticated file transfer program
Name:		lftp
Version:	4.8.4
Release:	2
License:	GPLv3+
URL:		http://lftp.yar.ru/
Source0:        http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz
BuildRequires:	ncurses-devel, gnutls-devel, perl-generators, pkgconfig, gettext
BuildRequires:	gettext readline-devel, zlib-devel, gcc-c++ desktop-file-utils

Patch1:         lftp-4.0.9-date_fmt.patch
Patch6000:      fixed-sorting-of-FileSet-when-some-files-begin-with-.patch
Patch6001:      Making-remove_tags-function-more-efficient-from-quad.patch

%description
LFTP is a sophisticated file transfer program supporting a number of
network protocols (ftp, http, sftp, fish, torrent). Like BASH, it has
job control and uses the readline library for input. It has bookmarks,
a built-in mirror command, and can transfer several files in parallel.
It was designed with reliability in mind. LFTP is free software,
distributed under the GNU GPL license.

%package scripts
Summary:	Scripts for lftp
Requires:	lftp >= %{version}-%{release}
BuildArch:	noarch

%description scripts
Utility scripts for use with lftp.

%package_help

%prep
%autosetup -n %{name}-%{version} -p1

sed -i.norpath -e \
        '/sys_lib_dlsearch_path_spec/s|/usr/lib |/usr/lib /usr/lib64 /lib64 |' \
        configure

%build
%configure --with-modules --with-gnutls --without-openssl --with-debug
%make_build

%install
export tagname=CC
make DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' install
%delete_la
iconv -f ISO88591 -t UTF8 NEWS -o NEWS.tmp
touch -c -r NEWS NEWS.tmp
mv NEWS.tmp NEWS
desktop-file-install    \
--dir=%{buildroot}%{_datadir}/applications      \
%{buildroot}/%{_datadir}/applications/lftp.desktop

%ldconfig_scriptlets

%files
%defattr(-,root,root)
%doc COPYING
%{_datadir}/locale/*
%config(noreplace) %{_sysconfdir}/lftp.conf
%{_bindir}/*
%{_libdir}/lftp/%{version}/*.so
%{_libdir}/liblftp-*.so.*
%{_datadir}/applications/*.*
%{_datadir}/icons/hicolor/*/apps/*
%exclude %{_libdir}/*.so

%files scripts
%{_datadir}/lftp



%files help
%defattr(-,root,root)
%doc BUGS ChangeLog FAQ FEATURES NEWS THANKS TODO README*
%{_mandir}/*/*


%changelog
* Wed Aug 28 2019 openEuler Buildteam <buildteam@openeuler.org> - 4.8.4-2
- Package init
