You are not logged in.
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
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
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
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
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
Snowman, I didn't see your post until I had written mine.
No problem. That's what I thought. 8)
Offline
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
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
Yes it works without the export, and by changing the line dealing with FTPAGENT.
I updated the BUILDPKG
Offline