Browse Source

Merge pull request #2756 from kuoruan/packages-master

aria2: update to 1.23.0
lilik-openwrt-22.03
Hannu Nyman 9 years ago
parent
commit
2edfc807a6
4 changed files with 118 additions and 9 deletions
  1. +13
    -0
      net/aria2/Config.in
  2. +17
    -9
      net/aria2/Makefile
  3. +10
    -0
      net/aria2/files/aria2.conf
  4. +78
    -0
      net/aria2/files/aria2.init

+ 13
- 0
net/aria2/Config.in View File

@ -25,4 +25,17 @@ config ARIA2_METALINK
bool "Enable metalink support"
default N
choice
prompt "XML library"
default ARIA2_EXPAT
depends on ARIA2_METALINK
config ARIA2_EXPAT
bool "EXPAT"
config ARIA2_LIBXML2
bool "LIBXML2"
endchoice
endmenu

+ 17
- 9
net/aria2/Makefile View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2012-2014 OpenWrt.org
# Copyright (C) 2012-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -7,15 +7,15 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=aria2
PKG_VERSION:=1.18.7
PKG_VERSION:=1.23.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/aria2
PKG_MD5SUM:=36e92af92b4370817c577ed802546842
PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_VERSION)/
PKG_MD5SUM:=bc41d919e7d89835ee01c1175300eddc
PKG_INSTALL:=1
PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, Hsing-Wang Liao <kuoruan@gmail.com>
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING
@ -24,7 +24,9 @@ PKG_CONFIG_DEPENDS := \
ARIA2_OPENSSL \
ARIA2_GNUTLS \
ARIA2_BITTORRENT \
ARIA2_METALINK
ARIA2_METALINK \
ARIA2_EXPAT \
ARIA2_LIBXML2
include $(INCLUDE_DIR)/package.mk
@ -38,7 +40,7 @@ define Package/aria2
SUBMENU:=File Transfer
TITLE:=lightweight download utility
URL:=http://aria2.sourceforge.net/
DEPENDS:=+zlib +ARIA2_METALINK:libxml2 +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls
DEPENDS:=+zlib +ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls
endef
define Package/aria2/description
@ -53,11 +55,11 @@ CONFIGURE_ARGS += \
$(if $(CONFIG_ARIA2_GNUTLS),--with,--without)-gnutls \
$(if $(CONFIG_ARIA2_BITTORRENT),--enable,--disable)-bittorrent \
$(if $(CONFIG_ARIA2_METALINK),--enable,--disable)-metalink \
$(if $(CONFIG_ARIA2_METALINK),--with,--without)-libxml2 \
$(if $(CONFIG_ARIA2_LIBXML2),--with,--without)-libxml2 \
$(if $(CONFIG_ARIA2_EXPAT),--with,--without)-libexpat \
--without-libnettle \
--without-libgmp \
--without-libgcrypt \
--without-libexpat \
--without-libcares \
--without-sqlite3 \
--with-libz
@ -65,6 +67,12 @@ CONFIGURE_ARGS += \
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
endef
$(eval $(call BuildPackage,aria2))

+ 10
- 0
net/aria2/files/aria2.conf View File

@ -0,0 +1,10 @@
config aria2 'main'
option enabled '0'
option file_allocation 'none'
option bt_enable_lpd 'true'
option enable_dht 'true'
option follow_torrent 'true'
option user 'root'
option dir '/mnt/sda1'
option save_session_interval '30'

+ 78
- 0
net/aria2/files/aria2.init View File

@ -0,0 +1,78 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2014-2016 nanpuyue <nanpuyue@gmail.com>
START=99
SERVICE_WRITE_PID=1
SERVICE_DAEMONIZE=1
append_params() {
local p; local v; local s="$1"; shift
for p in $*; do
config_get v "$s" "$p"
[ -n "$v" ] && (
p=$(echo "$p" | sed -e 's|_|-|g');
echo "$p=$v" >> $config_file
)
done
}
section_enabled() {
local result
config_get_bool result "$1" 'enabled' 0
[ $result -eq 1 ]
}
option_disabled() {
local result
config_get_bool result "$1" "$2" 1
[ $result -eq 0 ]
}
start_instance() {
local s="$1"
local user
section_enabled "$s" || return 1
config_get config_dir "$s" 'config_dir' '/var/etc/aria2'
config_get user "$s" 'user'
config_file="$config_dir/aria2.conf"
session_file="$config_dir/aria2.session"
dht_file="$config_dir/dht.dat"
[ -d "$config_dir" ] || {
mkdir -m 0755 -p "$config_dir"
touch "$config_file"
[ -z "$user" ] || chown -R $user $config_dir
}
touch "$session_file"
echo -e "enable-rpc=true\nrpc-allow-origin-all=true\nrpc-listen-all=true\nquiet=true" > $config_file
echo -e "continue=true\ninput-file=$session_file\nsave-session=$session_file" >> $config_file
option_disabled "$s" 'enable_dht' || echo "dht-file-path=$dht_file" >> $config_file
append_params "$s" \
file_allocation bt_enable_lpd enable_dht rpc_user rpc_passwd rpc_listen_port dir bt_tracker disk_cache \
max_overall_download_limit max_overall_upload_limit max_download_limit max_upload_limit max_concurrent_downloads \
max_connection_per_server min_split_size split save_session_interval follow_torrent listen_port bt_max_peers \
peer_id_prefix user_agent rpc_secret
config_list_foreach "$s" extra_settings append_extrasettings
SERVICE_UID="$user" \
service_start /usr/bin/aria2c --conf-path="$config_file"
}
append_extrasettings() {
echo "$1" >> $config_file
}
start() {
config_load 'aria2'
config_foreach start_instance 'aria2'
}
stop() {
service_stop /usr/bin/aria2c
}

Loading…
Cancel
Save