# Sourceforge and SF



## laufdi (Nov 6, 2013)

I try to port re-alpine.

I set 
	
	



```
MASTER_SITES=  SF
```
but can't get it downloaded

A working link would be
http://sourceforge.net/projects/re-alpine/files/re-alpine-2.03.tar.bz2

so I set 

```
MASTER_SITES=   http://sourceforge.net/projects/${PORTNAME}/files/
```
and I get 

```
fetch: http://sourceforge.net/projects/re-alpine/files/re-alpine-2.03.tar.bz2: Moved Temporarily
```

while I can manually fetch this URL without a problem.

How to handle Sourceforge downloads?


----------



## ShelLuser (Nov 6, 2013)

Simple. What is happening here is that you're being re-directed to one of the mirrors which SourceForge is using. So the solution should be obvious: use one of those mirrors.

When I use wget to grab this file this is what I get to see:


```
--2013-11-06 18:52:35--  http://sourceforge.net/projects/re-alpine/files/re-alpine-2.03.tar.bz2
Resolving sourceforge.net (sourceforge.net)... 216.34.181.60
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://sourceforge.net/projects/re-alpine/files/re-alpine-2.03.tar.bz2/download [following]
--2013-11-06 18:52:35--  http://sourceforge.net/projects/re-alpine/files/re-alpine-2.03.tar.bz2/download
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://downloads.sourceforge.net/project/re-alpine/re-alpine-2.03.tar.bz2?r=&ts=1383760356&use_mirror=garr [following]
--2013-11-06 18:52:36--  http://downloads.sourceforge.net/project/re-alpine/re-alpine-2.03.tar.bz2?r=&ts=1383760356&use_mirror=garr
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://garr.dl.sourceforge.net/project/re-alpine/re-alpine-2.03.tar.bz2 [following]
--2013-11-06 18:52:36--  http://garr.dl.sourceforge.net/project/re-alpine/re-alpine-2.03.tar.bz2
Resolving garr.dl.sourceforge.net (garr.dl.sourceforge.net)... 193.206.140.34, 2001:760:ffff:b0::34
Connecting to garr.dl.sourceforge.net (garr.dl.sourceforge.net)|193.206.140.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5335178 (5.1M) [application/octet-stream]
Saving to: 're-alpine-2.03.tar.bz2.1'
```
As you can see it starts with looking up sourceforge.net then moves to downloads.sourceforge.net. Another interesting option is the URL parameter use_mirror which is set to garr. This is just a hunch on my part, but that tells me that the host is being instructed to re-direct you to a mirror site.

And you can see that happening in the end, because the file is initially picked up from garr.dl.sourceforge.net.

So one option could be to use:


```
$ wget http://garr.dl.sourceforge.net/project/re-alpine/re-alpine-2.03.tar.bz2
```

If you do so then you'll notice that it won't redirect you:


```
--2013-11-06 18:58:20--  http://garr.dl.sourceforge.net/project/re-alpine/re-alpine-2.03.tar.bz2
Resolving garr.dl.sourceforge.net (garr.dl.sourceforge.net)... 193.206.140.34, 2001:760:ffff:b0::34
Connecting to garr.dl.sourceforge.net (garr.dl.sourceforge.net)|193.206.140.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5335178 (5.1M) [application/octet-stream]
Saving to: 're-alpine-2.03.tar.bz2'
```
However, although this works I'd also advice you to check out the SourceForge website to see if there are any policies regarding the direct download of archives. If so it is strongly advisable to follow those.

SO, summing up; wget is your friend


----------



## laufdi (Nov 6, 2013)

Is there a ports option to use wget instead of fetch?


----------



## ShelLuser (Nov 6, 2013)

I don't know, but I doubt it. Why would you want to do that? Just use one of the mirrors to download this file and it'll work.


----------



## bkouhi (Nov 17, 2013)

You should manually adjust the URL, add these lines into your Makefile:



```
PORTNAME=       re-alpine
PORTVERSION=    2.03
MASTER_SITES=   SF/re-alpine/

USE_BZIP2=      yes

.include <bsd.port.mk>
```

Please read /usr/ports/Mk/bsd.sites.mk for more information.


----------



## cpm@ (Nov 17, 2013)

laufdi said:
			
		

> Is there a ports option to use wget instead of fetch?



To set up ports to use wget(1) to download, you need to add the following lines in /etc/make.conf:

```
FETCH_CMD=wget
FETCH_BEFORE_ARGS=-nc --progress=bar --read-timeout=60
DISABLE_SIZE=yes
```

Also see this related thread which on it is explained how to setup www/aria2 for the same purpose.


----------



## laufdi (Nov 18, 2013)

Thank you, but re-alpine is outdated, better wait for alpine 2.11
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/180050


----------



## mrmarbury (Feb 11, 2014)

Hi,

is there anything new on this topic?  I was trying to just compile alpine 2.11 the other day and I'm facing some compile errors. I would really like to have it as an official port.

Cheers,
Stefan


----------



## SirDice (Feb 11, 2014)

Ports are mostly community driven. So unless someone takes the time and effort to port something it's not going to happen. If you look at the port's maintainer you'll see it's set to ports@freebsd.org which means there's really nobody responsible for it. Other ports have a proper maintainer. It's somebody that has taken it upon their selves to keep the port up to date and fix any issues. It's usually somebody that benefits from, or depends on, a correctly working port themselves.

That said, post the changes you made to the original port and the problems you ran into and perhaps somebody in the community can come up with a solution. If we get it working the PR can be updated with a few patches and port management will apply them.


----------

