aria2的源码来自于
http://sourceforge.net/projects/aria2/files/stable/
我们这里以aria2-1.17.1版本为例下载的源码格式为aria2-1.17.1.tar.bz2
aria2的依赖安装
很多人没安装这依赖编译时会报错的
1
2
|
sudo apt-
get
update
sudo apt-
get
install autoconf automake libcppunit-dev autopoint openssl libtool sphinx-common sphinxsearch libgcrypt11-dev libxml2-dev pkg-config
|
开始集成aria2c
首先把下载下来的aria2-1.17.1.tar.bz2放进openwrt源码根目录的dl目录
获取md5码
ctrl+alt+T弹出终端输入
1
|
md5sum /……/……/trunk/dl/aria2-
1.17
.
1
.tar.bz2 省略好代表openwrt的源码的路径补全,回车就能获取md5码,记住用用的
|
在/feeds/packages/net/aria2/路径下创建aria2c源码的makefile文件内容如下 (make文件及其他本文需要文件见文章最下方)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#
# Copyright (C)
2012
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.17
.
1
PKG_RELEASE:=
1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=
PKG_MD5SUM:=86229ef8d289893934cb3af25c8fddf6
PKG_INSTALL:=
1
include
$(INCLUDE_DIR)/
package
.mk
define Package/aria2
SECTION:=net
CATEGORY:=Network
SUBMENU:=File Transfer
TITLE:=lightweight download utility
URL:=http:
//aria2.sourceforge.net/
DEPENDS:=+libopenssl +zlib +libxml2 +libstdcpp \
$(INTL_DEPENDS) $(ICONV_DEPENDS)
endef
define Package/aria2/description
aria2
is
a lightweight multi-protocol & multi-source command-line download
utility
endef
define Package/aria2/conffiles
/etc/config/aria2
endef
CONFIGURE_ARGS += \
--disable-nls \
--without-gnutls \
--without-libnettle \
--without-libgmp \
--without-libgcrypt \
--without-libexpat \
--without-libcares \
--without-sqlite3 \
--
with
-openssl \
--
with
-libxml2 \
--
with
-libz
CONFIGURE_VARS += \
ZLIB_CFLAGS=
"-I$(STAGING_DIR)/usr/include"
\
ZLIB_LIBS=
"-L$(STAGING_DIR)/usr/lib"
define Package/aria2/install
$(INSTALL_DIR) $(
1
)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aria2c $(
1
)/usr/bin
endef
$(eval $(call BuildPackage,aria2))
|
在feeds目录下面找到packages.index索引文件,添加aria2源码索引记录
双击打开packages.index,在任意位置添加如下代码
双击打开packages.index,在任意位置添加如下代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Source-Makefile: feeds/packages/net/aria2/Makefile
Package: aria2
Submenu: File Transfer
Version:
1.17
.
1
-
1
Depends: +libc +USE_EGLIBC:librt +USE_EGLIBC:libpthread +libopenssl +zlib +libxml2 +libstdcpp
Menu-Depends:
Provides:
Section: net
Category: Network
Title: lightweight download utility
Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
Source: aria2-
1.17
.
1
.tar.bz2
Type: ipkg
Description: aria2
is
a lightweight multi-protocol & multi-source command-line download
utility
http:
//aria2.sourceforge.net/
OpenWrt Developers Team <openwrt-devel@openwrt.org>
@@
|
到这里aria2算是添加完了,用命令还可以使用,没luci界面是有点不方便,下面完美来添加luci-aria2
添加luci-aria2
文章末有我上传的luci-aria2的源码文件,下载下来后放到你的luci响应的目录,版本不宜样目录可能不宜样
文章末有我上传的luci-aria2的源码文件,下载下来后放到你的luci响应的目录,版本不宜样目录可能不宜样
trunk版本为例
把luci-aria2这个文件夹放进/trunk/feeds/luci/applications/这个目录里面
然后在trunk/feeds/目录下找到luci.index 这个索引文件,打开在任意位置添加如下代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
Package: luci-app-aria2
Submenu:
3
. Applications
Version:
0.11
+svk-
1
Depends: +libc +USE_EGLIBC:librt +USE_EGLIBC:libpthread +PACKAGE_luci-app-aria2:aria2
Menu-Depends:
Provides:
Build-Depends: lua/host
Section: luci
Category: LuCI
Title: aria2 configuration module
Maintainer: LuCI Development Team <luci@lists.subsignal.org>
Source:
Type: ipkg
Description: aria2 configuration module http:
//luci.subsignal.org/ LuCI Development Team <luci@lists.subsignal.org>
@@
|
保存退出即可
到这里就集成完了
最后在终端执行
1
2
|
./scripts/feeds install -a
make menuconfig
|
make menuconfig
就可以在luci>3. Applications 找到 luci-app-aria2了