Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Nov 2009 13:42:07 +0300
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        Rainer Hurling <rhurlin@gwdg.de>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Question about creating a port for saga gis
Message-ID:  <WofN1E7q2ctl0/hiAzPWwBKqodE@8WwhI1BLREGYCErwiufUu0sfwBM>
In-Reply-To: <4AFD2B5F.3070304@gwdg.de>
References:  <4AFD2B5F.3070304@gwdg.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Rainer, good day.

Fri, Nov 13, 2009 at 10:48:15AM +0100, Rainer Hurling wrote:
> Unfortunately I have problems to let the port fetch the distfile. I 
> tried many ways described in the porters handbook without success.
> 
> The distfile is located at
> 
> http://sourceforge.net/projects/saga-gis/files/SAGA%20-%202.0/SAGA%202.0.4/saga_2.0.4_src_linux.tar.gz/download

No, this is the location of the fancy page with ads that will allow one
to select mirrors and other stuff.  It will select the mirror
automatically, so you're seeing it as the download URL, but it's not so,
it is just a redirector.

> I tried for example with combinations of
> 
> PORTNAME=      saga
> PORTVERSION=   2.0.4
> DISTNAME=      saga_2.0.4_src_linux
> MASTER_SITES= 
> http://sourceforge.net/projects/saga-gis/files/SAGA%20-%202.0/SAGA%202.0.4/
> 
> but the main problem seems to be the '/download' after the filename.
> 
> Fetching the file by hand works but I have no clue how to describe this 
> path in the ports Makefile.

The following mini-Makefile does the trick for me:
-----
PORTNAME=       saga
PORTVERSION=    2.0.4
DISTNAME=       saga_2.0.4_src_linux
MASTER_SITES=   SF/saga-gis/SAGA%20-%20${PORTVERSION:C/\.[[:digit:]]*$//}/SAGA%20${PORTVERSION}/

CATEGORIES=     devel

.include <bsd.port.mk>
-----

Please, note that the "SF" word is expanded to the full list of the
SourceForge mirrors known to the FreeBSD ports subsystem, so you need
not to explicitely list any URLs -- just use "SF" for SourceForce
mirrors.

And the snippet I showed above is yet better rewritten as
-----
PORTNAME=       saga
PORTVERSION=    2.0.4
DISTNAME=       saga_2.0.4_src_linux
MASTER_SITES=   SF
MASTER_SITE_SUBDIR=     saga-gis/SAGA%20-%20${PORTVERSION:C/\.[[:digit:]]*$//}/SAGA%20${PORTVERSION}

CATEGORIES=     devel

.include <bsd.port.mk>
-----
It does the same, but has better semantics.
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?WofN1E7q2ctl0/hiAzPWwBKqodE>