summaryrefslogtreecommitdiff
path: root/lang/f2c/Makefile
blob: 1cf3c2a4bfb8e96f35be2ab1bd7356620948c47d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# $NetBSD: Makefile,v 1.53 2010/01/03 01:37:59 tnn Exp $

DISTNAME=	f2c-20090411	# see notes below
PKGREVISION=	4
CATEGORIES=	lang
MASTER_SITES=	${MASTER_SITE_LOCAL}

MAINTAINER=	dmcmahill@NetBSD.org
HOMEPAGE=	http://www.netlib.org/f2c/index.html
COMMENT=	Fortran to C compiler including a script to emulate f77

PKG_DESTDIR_SUPPORT=	user-destdir

CONFLICTS=	egcs-current-19980608

WRKSRC=		${WRKDIR}/f2c

BUILD_DIRS=	src
USE_BSD_MAKEFILE=	yes
MAKE_ENV+=		MKCATPAGES=no
INSTALLATION_DIRS=	bin share/doc/f2c ${PKGMANDIR}/man1

.include "../../mk/bsd.prefs.mk"

# XXX(jmmv): This is a very ugly workaround.  CPP should probably default to
# /usr/bin/cpp in OS X.
.if ${OPSYS} == "Darwin"
F2C_F77_CPP=	/usr/bin/cpp
.else
F2C_F77_CPP=	${CPP}
.endif

post-extract:
	@${CP} ${FILESDIR:Q}/f2c.mk ${WRKSRC}/src/Makefile
	@${CP} ${FILESDIR:Q}/gram.c ${WRKSRC}/src/gram.c
	@mv ${WRKSRC}/src/.depend  ${WRKSRC}/src/depend.orig
	@mv ${WRKSRC}/src/f2c.1 ${WRKSRC}/src/f2c.1.orig

# Handle f2c-f77 script:
post-build:
	${SED} -e 's;@PREFIX@;${PREFIX};g' \
	  -e 's;@CC@;${CC};g' -e 's;@CPP@;${F2C_F77_CPP};g' \
	  -e "s;@SHELL@;${TOOLS_PLATFORM.sh:Q};g" \
	 ${FILESDIR}/f2c-f77.in > ${WRKSRC}/f2c-f77

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/src/f2c ${DESTDIR}${PREFIX}/bin
	${INSTALL_SCRIPT} ${WRKSRC}/f2c-f77 ${DESTDIR}${PREFIX}/bin
	${INSTALL_DATA} ${WRKSRC}/f2c.1t ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/f2c.1
.for f in changes f2c.ps f2c.pdf
	${INSTALL_DATA} ${WRKSRC}/$f ${DESTDIR}${PREFIX}/share/doc/f2c/$f
.endfor

# Note.  the distfile is kept locally because it is
# created "on the fly" by the real master site with
# no version number included.  This makes it difficult
# at best to use the real master site.  The distfile
# was created by:
#   ftp ftp://netlib.bell-labs.com/netlib/f2c.tar
#   tar -xvf f2c.tar f2c/00lastchange.gz
#   gzcat f2c/00lastchange.gz
#
#read what the last change date was.
#
#   mv f2c.tar f2c-yyyymmdd.tar
#   gzip --best f2c-yyyymmdd.tar

.include "../../mk/bsd.pkg.mk"