summaryrefslogtreecommitdiffstats
path: root/astro/xtide/Makefile
blob: 7ba149111cc1171e12d3162caf6f7d7d13bfff90 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# New ports collection makefile for:   xtide
# Date created:        30 August 1997
# Whom:                Brion Moss <brion@queeg.com>
#
# $FreeBSD$
#

PORTNAME=	xtide
PORTVERSION=	2.12.1
PORTREVISION=	2
CATEGORIES=	astro geography
MASTER_SITES=	ftp://ftp.flaterco.com/xtide/ \
		http://www.c-s.li/ports/
DISTFILES=	${DISTNAME}${EXTRACT_SUFX} \
		${TCD_DISTNAME}${EXTRACT_SUFX} \
		${HARM_DISTNAME}-free${EXTRACT_SUFX}

MAINTAINER=	cs@FreeBSD.org
COMMENT=	Harmonic tide clock and tide predictor

LICENSE=	GPLv3

LIB_DEPENDS=	png15:${PORTSDIR}/graphics/png

USE_BZIP2=	yes
USE_GMAKE=	yes
GNU_CONFIGURE=	yes

MAN1=		tide.1
MAN8=		xttpd.8

CPPFLAGS+=	-I../${TCD_DISTNAME} -I${LOCALBASE}/include/libpng15
LDFLAGS+=	-L../${TCD_DISTNAME}/.libs -L${LOCALBASE}/lib
MAKE_JOBS_SAFE=	yes

TCD_DISTNAME=	libtcd-2.2.5
HARM_DISTNAME=	harmonics-dwf-20120302
WVS_DISTNAME=	wvs

OPTIONS=	WVS "Use world vector shoreline data (big file!)" Off

.include <bsd.port.options.mk>
.include <bsd.port.pre.mk>

.if !defined(WITHOUT_WVS)
DISTFILES+=	${WVS_DISTNAME}${EXTRACT_SUFX}
PLIST_SUB+=	WVS=""
.else
PLIST_SUB+=	WVS="@comment "
.endif

.if defined(WITHOUT_X11)
PKGNAMESUFFIX+=	-nox11
ALL_TARGET+=	tide xttpd
PLIST_SUB+=	X11="@comment "
.else
USE_XORG+=	xpm xaw
MAN1+=		xtide.1
PLIST_SUB+=	X11=""
.endif

post-extract:
	@${LN} -sf ../${HARM_DISTNAME}/${HARM_DISTNAME}-free.tcd ${WRKSRC}/harmonics.tcd

post-patch:
	@${REINPLACE_CMD} -e '/if test/s|==|=|g' ${WRKDIR}/${TCD_DISTNAME}/configure
	@${REINPLACE_CMD} -e 's|/usr/X11R6|${LOCALBASE}|g' ${WRKSRC}/configure
	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/Global.cc

pre-configure:
	@cd ${WRKDIR}/${TCD_DISTNAME} \
		&& ${SETENV} ${CONFIGURE_ENV} \
			CC="${CC}" CFLAGS="${CFLAGS}" \
			CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
			${SH} ./configure --disable-shared \
			${CONFIGURE_ARGS} \
		&& ${MKDIR} ${WRKDIR}/${TCD_DISTNAME}/.libs \
		&& ${SETENV} ${MAKE_ENV} ${GMAKE}

post-configure:
	@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
		< ${FILESDIR}/xtide.conf.example > ${WRKDIR}/xtide.conf.example

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/tide ${PREFIX}/bin
.if !defined(WITHOUT_X11)
	${INSTALL_PROGRAM} ${WRKSRC}/xtide ${PREFIX}/bin
	${INSTALL_MAN} ${WRKSRC}/xtide.1 ${MANPREFIX}/man/man1
.endif
	${INSTALL_PROGRAM} ${WRKSRC}/xttpd ${PREFIX}/bin
	${INSTALL_MAN} ${WRKSRC}/tide.1 ${MANPREFIX}/man/man1
	${INSTALL_MAN} ${WRKSRC}/xttpd.8 ${MAN8PREFIX}/man/man8
	@${MKDIR} ${DATADIR}
	${INSTALL_DATA} ${WRKSRC}/harmonics.tcd ${DATADIR}
	${INSTALL_DATA} ${WRKDIR}/xtide.conf.example ${PREFIX}/etc

post-install:
.if !exists(${PREFIX}/etc/xtide.conf)
	${INSTALL_DATA} ${WRKDIR}/xtide.conf.example ${PREFIX}/etc/xtide.conf
	${CHMOD} 644 ${PREFIX}/etc/xtide.conf
.endif

.if !defined(WITHOUT_WVS)
	@${MKDIR} ${DATADIR}/wvs
	${INSTALL_DATA} ${WRKDIR}/wvs1.dat ${DATADIR}/wvs
	${INSTALL_DATA} ${WRKDIR}/wvs12.dat ${DATADIR}/wvs
	${INSTALL_DATA} ${WRKDIR}/wvs250k.dat ${DATADIR}/wvs
	${INSTALL_DATA} ${WRKDIR}/wvs3.dat ${DATADIR}/wvs
	${INSTALL_DATA} ${WRKDIR}/wvs43.dat ${DATADIR}/wvs
	${INSTALL_DATA} ${WRKDIR}/wvsfull.dat ${DATADIR}/wvs
.endif

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud