You are not logged in.

#1 2006-02-07 19:54:05

slubman
Member
From: Grenoble (France)
Registered: 2004-08-04
Posts: 86
Website

[Solve] Problem for downloading on a server with wget

Hi all.

I want to make a pkgbuild for tiemu2, but i've got a problem. The server who host the file does not allow download from wget.

With a "normal" wget:

$ wget http://www.ticalc.org/pub/unix/tiemu.tar.gz
--19:40:17--  http://www.ticalc.org/pub/unix/tiemu.tar.gz
           => `tiemu.tar.gz.2'
Resolving www.ticalc.org... 62.65.69.4
Connecting to www.ticalc.org|62.65.69.4|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
19:40:17 ERROR 403: Forbidden.

by using an empty user-agent;

$ wget --user-agent="" http://www.ticalc.org/pub/unix/tiemu.tar.gz
--19:54:50--  http://www.ticalc.org/pub/unix/tiemu.tar.gz
           => `tiemu.tar.gz'
Resolving www.ticalc.org... 62.65.69.4
Connecting to www.ticalc.org|62.65.69.4|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2,267,307 (2.2M) [application/x-gzip]

100%[=====================================================================================================>] 2,267,307    707.51K/s    ETA 00:00

19:54:54 (672.68 KB/s) - `tiemu.tar.gz' saved [2267307/2267307]

So my question is : How to automate (options to makepkg? tricks in the PKGBUILD ? ...) the download with makepg so that i can put the PKGBUILD in AUR  :?:

Offline

#2 2006-02-07 20:42:11

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Solve] Problem for downloading on a server with wget

Use that url for the sources in your PKGBUILD.  Just add a comment saying to download the source manually with wget --user-agent="" or a browser. Also, the --user-agent="" option can be added to the FTPAGENT line in /etc/makepkg.conf to solve that problem permanently. You can mention both solutions in your comment and let the user choose the one he  prefer.

Offline

#3 2006-02-07 20:43:12

bogomipz
Member
From: Oslo, Norway
Registered: 2003-11-23
Posts: 169

Re: [Solve] Problem for downloading on a server with wget

You could always skip using sources and do a "manual" wget within the build() function, like you would do for cvs/svn/whatever. That also makes it easier for people to build your pkg, as they won't have to use funky makepkg configs.


All of your mips are belong to us!!

Offline

#4 2006-02-07 20:59:20

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Solve] Problem for downloading on a server with wget

bogomipz wrote:

You could always skip using sources and do a "manual" wget within the build() function, like you would do for cvs/svn/whatever. That also makes it easier for people to build your pkg, as they won't have to use funky makepkg configs.

That's bad practice. cvs/svn package are done that way because there's no other choice as there's no source tarball. Better do what I wrote in my post. The change to makepkg.conf is a one time edit.

Offline

#5 2006-02-07 21:20:03

bogomipz
Member
From: Oslo, Norway
Registered: 2003-11-23
Posts: 169

Re: [Solve] Problem for downloading on a server with wget

Snowman, I didn't see your post until I had written mine. I see this as a one time workaround, not something one would do for many packages, hence the quick and dirty solution. Downloading manually so that makepkg will see it already has the tarball is the best solution in my eyes, but as Snowman says, the user can choose whether to make the permanent change to makepkg.conf, write a comment like Snowman suggests.


All of your mips are belong to us!!

Offline

#6 2006-02-07 22:51:15

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Solve] Problem for downloading on a server with wget

bogomipz wrote:

Snowman, I didn't see your post until I had written mine.

No problem. That's what I thought. 8)

Offline

#7 2006-02-07 23:11:27

slubman
Member
From: Grenoble (France)
Registered: 2004-08-04
Posts: 86
Website

Re: [Solve] Problem for downloading on a server with wget

Finally I found a soolution, by adding the following line in my PKGBUILD:

export FTPAGENT="/usr/bin/wget -U """

so now my PKGBUILD is:

# Contributer: slubman <mymail@myhost.ext>
pkgname=tiemu
pkgver=2.04
pkgrel=4
pkgdesc="A TI89(Titanium), TI92(+), V200 emulator"
makedepends=('pkgconfig')
depends=('libticalcs' 'libglade')
FTPAGENT="$FTPAGENT -U """
source=(http://www.ticalc.org/pub/unix/$pkgname.tar.gz)
url="http://lpg.ticalc.org/prj_tiemu/"
md5sums=('19c365c2277a95a4290ac268b3733862')

build() {
    cd $startdir/src/tiemu2-$pkgver
    ./configure --prefix=/usr
    make || return 1
    make DESTDIR=$startdir/pkg install
}

Offline

#8 2006-02-08 12:49:23

bogomipz
Member
From: Oslo, Norway
Registered: 2003-11-23
Posts: 169

Re: [Solve] Problem for downloading on a server with wget

slubman wrote:

Finally I found a soolution, by adding the following line in my PKGBUILD:

export FTPAGENT="/usr/bin/wget -U """

Ah, changing the makepkg configs from within the PKGBUILD, how neat. If that works, I guess it should work without the export keyword as well, but more importantly; how about making the change an addition rather than an override:

FTPAGENT="$FTPAGENT -U """

This will fail if the user wants to use a replacement to wget which doesn't accept the added parameter, though, so maybe it's not such a good idea.


All of your mips are belong to us!!

Offline

#9 2006-02-08 13:00:50

slubman
Member
From: Grenoble (France)
Registered: 2004-08-04
Posts: 86
Website

Re: [Solve] Problem for downloading on a server with wget

Yes it works without the export, and by changing the line dealing with FTPAGENT.

I updated the BUILDPKG  smile

Offline

Board footer

Powered by FluxBB