Import Upstream version 2.5

parent 1f232dc5
Version 2.5, 2015-11-01
[ Joao Eriberto Mota Filho ] 2015-11-01
* Changed the homepage of the project in several files.
* axel.h: bumped to 2.5 version.
* configure:
- Changed the default prefix to /usr.
- Changed the default etc path to /etc.
- Changed CFLAGS and LDFLAGS definition lines to allow external values,
as GCC hardening sent by Debian.
* gui/: removed. The binary axel-kapt depended on kaptain that is no longer
available for QT5 (dead upstream development). For details, see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=789819
* http.c: fix a possible buffer overflow.
* Makefile: disabled the .po regeneration/merge actions to avoid changes in
source code when building. I will try to fix it in future.
* manpage:
- Moved to man/ directory.
- Using txt2man to generate the manpage.
- Updated the manpage.
- Removed some typos.
- Dropped the Chinese manpage (outdated now).
* README.md: added to be the main file for GitHub.
* README.to-contribute: added to explain how to contribute.
[ Barry deFreese ] 2009-06-11
* Added Hurd (GNU) to configure file. It will allow Axel to build over
GNU/Hurd. This change was provided by Barry deFreese <bdefreese@debian.org>,
as a patch to Debian project, on 11 Jun 2009. For details, see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532793
[ Mark Smith ] 2010-07-03
* Added a support to IPv6. This change was provided by
Mark Smith <nanog@85d5b20a518b8f6864949bd940457dc124746ddc.nosense.org>,
as a patch to Debian project, on 03 Jul 2010. For details, see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525290
[ unknown person ] 2010-08-19
* Fixed incorrect unit of time in download summary. For details see
https://alioth.debian.org/tracker/index.php?func=detail&aid=312669&group_id=100070&atid=413085
[ unknown person ] 2011-04-12
* Fixed an issue that produces a Bad HTTP Request when 302 redirected link is
longer than 255 chars (like youtube). For details, see
https://alioth.debian.org/tracker/index.php?func=detail&aid=313080&group_id=100070&atid=413085
[ Osamu Aoki ] 2012-03-10
* Added the translation to Japanese. See
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=663286 and
https://alioth.debian.org/tracker/index.php?func=detail&aid=313565&group_id=100070&atid=413085
* Changed the configure file to honor the noopt when building. So, was removed
the '-Os' option. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=645271
[ From original authors ]
* Releasing this old block (written after 2.4 and before 2.5 versions):
- Make axel build on HP-UX, thanks Ciro Iriarte
- Fix Solaris support (Closes: #312092), thanks Sebastian Kayser
- Add PO-Revision-Date header to ru.po
Version 2.4
- Fix a buffer overflow caused by wrong size limits when copying strings (Closes: #311569), thanks Michael Schwendt and the Fedora project members
......
2.5 version:
- Barry deFreese <bdefreese@debian.org>
Build over GNU/Hurd.
- Mark Smith <nanog@85d5b20a518b8f6864949bd940457dc124746ddc.nosense.org>
IPv6 support.
- Osamu Aoki <osamu@debian.org>
Added translation to Japanese.
Honor noopt when buildind.
Up to the 2.4 version:
An not-quite-sorted list of people who helped somehow:
- Philipp Hagemeister <ubuntu@phihag.de>
......@@ -43,7 +58,7 @@ An not-quite-sorted list of people who helped somehow:
- Paul Evans <pevans@users.sourceforge.net>
For being a very good beta tester.
For creating axel-kapt.
For creating axel-kapt. (deprected in 2.5 version, see the CHANGES file)
- Justin A <justin@bouncybouncy.net>
For some testing and for the new (multi-URL) syntax idea.
......
......@@ -4,27 +4,20 @@
## Copyright 2001 Lintux ##
###########################
### DEFINITIONS
-include Makefile.settings
.SUFFIXES: .po .mo
# Add your translation here..
MOFILES = nl.mo de.mo ru.mo zh_CN.mo
# Add your translation here
MOFILES = nl.mo de.mo ru.mo zh_CN.mo ja.mo
all: $(OUTFILE)
install: install-bin install-etc install-man
uninstall: uninstall-bin uninstall-etc uninstall-man
ifdef I18N
all: $(MOFILES)
install: install-i18n
uninstall: uninstall-i18n
endif
clean:
rm -f *.o $(OUTFILE) search core *.mo
......@@ -33,13 +26,10 @@ distclean: clean
install-man:
mkdir -p $(DESTDIR)$(MANDIR)/man1/
cp axel.1 $(DESTDIR)$(MANDIR)/man1/axel.1
mkdir -p $(DESTDIR)$(MANDIR)/zh_CN/man1/
cp axel_zh_CN.1 $(DESTDIR)$(MANDIR)/zh_CN/man1/axel.1
cp man/axel.1 $(DESTDIR)$(MANDIR)/man1/axel.1
uninstall-man:
rm -f $(MANDIR)/man1/axel.1
rm -f $(MANDIR)/zh_CN/man1/axel.1
install-etc:
mkdir -p $(DESTDIR)$(ETCDIR)/
......@@ -51,13 +41,11 @@ uninstall-etc:
### MAIN PROGRAM
$(OUTFILE): axel.o conf.o conn.o ftp.o http.o search.o tcp.o text.o
$(CC) *.o -o $(OUTFILE) $(LFLAGS)
ifndef DEBUG
-$(STRIP) $(OUTFILE)
endif
$(CC) *.o -o $(OUTFILE) $(LFLAGS) $(LDFLAGS) $(CPPFLAGS)
$(STRIP) $(OUTFILE)
.c.o:
$(CC) -c $*.c -o $*.o -Wall $(CFLAGS)
$(CC) -c $*.c -o $*.o $(CFLAGS) $(LDFLAGS) $(CPPFLAGS)
install-bin:
mkdir -p $(DESTDIR)$(BINDIR)/
......@@ -67,27 +55,33 @@ uninstall-bin:
rm -f $(BINDIR)/$(OUTFILE)
tar:
version=$$(sed -n 's/#define AXEL_VERSION_STRING[ \t]*"\([^"]*\)"/\1/p' < axel.h) && \
tar --create --transform "s#^#axel-$${version}/#" "--file=axel-$${version}.tar" --exclude-vcs -- *.c *.h *.po *.1 configure Makefile axelrc.example gui API CHANGES COPYING CREDITS README && \
version=`sed -n 's/#define AXEL_VERSION_STRING[ \t]*"\([^"]*\)"/\1/p' < axel.h` && \
tar --create --numeric-owner --owner 0 --group 0 --transform "s#^#axel-$${version}/#" "--file=axel-$${version}.tar" --exclude-vcs -- *.c *.h *.po *.1 configure Makefile axelrc.example gui API CHANGES COPYING CREDITS README && \
gzip --best < "axel-$${version}.tar" > "axel-$${version}.tar.gz" && \
bzip2 --best < "axel-$${version}.tar" > "axel-$${version}.tar.bz2"
### I18N FILES
%.po:
-@mv $@ $@.bak
xgettext -k_ -o$@ *.[ch]
@if [ -e $@.bak ]; then \
echo -n Merging files...; \
msgmerge -vo $@.combo $@.bak $@; \
rm -f $@ $@.bak; \
mv $@.combo $@; \
fi
# The following target is generating changes in original source code when
# building. It will be temporally disabled. I will fix/change/optimize it
# in future.
#
#%.po: $(wildcard *.c *.h)
# -@mv $@ $@.bak
# xgettext -k_ -o$@ *.[ch]
# @if [ -e $@.bak ]; then \
# echo -n Merging files...; \
# msgmerge -vo $@.combo $@.bak $@; \
# rm -f $@ $@.bak; \
# mv $@.combo $@; \
# fi
.po.mo: $@.po
msgfmt -vo $@ $*.po
i18n-mofiles: $(MOFILES)
install-i18n:
@echo Installing locale files...
@for i in $(MOFILES); do \
......
Axel Home:
See http://axel.alioth.debian.org/ for latest information on axel
See https://github.com/eribertomota/axel for latest information on axel
/*************************\
* Supported architectures *
\*************************/
Should compile on any decent Linux system. Additionaly, it should compile
Should compile on any decent Linux system. Additionally, it should compile
(and run) on BSD, Solaris, Darwin (Mac OS X) and Win32 (Cygwin) systems.
If the configure script does weird things on your system, please do warn me!
......
# AXEL
**Light command line download accelerator for Linux and Unix**
<br><br>
**1. HELP THIS PROJECT**<br>
**2. WHAT IS AXEL?**
--------------------
1. HELP THIS PROJECT
--------------------
Axel needs your help. **If you are a programmer** and if you wants to
help a nice project, this is your opportunity.
My name is Eriberto and **I am not a C developer**. I imported Axel from
its old repository[1] to GitHub (the original homepage and developers
are inactive). After this, I applied all patches found in Debian project
and other places for this program. All my initial work was registered in
CHANGES file (version 2.5). I also maintain Axel packaged in Debian[2].
If you are interested to help Axel, read the README.to-contribute[3] file.
[1] https://alioth.debian.org/projects/axel<br>
[2] https://packages.qa.debian.org/a/axel.html<br>
[3] https://github.com/eribertomota/axel/blob/master/README.to-contribute
----------------
2. WHAT IS AXEL?
----------------
Axel tries to accelerate the downloading process by using multiple
connections for one file, similar to DownThemAll and other famous
programs. It can also use multiple mirrors for one download.
Using Axel, you will get files faster from Internet. So, Axel can
speed up a download up to 60% (approximately, according to some tests).
Axel tries to be as light as possible, so it might be useful as a
wget clone (and other console based programs) on byte-critical systems.
Axel was originally developed by Wilmer van der Gaast. Thanks for your
efforts. Over time, Axel got several contributions from people. Please,
see the file CREDITS.
HOW TO CONTRIBUTE TO AXEL DEVELOPMENT
If you are interested to contribute to axel development, please, follow these
steps:
1. Send a patch that fix an issue or that implement a new feature.
2. Ask for join to the Axel project in GitHub, if you want to work officially.
Note that this second step isn't compulsory.
To find issues and bugs to fix, you can check these addresses:
- https://github.com/eribertomota/axel/issues
- https://alioth.debian.org/tracker/?atid=413085&group_id=100070&func=browse
(ALIOTH IS THE OLD HOMEPAGE, BUT HAS OPENED BUGS)
- https://bugs.debian.org/cgi-bin/pkgreport.cgi?dist=unstable;package=axel
- https://bugs.launchpad.net/ubuntu/+source/axel/+bugs
- https://apps.fedoraproject.org/packages/axel/bugs
- https://bugs.archlinux.org/?project=5&cat[]=33&string=axel
- https://bugs.gentoo.org/buglist.cgi?quicksearch=net-misc%2Faxel
If you want to join, please contact me: eriberto at eriberto.pro.br
Roadmap for Axel v2
===================
* Check if strrstr is provided by environment
* Use SI prefixes
Roadmap for Axel v3
===================
Note: This document provides only a rough overview what to do next. Refer to the bugtracker ( https://github.com/eribertomota/axel/issues ) for detailled information.
Pre-release version numbers of Axel 3 will start with 2.99. Starting with the 3.x series, the following version scheme will be adopted:
x.y.z
x: Complete overhaul of the code structure
y: New features and/or speed/size improvements
z: Bug fixed
Features
========
* HTTP authentication (#310785)
This is actually already implemented and should be documented. Using -H is possible, too.
* Metalink (#310625)
Basic Metalink support should not be that difficult. However, it will only be compiled if METALINK is defined. Metalink support will require libxml2. As libmetalink is currently unusable for us (private symbols), we'll implement the format ourselves.
* .netrc (#310635)
There are lots of GPLed implementations flying around. To minimize code size, it shouldn't be compiled in by default if the code exceeds a couple of bytes. Anyway, it's just one call from Axel's point of view.
* Prevent connection to same server (#310638)
See tcp.c below for the implementation (aside from a flag in the configuration and a cli flag).
* Force overriding state file (#311022)
Shouldn't be difficult and take more than a couple of bytes.
* SSL protocols (HTTPS, FTPS) (#311163)
* Parse Content-Disposition header (#311101)
Look if the specific problem mentioned in the bug is fixed by this.
Code structure
==============
* conn.c
needs cleanup, possibly even elimination. Most functions look like
if (ftp && !proxy) {
// ... do FTP stuff (15 lines)
} else {
// ... do HTTP stuff (20 lines)
}
We should at least abstract the switch between HTTP and FTP and look what can be done about simplifiying and documenting the functions here.
Furthermore, redirecting should be cached somehow/done only once lest we reach the redirect limit because it's less than -n.
* tcp.c
should be checked. The functions look a little bit obscure to me. But maybe, that's just me. Before we implement #310638, we should include some round-robin trickery in here.
* Removing MAX_STRING(#311085) and MAX_ADD_HEADERS. These are arbitrary restrictions and may hide a number of strange bugs. Furthermore, statically sized fields are a waste of memory.
* Add die messages: Axel must not exit with != 0 without telling why.
* Add debugging messages: When compiled with DEBUG, Axel could be more verbose. This won't harm anything and may serve as comments.
* Some functions could use a little bit of documentation.
* Remove all logic from text.c
* Ensure correct synchronization of thread state (volatile?)
* Cleanup AXEL_LEGACY
* rewrite axel-kapt to be sane (probably sh, or even #!/usr/bin/env kaptain suffices) or remove it in favor of a sane GUI
Bugs
====
We're gonna fix them all!
#310979 seems pretty vague.
Check spaces in FTP and HTTP URLs
(User) Documentation
====================
* As previously mentioned, authentication should be documented.
* Update API
3.1
===
* Cookies (#310835)
Can be implemented via -H. The bug called for reading the Netcape-style cookies.txt (Wget's --load--cokies option). Domain-specific cookies could be rather complex to implement. If the implementation of this feature costs more than 100B, it should be deselectable.
* Rate-limit status messages (#TODO)
* Don't discard first HTTP connection, but use it adaptively (start requests from the end, RST as soon as first task is fullfilled)
* A -1 option: Just make one request, and only one.
* IPv6 support
3.2
===
* Write a macro ERROR_MESSAGE(msg) (msg), enclose all _("some long error message") and offer a compilation option for a single error message, see if that yields any size improvements
* Check compilation with dietlibc(http://www.fefe.de/dietlibc/) and uclibc(http://www.uclibc.org/):
· How to compile with these libraries
· Does this actually improve the binary size?
· Check warnings/suggestions
* valgrind and friends
* Test very large -n values. Check pthread thread stack size.
Future/Ideas
============
* Real FTPS (AUTH)?
* Allow downloading to /dev/null for debugging or speed test purposes (Statefile in memory or so)
* Desktop integration, look who likes download accelerators
* Check the syscalls we make. Check whether timing and read() calls can be optimized
* Write automated tests to test all these nifty corner cases. Either a test webserver or LD_PRELOAD injection of all syscalls (see libfake*)
* Write a helper script that displays the final binary size for different configurations to determine what a particular feature costs
* Document and implement coding conventions, versioning scheme
When updating, change these files (if needed):
- AUTHORS
- CHANGES
- CREDITS
- axel.h (AXEL_VERSION_STRING)
.\"
.\"man-page for Axel
.\"
.\"Derived from the man-page example in the wonderful book called Beginning
.\"Linux Programming, written by Richard Stone and Neil Matthew.
.\"
.TH AXEL 1
.SH NAME
\fBAxel\fP \- A light download accelerator for Linux.
.SH SYNOPSIS
.B axel
[\fIOPTIONS\fP] \fIurl1\fP [\fIurl2\fP] [\fIurl...\fP]
.SH DESCRIPTION
Axel is a program that downloads a file from a FTP or HTTP server through
multiple connection, each connection downloads its own part of the file.
Unlike most other programs, Axel downloads all the data directly to the
destination file, using one single thread. It just saves some time at the
end because the program doesn't have to concatenate all the downloaded
parts.
.SH OPTIONS
.PP
One argument is required, the URL to the file you want to download. When
downloading from FTP, the filename may contain wildcards and the program
will try to resolve the full filename. Multiple URL's can be specified
as well and the program will use all those URL's for the download. Please
note that the program does not check whether the files are equal.
.PP
Other options:
.TP
\fB\-\-max\-speed=x\fP, \fB\-s\ x\fP
You can specify a speed (bytes per second) here and Axel will try
to keep the average speed around this speed. Useful if you don't want
the program to suck up all of your bandwidth.
.TP
\fB\-\-num\-connections=x\fP, \fB\-n\ x\fP
You can specify an alternative number of connections here.
.TP
\fB\-\-output=x\fP, \fB\-o\ x\fP
Downloaded data will be put in a local file with the same name,
unless you specify a different name using this option. You can
specify a directory as well, the program will append the filename.
.TP
\fB\-\-search[=x]\fP, \fB-S[x]\fP
Axel can do a search for mirrors using the filesearching.com search
engine. This search will be done if you use this option. You can specify how
many different mirrors should be used for the download as well.
The search for mirrors can be time\-consuming because the program tests
every server's speed, and it checks whether the file's still available.
.TP
\fB\-\-no\-proxy\fP, \fB\-N\fP
Don't use any proxy server to download the file. Not possible when a
transparent proxy is active somewhere, of course.
.TP
\fB\-\-verbose\fP
If you want to see more status messages, you can use this option. Use it
more than once if you want to see more.
.TP
\fB\-\-quiet\fP, \fB-q\fP
No output to stdout.
.TP
\fB\-\-alternate\fP, \fB-a\fP
This will show an alternate progress indicator. A bar displays the progress
and status of the different threads, along with current speed and an
estimate for the remaining download time.
.TP
\fB\-\-header=x\fP, \fB\-H\ x\fP
Add an additional HTTP header. This option should be in the form "Header:
Value". See RFC 2616 section 4.2 and 14 for details on the format and
standardized headers.
.TP
\fB\-\-user-agent=x\fP, \fB\-U\ x\fP
Set the HTTP user agent to use. Some websites serve different content based upon
this parameter. The default value will include "Axel", its version and the
platform.
.TP
\fB\-\-help\fP, \fB\-h\fP
A brief summary of all the options.
.TP
\fB\-\-version\fP, \fB\-V\fP
Get version information.
.SH NOTE
Long (double dash) options are supported only if your platform knows about
the getopt_long call. If it does not (like *BSD), only the short options can
be used.
.SH RETURN VALUE
The program returns 0 when the download was succesful, 1 if something really
went wrong and 2 if the download was interrupted. If something else comes back,
it must be a bug..
.SH EXAMPLES
.nf
axel ftp://ftp.{be,nl,uk,de}.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.bz2
.fi
This will use the Belgian, Dutch, English and German kernel.org mirrors to
download a Linux 2.4.17 kernel image.
.nf
axel \-S4 ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.bz2
.fi
This will do a search for the linux-2.4.17.tar.bz2 file on filesearching.com
and it'll use the four (if possible) fastest mirrors for the download.
(Possibly including ftp.kernel.org)
(Of course, the commands are a single line, but they're too long to fit on
one line in this page.)
.SH FILES
.PP
\fI/etc/axelrc\fP System-wide configuration file. Note that development versions
place this file in /usr/local/etc.
.PP
\fI~/.axelrc\fP Personal configuration file
.PP
These files are not documented in a man\-page, but the example file which
comes with the program contains enough information, I hope. The position
of the system-wide configuration file might be different.
.SH COPYRIGHT
Axel is Copyright 2001-2002 Wilmer van der Gaast.
.SH BUGS
Please report bugs at https://alioth.debian.org/tracker/?group_id=100070&atid=413085.
.SH AUTHORS
Wilmer van der Gaast. <wilmer@gaast.net>
......@@ -67,7 +67,7 @@
#define MAX_STRING 1024
#define MAX_ADD_HEADERS 10
#define MAX_REDIR 5
#define AXEL_VERSION_STRING "2.4"
#define AXEL_VERSION_STRING "2.5"
#define DEFAULT_USER_AGENT "Axel " AXEL_VERSION_STRING " (" ARCH ")"
typedef struct
......
.\"
.\" Axel 手册页
.\"
.\" 起源于一本由Richard Stone和Neil Matthew写的、名为《Linux程序设计》的书的手册页样本。
.\"
.\" 翻译于08-10-17
.\" 校对于08-11-11
.\"
.TH AXEL 1
.SH 名称
\fBAxel\fP \- Linux 下轻量的下载加速器。
.SH 总览
.B axel
[\fI选项\fP] \fIurl1\fP [\fIurl2\fP] [\fIurl...\fP]
.SH 描述
Axel\ 是一个通过多个连接从一个\ HTTP\ 或\ FTP\ 服务器下载文件的程序,每个连接下载文件的一部分。
跟其它程序不一样,\ Axel\ 会使用单一线程直接下载所有数据到目标文件。
这样正好可以节省时间,因为程序没有必要如锁链般连接到所有要下载的部分。
.SH 选项
.PP
必需要有一个参数--您想下载的文件的\ URL\ 。\
当从\ FTP\ 下载,文件名可能包含通配符,程序会尝试解析完整的文件名。
也可以指定多个\ URL\ ,程序将会通过那些地址下载。\
请注意,程序不会检查文件是否相同。
.PP
其它选项:
.TP
\fB\-\-max\-speed=x\fP, \fB\-s\ x\fP
您可以在这里指定一个速率(每秒字节,B/s),\ Axel\ 将会尝试保持平均速率在这个速率附近。\
它很有用──如果您不想程序吃掉您所有的带宽。
.TP
\fB\-\-num\-connections=x\fP, \fB\-n\ x\fP
您可以在这里指定一个最终连接数。
.TP
\fB\-\-output=x\fP, \fB\-o\ x\fP
下载的数据将会被保存为一个跟\ URL\ 地址文件名同名的本地文件,\
除非您使用这个选项指定使用一个不一样的名字。
您也可以指定一个目录,程序将会追加文件名。
.TP
\fB\-\-search[=x]\fP, \fB-S[x]\fP
Axel\ 能使用\ filesearching.com\ 搜索引擎,对镜像执行搜索。您使用这个选项它才会这么做。
您也可以指定应该使用多少个不同的镜像来下载。
对镜像搜索非常耗时,因为程序会测试每个服务器的速率,与及文件是否仍然有效。
.TP
\fB\-\-no\-proxy\fP, \fB\-N\fP
不使用代理服务器下载文件。当然,当一个透明代理是有效时,这是不可能的。
.TP
\fB\-\-verbose\fP
如果您想看到更多的状态信息,您可以使用这个选项。如果您想看到更多,就使用它多几次。
.TP
\fB\-\-quiet\fP, \fB-q\fP
不输出到标准输出(stdout)。
.TP
\fB\-\-alternate\fP, \fB-a\fP
这将会显示一个文本进度指示器。一个显示不同线程进度和状态,当前速率和评估剩余下载时间的棒形图。
.TP
\fB\-\-help\fP, \fB\-h\fP
一个对所有选项的简洁摘要。
.TP
\fB\-\-version\fP, \fB\-V\fP
获取版本信息。
.SH 注意
如果您的平台识别\ getopt_lang\ 调用,长(两杠破折号)选项才会被支持。\
否则(像\ *BSD\ ),只能使用短选项。
.SH 返回值
当下载成功,程序返回0,如果真的出错返回1,如果下载被中断返回2,如果返回其它,它肯定是一个臭虫……
.SH 例子
.nf
axel\ ftp://ftp.{be,nl,uk,de}.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.bz2
.fi
它将会使用\ Belgian\ 、\ Dutch\ 、\ English\ 和\ German\ 的\ kenel.org\ 镜像下载\ Linux\ 2.4.17\ kernel\ 映象。
.nf
axel\ \-S4\ ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.bz2
.fi
它将会在\ filesearching.com\ 搜索\ linux-2.4.17.tar.bz2\ 文件,\
然后从四个(如果可能的话)最快的镜像中下载(可能包括\ ftp.kernel.org\ )。
(当然,这个命令是一个独立行,但他们太长而不能在这个页面内显示为一行。)
让\ Gentoo\ GNU/Linux\ 的\ Portage\ 软件包管理器调用\ Axel\ 来下载,把下面的命令添加进\ /etc/make.conf\ 。
.nf
FETCHCOMMAND='/usr/bin/axel -a -o "${DISTDIR}/${FILE}.axel" "${URI}" && mv "${DISTDIR}/${FILE}.axel" "${DISTDIR}/${FILE}"'
RESUMECOMMAND="${FETCHCOMMAND}"
.fi
.SH 文件
.PP
\fI/etc/axelrc\fP 系统全局配置文件
.PP
\fI~/.axelrc\fP 个人配置文件
.PP
这些文件正文不会在一个手册页内显示,但我希望跟程序一起安装的样本文件包含足够的信息。
配置文件在不同系统的位置可能不一样。
.SH 版权
Axel is Copyright 2001-2002 Wilmer van der Gaast.
.SH 臭虫
.PP
我坚信在某些地方仍然会有臭虫,请告诉我,我会尝试修复它们。
已知臭虫是当使用上百个连接下载时,程序会发生异常。您应该避免它。
.SH 作者
Wilmer van der Gaast. <wilmer@gaast.net>
.SH 翻译
蠡\ Shuge\ Lee\ <shuge.lee@gmail.com>
.SH 校对
李进\ Li\ Jin\ <punkid.online@gmail.com>
.\" 最后更新09-02-06
#!/bin/sh
###########################
## Configurer for Axel ##
## ##
## Copyright 2001 Lintux ##
###########################
prefix='/usr/local'
########################################################################
## Configurer for Axel ##
## ##
## Copyright 2001 Lintux (Wilmer van der Gaast <wilmer@gaast.net> ##
## Copyright 2009 Barry deFreese <bdefreese@debian.org> ##
## Copyrigth 2012 Osamu Aoki <osamu@debian.org> ##
## Copyright 2015 Joao Eriberto Mota Filho <eriberto@eriberto.pro.br> ##
########################################################################
prefix='/usr'
bindir='$prefix/bin'
etcdir='$prefix/etc'
etcdir='/etc'
sharedir='$prefix/share'
mandir='$sharedir/man'
locale='$sharedir/locale'
......@@ -42,8 +45,8 @@ EOF
exit;
fi
keyname=$(expr "$e" : '\(.*\)=.*' | sed 's/[^a-z0-9_]/_/g')
value=$(expr "$e" : '.*=\(.*\)' | sed "s/'/_/g")
keyname=`expr "$e" : '\(.*\)=.*' | sed 's/[^a-z0-9_]/_/g'`
value=`expr "$e" : '.*=\(.*\)' | sed "s/'/_/g"`
eval "$keyname='$value'"
shift;
......@@ -73,7 +76,6 @@ OUTFILE=axel
ARCH=$arch
DESTDIR=
LFLAGS=
EOF
......@@ -87,6 +89,8 @@ cat<<EOF>config.h
EOF
AXEL_LFLAGS=${LFLAGS}
if [ "$i18n" = "1" ]; then
if type msgfmt > /dev/null 2> /dev/null; then :;else
echo 'WARNING: Internationalization disabled, you don'\''t have the necessary files'
......@@ -94,11 +98,15 @@ if [ "$i18n" = "1" ]; then
echo ''
i18n=0;
fi;
echo "all: i18n-mofiles" >> Makefile.settings
echo "install: install-i18n" >> Makefile.settings
echo "uninstall: uninstall-i18n" >> Makefile.settings
fi
echo "CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os ${CFLAGS}" >> Makefile.settings
AXEL_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ${CFLAGS}"
if [ "$debug" = "1" ]; then
echo 'CFLAGS+=-g' >> Makefile.settings
AXEL_CFLAGS="${AXEL_CFLAGS} -g"
echo 'DEBUG=1' >> Makefile.settings
echo '#define DEBUG' >> config.h;
fi
......@@ -106,16 +114,23 @@ fi
if [ "$i18n" = "1" ]; then
echo 'I18N=1' >> Makefile.settings
echo '#define I18N' >> config.h
if cat /usr/local/include/libintl.h > /dev/null 2> /dev/null; then
echo 'CFLAGS+=-I/usr/local/include' >> Makefile.settings
echo 'LFLAGS+=-L/usr/local/lib' >> Makefile.settings;
fi;
if [ -f /usr/local/include/libintl.h ]; then
AXEL_CFLAGS="${AXEL_CFLAGS} -I/usr/local/include"