|
|
小鬼子的aria2作的非常不错,但有着5条线程的限制,在其Feature requests页面上的相关呼吁似乎也没啥作用。 新的aria2-0.10.2+1有所改动,不象0.10.1在src/main.cc里很明显,下面简单写下deb打包过程,利用了cdbs,只简单启用了dpatch,因为没多余的doc等要复制,cdbs也就没啥特別要注意的地方,希望对用得着的有所参考。另外,没去管相应的man和po中的5条线程的信息
1 到其主站下载 aria2-0.10.2+1
http://aria2.sourceforge.net/
2 移至临时目录开始打包
- cd /dev/shm
- tar xvf /tmp/aria2-0.10.2+1.tar.bz2
- cd aria2-0.10.2+1
- dh_make -e test@test.org -b -n
复制代码
3 进入 debian 目录下,删除*.ex等不用的东东,删除dirs文件中usr/sbin的行,最后只保留
changelog compat control dirs docs rules
同时为提高打完后包的优先级,来修改下changelog
- aria2 (1:0.10.2+2) unstable; urgency=low
- * Initial Release.
- -- test <test@test.org> Sun, 1 Apr 2007 22:42:23 +0800
复制代码
修改下control
- Source: aria2
- Section: utils
- Priority: extra
- Maintainer: test <test@test.org>
- Build-Depends: cdbs, cdbs, debhelper (>= 5), autotools-dev
- Standards-Version: 3.7.2
- Package: aria2
- Architecture: any
- Depends: ${shlibs:Depends}
- Description: High speed download utility
- Aria2 is a command line download client with resuming and segmented
- downloading. Supported protocols are HTTP/HTTPS/FTP/BitTorrent and it also
- supports Metalink.
- .
- Homepage: <http://aria2.sourceforge.net/>
复制代码
修改下rules,启用dpatch
- #!/usr/bin/make -f
-
- include /usr/share/cdbs/1/rules/debhelper.mk
- include /usr/share/cdbs/1/class/autotools.mk
- # Add here any variable or target overrides you need.
- include /usr/share/cdbs/1/rules/dpatch.mk
- build: build-stamp patch
复制代码
利用dpatch-edit-patch创建10_fix-split-number.dpatch
- dpatch-edit-patch 10_fix-split-number
复制代码
这样就会自动进入/tmp下的临时目录,进入其下的src目录,分別修改main.cc和OptionHandlerFactory.cc,相应的diff如下
- --- main.cc-ori
- +++ main.cc
- @@ -120,7 +120,7 @@
- " log is written to stdout.") << endl;
- cout << _(" -D, --daemon Run as daemon.") << endl;
- cout << _(" -s, --split=N Download a file using N connections. N must be\n"
- - " between 1 and 5. This option affects all URLs.\n"
- + " between 1 and 100. This option affects all URLs.\n"
- " Thus, aria2 connects to each URL with\n"
- " N connections.\n"
- " Default: 1") << endl;
- --- OptionHandlerFactory.cc-ori
- +++ OptionHandlerFactory.cc
- @@ -77,7 +77,7 @@
- handlers.push_back(new DefaultOptionHandler(PREF_DIR));
- handlers.push_back(new DefaultOptionHandler(PREF_OUT));
- handlers.push_back(new LogOptionHandler(PREF_LOG));
- - handlers.push_back(new NumberOptionHandler(PREF_SPLIT, 1, 5));
- + handlers.push_back(new NumberOptionHandler(PREF_SPLIT, 1, 100));
- handlers.push_back(new NumberOptionHandler(PREF_TIMEOUT, 1, 600));
- handlers.push_back(new NumberOptionHandler(PREF_MAX_TRIES, 0));
- handlers.push_back(new BooleanOptionHandler(PREF_FTP_PASV));
复制代码
改完后,exit退出后会自动建立debian/patches/10_fix-split-number.dpatch
将 10_fix-split-number.dpatch 加入00list
- echo 10_fix-split-number.dpatch > debian/patches/00list
复制代码
OK,开始打包
- fakeroot debian/rules binary
复制代码
完了后
sudo dpkg -i aria2_0.10.2+1-2_i386.deb
最后,测试下
aria2c -s 8 http://... |
|