[52595c6] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-finish-downloadclient">
|
---|
| 9 | <?dbhtml filename="downloadclient.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Download Client</title>
|
---|
| 12 |
|
---|
| 13 | <para>The final system build does not install an FTP or HTTP client for downloading files.</para>
|
---|
| 14 |
|
---|
| 15 | <itemizedlist>
|
---|
| 16 | <para>Some suggested clients include:</para>
|
---|
| 17 | <listitem>
|
---|
| 18 | <para>Curl <ulink url="&cblfs-root;index.php/Curl"/></para>
|
---|
| 19 | </listitem>
|
---|
| 20 | <listitem>
|
---|
| 21 | <para>Inetutils <ulink url="&cblfs-root;index.php/Inetutils"/></para>
|
---|
| 22 | </listitem>
|
---|
| 23 | <listitem>
|
---|
| 24 | <para>LFTP <ulink url="http://lftp.yar.ru/"/></para>
|
---|
| 25 | </listitem>
|
---|
| 26 | <listitem>
|
---|
| 27 | <para>Links <ulink url="&cblfs-root;index.php/Links"/></para>
|
---|
| 28 | </listitem>
|
---|
| 29 | <listitem>
|
---|
| 30 | <para>Lynx <ulink url="&cblfs-root;index.php/Lynx"/></para>
|
---|
| 31 | </listitem>
|
---|
| 32 | <listitem>
|
---|
[bd85080] | 33 | <para>NcFTP Client <ulink url="&cblfs-root;index.php/Ncftp"/></para>
|
---|
[52595c6] | 34 | </listitem>
|
---|
| 35 | <listitem>
|
---|
| 36 | <para>Wget <ulink url="&cblfs-root;index.php/Wget"/></para>
|
---|
| 37 | </listitem>
|
---|
| 38 | <listitem>
|
---|
| 39 | <para>BASH - A user can use net redirections (if not disabled when building bash in the final system) to download wget or another program.</para>
|
---|
| 40 | <screen><userinput>cat > download.sh << "EOF"
|
---|
| 41 | #!/bin/bash
|
---|
| 42 |
|
---|
| 43 | WGET_VERSION='1.14'
|
---|
| 44 | WGET_HOSTNAME='ftp.gnu.org'
|
---|
| 45 | exec {HTTP_FD}<>/dev/tcp/${WGET_HOSTNAME}/80
|
---|
| 46 | echo -ne "GET /gnu/wget/wget-${WGET_VERSION}.tar.xz HTTP/1.1\r\nHost: "\
|
---|
| 47 | ${WGET_HOSTNAME}'\r\nUser-Agent: '\
|
---|
| 48 | 'bash/'${BASH_VERSION}'\r\n\r\n' >&${HTTP_FD}
|
---|
| 49 | sed -e '1,/^.$/d' <&${HTTP_FD} >wget-${WGET_VERSION}.tar.xz
|
---|
| 50 | EOF</userinput></screen>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>GAWK</para>
|
---|
| 54 | <screen><userinput>cat > gawkdl.sh << "EOF"
|
---|
| 55 | #!/bin/bash
|
---|
| 56 |
|
---|
| 57 | gawk 'BEGIN {
|
---|
| 58 | NetService = "/inet/tcp/0/mirror.anl.gov/80"
|
---|
| 59 | print "GET /pub/gnu/wget/wget-1.14.tar.xz" |& NetService
|
---|
[d3a81ee] | 60 | while ((NetService |& getline) > 0)
|
---|
[52595c6] | 61 | print $0
|
---|
| 62 | close(NetService)
|
---|
[d3a81ee] | 63 | }' > binary
|
---|
[52595c6] | 64 |
|
---|
[24b004c] | 65 | gawk '{q=p;p=$0}NR>1{print q}END{ORS = ""; print p}' binary > wget-1.14.tar.xz
|
---|
[52595c6] | 66 |
|
---|
| 67 | rm binary
|
---|
| 68 | EOF</userinput></screen>
|
---|
| 69 | </listitem>
|
---|
| 70 | <listitem>
|
---|
| 71 | <para>PERL with HTTP::Tiny (Included with final system PERL install).</para>
|
---|
| 72 | <screen><userinput>cat > download.pl << "EOF"
|
---|
| 73 | #!/usr/bin/perl
|
---|
| 74 |
|
---|
| 75 | use HTTP::Tiny;
|
---|
| 76 | my $http = HTTP::Tiny->new;
|
---|
| 77 | my $response;
|
---|
| 78 |
|
---|
| 79 | $response = $http->mirror('http://ftp.gnu.org/gnu/wget/wget-1.14.tar.xz', 'wget-1.14.tar.xz');
|
---|
| 80 | die "Failed!\n" unless $response->{success};
|
---|
[24b004c] | 81 | print "Unchanged!\n" if $response->{status} eq '304';
|
---|
[52595c6] | 82 | EOF</userinput></screen>
|
---|
| 83 | <para>Or use this:</para>
|
---|
| 84 | <screen><userinput>perl -MHTTP::Tiny -E 'say HTTP::Tiny->new->get(shift)->{content}' "http://ftp.gnu.org/gnu/wget/wget-1.14.tar.xz" > binary
|
---|
| 85 | perl -e 'local $/; $_ = <>; s/\n$//; print' binary > wget-1.14.tar.xz
|
---|
| 86 | rm binary</userinput></screen>
|
---|
| 87 | </listitem>
|
---|
| 88 | <listitem>
|
---|
| 89 | <para>PERL with LWP: Run <command>cpan</command> and manually configure the client. Run <command>install LWP</command> while in the CPAN shell.</para>
|
---|
| 90 | <para>Refer to <ulink url="http://www.bioinfo-user.org.uk/dokuwiki/doku.php/projects/wgetpl"/> for wgetpl.</para>
|
---|
| 91 | </listitem>
|
---|
| 92 | </itemizedlist>
|
---|
| 93 |
|
---|
| 94 | </sect1>
|
---|