File lftp.spec of Package lftp
#
# spec file for package lftp
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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/
#
%define vi_version 1.1
Name: lftp
Version: 4.7.3
Release: 0
Summary: Command Line File Transfer Program
License: GPL-2.0+
Group: Productivity/Networking/Ftp/Clients
Url: http://lftp.yar.ru/
Source: http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz
# Formely: http://michael.stapelberg.de/lftp_vi/
Source2: lftp-vi.%{vi_version}.tar.gz
Source3: lftp.png
Source4: http://lav.yar.ru/lav@yars.free.net-gpg-public-key#/%name.keyring
Source5: http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz.asc
Source99: lftp-rpmlintrc
Patch1: lftp-compat-addfiles.patch
Patch2: lftp-wrapper+edit+compat-modify.patch
Patch4: lftp-autoconf-req.patch
Patch6: lftp-completion.patch
Patch7: lftp-stdio.h.patch
# PATCH-FIX-UPSTREAM -- Include config.h where needed.
Patch9: lftp-config_h.patch
# PATCH-FEATURE-OPENSUSE lftp-ssl-cipher.patch pgajdos@suse.cz -- use stronger cipher [bnc#857148]
Patch10: lftp-default-ssl-cipher.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: gzip
BuildRequires: libexpat-devel
BuildRequires: libidn-devel
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: make
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: tar
BuildRequires: update-alternatives
BuildRequires: xz
BuildRequires: zlib-devel
Requires: %{_bindir}/less
Requires(post): update-alternatives
Requires(postun): update-alternatives
Conflicts: ftp
Obsoletes: lftp-beta < %{version}
Provides: lftp-beta = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
LFTP is a reliable shell-like command line FTP client. It can retry
operations and does reget automatically. It can do several transfers
simultaneously in the background. With LFTP, you can start a transfer
in the background and continue browsing that FTP site or another one.
This is all done in one process. Background jobs are completed in nohup
mode if you exit or close the modem connection. LFTP has reput, mirror,
and reverse mirror among its features. Since version 2.0, it also
supports the HTTP protocol. Other features include IPV6 support,
context sensitive completion, output redirection to files or to pipe,
FTP and HTTP proxy support, transfer rate throttling for each
connection and for all connections in sum, job queueing, job execution
at specified times, opie and skey support in the FTP protocol, SSL for
HTTP and FTP, and FXP transfers.
%prep
%setup -q
pushd src
tar xzf "%{SOURCE2}"
popd
%patch1
%patch2
%patch4
pushd src
%patch6
popd #src
%patch7 -p1
%patch9 -p1
%patch10 -p1
%build
autoreconf -fi
CFLAGS="-DUSE_VARARGS -DPREFER_STDARGS %{optflags} -fstack-protector"
CFLAGS="$CFLAGS" \
CXXFLAGS="$CFLAGS" \
LDFLAGS=' ' \
%configure \
--disable-static \
--with-modules \
--without-gnutls \
--with-openssl \
--with-debug \
--without-profiling \
--enable-largefile \
--with-pager=%{_bindir}/less \
--with-libresolv
make %{?_smp_mflags} STRIP=touch
%install
make DESTDIR=%{buildroot} install STRIP=touch MKDIR_P="mkdir -p"
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
%if 0%{?suse_version} <= 1310
touch %{buildroot}%{_sysconfdir}/alternatives/ftp
touch %{buildroot}%{_sysconfdir}/alternatives/ftp.1.gz
%endif
ln -sf %{_sysconfdir}/alternatives/ftp %{buildroot}%{_bindir}/ftp
ln -sf %{_sysconfdir}/alternatives/ftp.1.gz %{buildroot}%{_mandir}/man1/ftp.1.gz
# We don't package the .la files
find %{buildroot} -type f -name "*.la" -delete -print
install -D -m 0644 "%{SOURCE3}" "%{buildroot}%{_datadir}/pixmaps/%{name}.png"
%find_lang %{name}
%post
/sbin/ldconfig
update-alternatives --install %{_bindir}/ftp ftp %{_bindir}/%{name}_wrapper 5 \
--slave %{_mandir}/man1/ftp.1.gz ftp.1 %{_mandir}/man1/%{name}.1.gz
%postun
/sbin/ldconfig
if [ "$1" = 0 ] ; then
update-alternatives --remove ftp %{_bindir}/%{name}_wrapper
fi
%files -f "lftp.lang"
%defattr(-,root,root)
%doc BUGS COPYING ChangeLog FAQ FEATURES README* NEWS THANKS TODO
%ghost %{_sysconfdir}/alternatives/ftp
%ghost %{_sysconfdir}/alternatives/ftp.1.gz
%{_bindir}/ftp
%{_mandir}/man1/ftp.1.gz
%config %{_sysconfdir}/lftp.conf
%{_bindir}/lftp
%{_bindir}/lftpget
%{_bindir}/lftp_wrapper
%{_datadir}/lftp
%dir %{_libdir}/lftp
%dir %{_libdir}/lftp/%{version}
%{_libdir}/lftp/%{version}/cmd-edit.so
%{_libdir}/lftp/%{version}/cmd-mirror.so
%{_libdir}/lftp/%{version}/cmd-sleep.so
%{_libdir}/lftp/%{version}/cmd-torrent.so
%{_libdir}/lftp/%{version}/compat-mode.so
%{_libdir}/lftp/%{version}/liblftp-network.so
%{_libdir}/lftp/%{version}/liblftp-pty.so
%{_libdir}/lftp/%{version}/proto-file.so
%{_libdir}/lftp/%{version}/proto-fish.so
%{_libdir}/lftp/%{version}/proto-ftp.so
%{_libdir}/lftp/%{version}/proto-http.so
%{_libdir}/lftp/%{version}/proto-sftp.so
%{_libdir}/liblftp-*.so
%{_libdir}/liblftp-*.so.*
%{_mandir}/man1/lftp.1%{ext_man}
%{_mandir}/man1/lftpget.1%{ext_man}
%{_mandir}/man5/lftp.conf.5%{ext_man}
%{_datadir}/pixmaps/%{name}.png
%changelog