new port - different versions of the same file - advice needed

Sunpoet Hsieh sunpoet at sunpoet.net
Fri Nov 5 14:17:00 UTC 2010


On Fri, Nov 5, 2010 at 6:26 PM, Anton Shterenlikht <mexas at bristol.ac.uk> wrote:
> I'm trying to make a port of Slatec numerical libraries:
> http://netlib.org/slatec/
>
> This file contains the full sources:
> http://netlib.org/slatec/slatec_src.tgz
>
> However, according to Netlib FAQ: http://netlib.org/misc/faq.html#2.17 ,
> I've got to replace 3 files in this archive by newer versions:
>
> *quote*
> The easiest to use versions of the routines r1mach, d1mach, and i1mach
> are located in the blas directory of Netlib. These versions of r1mach
> and d1mach attempt to determine machine characteristics automatically.
>
> The original versions of r1mach, d1mach, and i1mach,
> in the slatec/src directory, require a user to scan
> their source and to uncomment the statements specifying
> the constants for his particular machine. Constants for some
> architectures are not explicitly identified in the comments
> of r1mach, d1mach, and i1mach. For those architectures conforming
> to the IEEE floating-point standard, and most newer ones do,
> you can locate and uncomment the IEEE-conforming constants in the routines.
> *end quote*
>
> So I need to download http://netlib.org/slatec/slatec_src.tgz,
> extract all files from it, and then overwrite d1mach.f, i1mach.f
> and r1mach.f by the Blas versions:
>
> http://netlib.org/blas/d1mach.f
> http://netlib.org/blas/i1mach.f
> http://netlib.org/blas/r1mach.f
>
> What is the best way to achive this?
>
> many thanks
> anton
>

Hi,

FYI, let me simplify your requirements:
1. source tarball and patch files are from different URLs.
2. patch files are not archived.

My suggestion is as follows: (I've not tested yet.)

PORTNAME=	slatec
MASTER_SITES=	http://netlib.org/slatec/ \
		http://netlib.org/blas/:mach
DISTFILES=	${PORTNAME}_src.tgz \
		d1mach.f:mach i1mach.f:mach r1mach.f:mach
EXTRACT_ONLY=	${PORTNAME}_src.tgz

Then you could copy these three files from DISTDIR to the work directory.

post-extract:
	@cd ${DISTDIR}/ && ${CP} d1mach.f i1mach.f r1mach.f ${WRKSRC}/src/

Hope that helps.

Regards,
sunpoet
-- 
  Sunpoet Po-Chuan Hsieh <sunpoet at sunpoet.net> <sunpoet at FreeBSD.org>
          4096R/CC57E36B 8AD8 68F2 7D2B 0A10 7E9B 8CC0 DC44 247E CC57 E36B
                            http://people.FreeBSD.org/~sunpoet/pgpkeys.txt


More information about the freebsd-ports mailing list