From patchwork Tue Dec 3 08:20:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Arnaud_R=C3=A9billout?= X-Patchwork-Id: 296100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id BA77D2C008C for ; Tue, 3 Dec 2013 19:20:21 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A33378148F; Tue, 3 Dec 2013 08:20:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6ejuSr35-D-L; Tue, 3 Dec 2013 08:20:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id CEDDB81650; Tue, 3 Dec 2013 08:20:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 58FE81BF98F for ; Tue, 3 Dec 2013 08:20:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 521AB8148F for ; Tue, 3 Dec 2013 08:20:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pLWHPL3oHCsh for ; Tue, 3 Dec 2013 08:20:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp4.infomaniak.ch (smtp4.infomaniak.ch [84.16.68.92]) by whitealder.osuosl.org (Postfix) with ESMTPS id 615C081650 for ; Tue, 3 Dec 2013 08:20:16 +0000 (UTC) Received: from S-RD-3.syscom.ch ([62.12.146.154]) (authenticated bits=0) by smtp4.infomaniak.ch (8.14.5/8.14.5) with ESMTP id rB38KBdT028824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Dec 2013 09:20:14 +0100 From: =?UTF-8?q?Arnaud=20R=C3=A9billout?= To: buildroot@busybox.net Date: Tue, 3 Dec 2013 09:20:07 +0100 Message-Id: <1386058807-4904-1-git-send-email-rebillout@syscom.ch> X-Mailer: git-send-email 1.8.4.4 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3] lftp: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net LFTP is a sophisticated ftp/http client, and a file transfer program supporting a number of network protocols. 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. Signed-off-by: Arnaud RĂ©billout Acked-by: Arnout Vandecappelle (Essensium/Mind) --- v3: + patch improved: there is now just one patch that add a test in the cross-compiling branch of AC_TRY_RUN + Config.in: some sensible default values: + sleep command enabled, since it takes no space + mirror command enabled, since it's the killer feature of lftp that makes it interesting compared to other clients, like ncftp + FTP proto enabled by default, since the name of the package (lftp) suggests it v2: + Config.in + Typo corrected + lftp.mk + LFTP_SOURCE removed + LFTP_AUTORECONF set to YES + POST_INSTALL_TARGET factorized a lot + patches: + Signed-off + Patch the m4 file instead of the configure script --- package/Config.in | 1 + ..._fallocate-m4-check-for-cross-compilation.patch | 46 ++++++++++++++++ package/lftp/Config.in | 64 ++++++++++++++++++++++ package/lftp/lftp.mk | 54 ++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 package/lftp/0001-Fix-posix_fallocate-m4-check-for-cross-compilation.patch create mode 100644 package/lftp/Config.in create mode 100644 package/lftp/lftp.mk diff --git a/package/Config.in b/package/Config.in index 311cc6c..bcaa8f3 100644 --- a/package/Config.in +++ b/package/Config.in @@ -814,6 +814,7 @@ source "package/iputils/Config.in" source "package/iw/Config.in" source "package/kismet/Config.in" source "package/knock/Config.in" +source "package/lftp/Config.in" source "package/lighttpd/Config.in" source "package/linknx/Config.in" source "package/links/Config.in" diff --git a/package/lftp/0001-Fix-posix_fallocate-m4-check-for-cross-compilation.patch b/package/lftp/0001-Fix-posix_fallocate-m4-check-for-cross-compilation.patch new file mode 100644 index 0000000..66f8a80 --- /dev/null +++ b/package/lftp/0001-Fix-posix_fallocate-m4-check-for-cross-compilation.patch @@ -0,0 +1,46 @@ +From 450ed0f38159a9944460ecff65793fe6de206df4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Arnaud=20R=C3=A9billout?= +Date: Mon, 25 Nov 2013 11:03:59 +0100 +Subject: [PATCH] Fix posix_fallocate m4 check for cross-compilation. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If we're cross-compiling, we can't test if the code run, we can only +test that it compiles and links. If it does, assume posix_fallocate +works, because cross-compilation for AIX or old glibc is unlikely. + +Signed-off-by: Arnaud RĂ©billout +--- + m4/lftp.m4 | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/m4/lftp.m4 b/m4/lftp.m4 +index 6d7ad9c..b38364d 100644 +--- a/m4/lftp.m4 ++++ b/m4/lftp.m4 +@@ -271,6 +271,21 @@ AC_DEFUN([LFTP_POSIX_FALLOCATE_CHECK],[ + i_cv_posix_fallocate_works=yes + ], [ + i_cv_posix_fallocate_works=no ++ ], [ ++ dnl * Cross-compilation: we can only test if the code compiles and links. ++ dnl * If it does, assume that it works, because cross-compilation for AIX or old glibc is unlikely. ++ AC_CACHE_VAL([i_cv_posix_fallocate_works],[ ++ AC_LINK_IFELSE([ ++ #include ++ int main() { ++ posix_fallocate(0, 0, 0); ++ } ++ ], [ ++ i_cv_posix_fallocate_works=yes ++ ], [ ++ i_cv_posix_fallocate_works=no ++ ]) ++ ]) + ]) + ]) + if test x$i_cv_posix_fallocate_works = xyes; then +-- +1.8.4.4 + diff --git a/package/lftp/Config.in b/package/lftp/Config.in new file mode 100644 index 0000000..f4bde79 --- /dev/null +++ b/package/lftp/Config.in @@ -0,0 +1,64 @@ +config BR2_PACKAGE_LFTP + bool "lftp" + depends on BR2_USE_WCHAR + depends on BR2_INSTALL_LIBSTDCPP + select BR2_PACKAGE_READLINE + select BR2_PACKAGE_ZLIB + select BR2_PACKAGE_GNUTLS if !BR2_PACKAGE_OPENSSL + help + LFTP is a sophisticated ftp/http client, and a file transfer program + supporting a number of network protocols. 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. + + http://lftp.yar.ru/ + +if BR2_PACKAGE_LFTP + +comment "Commands" + +config BR2_PACKAGE_LFTP_CMD_MIRROR + bool "Mirror command" + default y + help + Enable mirror command + +config BR2_PACKAGE_LFTP_CMD_SLEEP + bool "Sleep command" + default y + help + Enable sleep command + +config BR2_PACKAGE_LFTP_CMD_TORRENT + bool "Torrent command" + help + Enable torrent command + +comment "Protocols" + +config BR2_PACKAGE_LFTP_PROTO_FISH + bool "FISH protocol" + help + Enable FISH protocol + +config BR2_PACKAGE_LFTP_PROTO_FTP + bool "FTP protocol" + default y + help + Enable FTP protocol + +config BR2_PACKAGE_LFTP_PROTO_HTTP + bool "HTTP protocol" + help + Enable HTTP protocol + +config BR2_PACKAGE_LFTP_PROTO_SFTP + bool "SFTP protocol" + help + Enable SFTP protocol + +endif # BR2_PACKAGE_LFTP + +comment "lftp requires a toolchain w/ C++, wchar" + depends on !(BR2_USE_WCHAR && BR2_INSTALL_LIBSTDCPP) diff --git a/package/lftp/lftp.mk b/package/lftp/lftp.mk new file mode 100644 index 0000000..faf9f37 --- /dev/null +++ b/package/lftp/lftp.mk @@ -0,0 +1,54 @@ +################################################################################ +# +# lftp +# +################################################################################ + +LFTP_VERSION = 4.4.10 +LFTP_SITE = http://lftp.yar.ru/ftp +LFTP_LICENSE = GPLv3+ +LFTP_LICENSE_FILES = COPYING +LFTP_AUTORECONF = YES +LFTP_DEPENDENCIES = readline zlib + +LFTP_CONF_OPT += --with-modules + +ifeq ($(BR2_PACKAGE_GNUTLS),y) +LFTP_DEPENDENCIES += gnutls +LFTP_CONF_OPT += --with-gnutls +else +LFTP_CONF_OPT += --without-gnutls +endif + +ifeq ($(BR2_PACKAGE_OPENSSL),y) +LFTP_DEPENDENCIES += openssl +LFTP_CONF_OPT += --with-openssl +else +LFTP_CONF_OPT += --without-openssl +endif + +# Remove /usr/share/lftp +define LFTP_REMOVE_DATA + $(RM) -fr $(TARGET_DIR)/usr/share/lftp +endef + +LFTP_POST_INSTALL_TARGET_HOOKS += LFTP_REMOVE_DATA + +# Optional commands and protocols +LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_CMD_MIRROR) += cmd-mirror.so +LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_CMD_SLEEP) += cmd-sleep.so +LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_CMD_TORRENT) += cmd-torrent.so +LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_FISH) += proto-fish.so +LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_FTP) += proto-ftp.so +LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_HTTP) += proto-http.so +LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_SFTP) += proto-sftp.so + +define LFTP_REMOVE_MODULES + for f in $(LFTP_MODULES_TO_REMOVE-) ; do \ + $(RM) -f $(TARGET_DIR)/usr/lib/lftp/$(LFTP_VERSION)/$$f ; \ + done +endef + +LFTP_POST_INSTALL_TARGET_HOOKS += LFTP_REMOVE_MODULES + +$(eval $(autotools-package))