Skip to content

Commit

Permalink
restore aria2 1.36.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpdboy authored Jan 16, 2024
1 parent 44ff65f commit f5079c7
Show file tree
Hide file tree
Showing 17 changed files with 2,659 additions and 0 deletions.
83 changes: 83 additions & 0 deletions aria2/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
menu "Aria2 Configuration"
depends on PACKAGE_aria2

choice
prompt "SSL Library"
default ARIA2_OPENSSL

config ARIA2_OPENSSL
bool "OpenSSL"

config ARIA2_GNUTLS
bool "GnuTLS"

config ARIA2_NOSSL
bool "No SSL Support"

endchoice

choice
prompt "Crypto Library"
depends on !ARIA2_OPENSSL
default ARIA2_NOCRYPTO

config ARIA2_NETTLE
bool "Nettle"

config ARIA2_LIBGCRYPT
bool "Libgcrypt"

config ARIA2_NOCRYPTO
bool "No Crypto Library"

endchoice

choice
prompt "XML Library"
default ARIA2_NOXML

config ARIA2_LIBXML2
bool "Libxml2"

config ARIA2_EXPAT
bool "Expat"

config ARIA2_NOXML
bool "No XML Library"

endchoice

config ARIA2_GMP
bool "GNU Multiple Precision Arithmetic Library"
depends on ARIA2_NETTLE
default n

config ARIA2_BITTORRENT
bool "Enable Bittorrent Support"
depends on ARIA2_OPENSSL || ARIA2_LIBGCRYPT || \
(ARIA2_NETTLE && ARIA2_GMP)
default y

config ARIA2_METALINK
bool "Enable Metalink Support"
depends on !ARIA2_NOXML
default y

config ARIA2_SFTP
bool "Enable SFTP Support"
default y

config ARIA2_ASYNC_DNS
bool "Enable Async DNS Support"
default y

config ARIA2_COOKIE
bool "Enable Firefox3/Chromium Cookie Support"
default y

config ARIA2_WEBSOCKET
bool "Enable JSON-RPC over WebSocket Support"
depends on ARIA2_OPENSSL || ARIA2_LIBGCRYPT || ARIA2_NETTLE
default y

endmenu
122 changes: 122 additions & 0 deletions aria2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#
# Copyright (C) 2012-2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

PKG_NAME:=aria2
PKG_VERSION:=1.36.0
PKG_RELEASE:=21

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_VERSION)/
PKG_HASH:=skip
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

PKG_MAINTAINER:=Imre Kaloz <[email protected]>, \
Hsing-Wang Liao <[email protected]>
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:tatsuhiro_tsujikawa:aria2

PKG_CONFIG_DEPENDS := \
CONFIG_ARIA2_NOSSL \
CONFIG_ARIA2_OPENSSL \
CONFIG_ARIA2_GNUTLS \
CONFIG_ARIA2_NOCRYPTO \
CONFIG_ARIA2_NETTLE \
CONFIG_ARIA2_LIBGCRYPT \
CONFIG_ARIA2_LIBXML2 \
CONFIG_ARIA2_EXPAT \
CONFIG_ARIA2_GMP \
CONFIG_ARIA2_BITTORRENT \
CONFIG_ARIA2_METALINK \
CONFIG_ARIA2_SFTP \
CONFIG_ARIA2_ASYNC_DNS \
CONFIG_ARIA2_COOKIE \
CONFIG_ARIA2_WEBSOCKET

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk

define Package/aria2/config
source "$(SOURCE)/Config.in"
endef

define Package/aria2
SECTION:=net
CATEGORY:=Network
SUBMENU:=File Transfer
TITLE:=lightweight download utility
URL:=https://aria2.github.io/
DEPENDS:=+zlib +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls \
+ARIA2_NETTLE:libnettle +ARIA2_LIBGCRYPT:libgcrypt +ARIA2_GMP:libgmp \
+ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +ARIA2_SFTP:libssh2 \
+ARIA2_ASYNC_DNS:libcares +ARIA2_COOKIE:libsqlite3
USERID:=aria2=6800:aria2=6800
endef

define Package/aria2/description
aria2 is a lightweight multi-protocol & multi-source command-line download
utility
endef

CONFIGURE_ARGS += \
--disable-nls \
$(if $(CONFIG_ARIA2_NOSSL),--disable,--enable)-ssl \
$(if $(CONFIG_ARIA2_BITTORRENT),--enable,--disable)-bittorrent \
$(if $(CONFIG_ARIA2_METALINK),--enable,--disable)-metalink \
$(if $(CONFIG_ARIA2_WEBSOCKET),--enable,--disable)-websocket \
$(if $(CONFIG_ARIA2_OPENSSL),--with,--without)-openssl \
$(if $(CONFIG_ARIA2_GNUTLS),--with,--without)-gnutls \
$(if $(CONFIG_ARIA2_NETTLE),--with,--without)-libnettle \
$(if $(CONFIG_ARIA2_LIBGCRYPT),--with,--without)-libgcrypt \
$(if $(CONFIG_ARIA2_GMP),--with,--without)-libgmp \
$(if $(CONFIG_ARIA2_LIBXML2),--with,--without)-libxml2 \
$(if $(CONFIG_ARIA2_EXPAT),--with,--without)-libexpat \
$(if $(CONFIG_ARIA2_SFTP),--with,--without)-libssh2 \
$(if $(CONFIG_ARIA2_ASYNC_DNS),--with,--without)-libcares \
$(if $(CONFIG_ARIA2_COOKIE),--with,--without)-sqlite3 \
--without-libuv \
--with-libz

TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto
TARGET_LDFLAGS += -Wl,--gc-sections -flto

define Package/aria2/conffiles
/etc/config/aria2
endef

define Download/aria2.conf
URL:=https://github.com/P3TERX/aria2.conf/archive
URL_FILE:=master.zip
FILE:=aria2.conf
HASH:=skip
endef

define Build/Prepare
$(call Build/Prepare/Default)
unzip $(DL_DIR)/aria2.conf -d $(PKG_BUILD_DIR)/
sed -i '/rpc-secret/d' $(PKG_BUILD_DIR)/aria2.conf-master/*
endef


define Package/aria2/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aria2c $(1)/usr/bin

$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/aria2.init $(1)/etc/init.d/aria2

$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/aria2.conf $(1)/etc/config/aria2

$(INSTALL_DIR) $(1)/usr/share/aria2
$(INSTALL_BIN) $(PKG_BUILD_DIR)/aria2.conf-master/* $(1)/usr/share/aria2/
endef

$(eval $(call Download,aria2.conf))
$(eval $(call BuildPackage,aria2))
23 changes: 23 additions & 0 deletions aria2/files/aria2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# You can use most aria2 command-line options, replace '-' with '_'.
# eg. 'rpc-secret' ==> 'rpc_secret'
#
# We do not support all options at this time. But you can add any option
# with 'list extra_settings'.
#
# You can also add new config sections to define multi instance.
#
config aria2 'main'
option enabled '0'
option user 'aria2'
option dir '/mnt/sda1/aria2'
option config_dir '/var/etc/aria2'
option bt_enable_lpd 'true'
option enable_dht 'true'
option follow_torrent 'true'
option file_allocation 'none'
option save_session_interval '30'
option split '128'
option min_split_size '100K'
option max_connection_per_server '128'
list extra_settings 'dht-file-path=/usr/share/aria2/dht.dat'
Loading

0 comments on commit f5079c7

Please sign in to comment.