git: c4a794b3d76d - main - ftp/axel: New port: Lightweight CLI download accelerator

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Fri, 25 Nov 2022 02:22:54 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c4a794b3d76d53d9c12f1d23afd58c85a73f885a

commit c4a794b3d76d53d9c12f1d23afd58c85a73f885a
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-11-25 02:22:03 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-11-25 02:22:50 +0000

    ftp/axel: New port: Lightweight CLI download accelerator
---
 MOVED                             |  3 +--
 ftp/Makefile                      |  1 +
 ftp/axel/Makefile                 | 33 +++++++++++++++++++++++++++++++++
 ftp/axel/distinfo                 |  3 +++
 ftp/axel/files/patch-src_axel.c   | 11 +++++++++++
 ftp/axel/files/patch-src_random.c | 11 +++++++++++
 ftp/axel/pkg-descr                |  7 +++++++
 7 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/MOVED b/MOVED
index 217f2fbec431..74793f35bf8c 100644
--- a/MOVED
+++ b/MOVED
@@ -17567,7 +17567,6 @@ net/libmms||2022-09-30|Has expired: Obsolete, Microsoft deprecated MMS protocol
 audio/mctoolame-decoder||2022-09-30|Has expired: Legacy and obscure audio format that never gained any traction
 audio/mctoolame-encoder||2022-09-30|Has expired: Legacy and obscure audio format that never gained any traction
 www/py-ws4py||2022-09-30|Has expired: Upstream abandoned
-ftp/axel||2022-09-30|Has expired: Last release in 2009 and dead upstream, please consider using www/aria2
 databases/py-bsddb3|databases/py-berkeleydb|2022-09-30|Has expired: Requires upstream EOLd db5. Use py-berkeleydb
 graphics/megapov|graphics/povray37|2022-10-01|Has expired: Abandoned upstream. graphics/povray37 is the recommended replacement
 x11-toolkits/gstreamer1-plugins-gtk4||2022-10-01|No consumers left and deprecated in favor gtk4 plugin from multimedia/gstreamer1-plugins-rust >= 0.8.0
@@ -17615,4 +17614,4 @@ net/rabbitmq-c-devel|net/rabbitmq-c|2022-11-16|Remove obsolete devel port, use n
 databases/foundationdb-devel|databases/foundationdb|2022-11-16|Remove obsolete devel port, use databases/foundationdb instead
 devel/py-pytest4-asyncio||2022-11-19|Has expired: legacy version for pytest4 no longer used by any port
 devel/tokamak||2022-11-20|Has expired: Last release in 2008, abandoned upstream, not used, website disappeared
-net/libutp|net-p2p/libutp|2022-11-19|Moved to a more adequated category
+net/libutp|net-p2p/libutp|2022-11-20|Moved to a more adequated category
diff --git a/ftp/Makefile b/ftp/Makefile
index d4f6166b7bfa..2ca7c730a9d9 100644
--- a/ftp/Makefile
+++ b/ftp/Makefile
@@ -2,6 +2,7 @@
 
     SUBDIR += R-cran-RCurl
     SUBDIR += R-cran-curl
+    SUBDIR += axel
     SUBDIR += bbftp-client
     SUBDIR += bbftp-server
     SUBDIR += bftpd
diff --git a/ftp/axel/Makefile b/ftp/axel/Makefile
new file mode 100644
index 000000000000..da01ca854cd0
--- /dev/null
+++ b/ftp/axel/Makefile
@@ -0,0 +1,33 @@
+PORTNAME=	axel
+DISTVERSIONPREFIX=	v
+DISTVERSION=	2.17.11-21
+DISTVERSIONSUFFIX=	-gd65dffa
+CATEGORIES=	ftp
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Lightweight CLI download accelerator
+WWW=		https://github.com/axel-download-accelerator/axel
+
+LICENSE=	GPLv2+
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+BUILD_DEPENDS=	autoconf-archive>=0:devel/autoconf-archive \
+		txt2man:textproc/txt2man
+
+USES=		autoreconf gettext-tools gmake pkgconfig ssl
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	axel-download-accelerator
+
+GNU_CONFIGURE=	yes
+
+.if exists(/usr/libdata/pkgconfig/openssl.pc)
+CONFIGURE_ARGS=	--with-ssl=openssl
+.else
+CONFIGURE_ARGS=	--without-ssl # no easy workaround
+.endif
+
+PLIST_FILES=	bin/axel \
+		man/man1/axel.1.gz
+
+.include <bsd.port.mk>
diff --git a/ftp/axel/distinfo b/ftp/axel/distinfo
new file mode 100644
index 000000000000..9a4086007e01
--- /dev/null
+++ b/ftp/axel/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1669338799
+SHA256 (axel-download-accelerator-axel-v2.17.11-21-gd65dffa_GH0.tar.gz) = f58501c4f82e1e9dbf085552387328eccb211fb1592fafae06582899cb0cfbdf
+SIZE (axel-download-accelerator-axel-v2.17.11-21-gd65dffa_GH0.tar.gz) = 101764
diff --git a/ftp/axel/files/patch-src_axel.c b/ftp/axel/files/patch-src_axel.c
new file mode 100644
index 000000000000..bbf0d24a4493
--- /dev/null
+++ b/ftp/axel/files/patch-src_axel.c
@@ -0,0 +1,11 @@
+--- src/axel.c.orig	2022-11-25 02:14:41 UTC
++++ src/axel.c
+@@ -151,7 +151,7 @@ axel_new(conf_t *conf, int count, const search_t *res)
+ 			axel->conf->buffer_size = axel->conf->max_speed;
+ 		}
+ 		uint64_t delay =
+-			UINT64_C(1073741824) * axel->conf->buffer_size *
++			((uint64_t)1073741824) * axel->conf->buffer_size *
+ 			axel->conf->num_connections / axel->conf->max_speed;
+ 
+ 		axel->delay_time.tv_sec  = delay / 1073741824;
diff --git a/ftp/axel/files/patch-src_random.c b/ftp/axel/files/patch-src_random.c
new file mode 100644
index 000000000000..57fdefa7ace5
--- /dev/null
+++ b/ftp/axel/files/patch-src_random.c
@@ -0,0 +1,11 @@
+--- src/random.c.orig	2022-11-25 01:30:10 UTC
++++ src/random.c
+@@ -6,7 +6,7 @@
+ ssize_t
+ axel_rand64(uint64_t *out)
+ {
+-	static int fd = -1;
++	static atomic_int fd = -1;
+ 	if (fd == -1) {
+ 		int tmp = open("/dev/random", O_RDONLY);
+ 		int expect = -1;
diff --git a/ftp/axel/pkg-descr b/ftp/axel/pkg-descr
new file mode 100644
index 000000000000..c98c5a051b3d
--- /dev/null
+++ b/ftp/axel/pkg-descr
@@ -0,0 +1,7 @@
+Axel tries to accelerate the download process by using multiple connections per
+file, and can also balance the load between different servers.
+
+Axel tries to be as light as possible, so it might be useful on byte-critical
+systems.
+
+Axel supports HTTP, HTTPS, FTP and FTPS protocols.