summaryrefslogtreecommitdiff
path: root/astro/xephem/Makefile
blob: 996ed1559c4bec60391f1d165be0b7827b703582 (plain) (blame)
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
# New ports collection makefile for:    xephem
# Date created:         Thu Aug  1 09:10:22 CDT 1996
# Whom:                 erich@FreeBSD.org
#
# $FreeBSD$
#

PORTNAME=	xephem
PORTVERSION=	3.5.2
CATEGORIES=	astro
MASTER_SITES=	# http://www.clearskyinstitute.com/xephem/
DISTFILES=	${PORTNAME}-${PORTVERSION}.tar.gz

MAINTAINER=	ports@FreeBSD.org

PORTCOMMENT=	An interactive astronomical ephemeris program

WRKSRC=		${WRKDIR}/${DISTNAME}/GUI/xephem

USE_MOTIF=	yes
USE_IMAKE=	yes
USE_REINPLACE=	yes
MAN1=		xephem.1

LIBASTROSRC=	${WRKDIR}/${DISTNAME}/libastro
LIBIPSRC=	${WRKDIR}/${DISTNAME}/libip

NO_CDROM=	Personal use only

.include <bsd.port.pre.mk>

.for file in ${DISTFILES}
.if !exists(${DISTDIR}/${file})
IGNORE=You must manually fetch ${file} from http://www.clearskyinstitute.com/xephem/, place it in ${DISTDIR} and then run make again.
.endif
.endfor

post-patch:
	@${CHMOD} u+w ${LIBASTROSRC}/Makefile ${LIBIPSRC}/Makefile
	@${REINPLACE_CMD} -e 's|CC =|CC?=|g ; \
		 s|CFLAGS=|CFLAGS+=|g ; \
		 s|-O2 ||g' ${LIBASTROSRC}/Makefile ${LIBIPSRC}/Makefile

pre-build:
	@cd ${LIBASTROSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE}
	@cd ${LIBIPSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE}
	@${ECHO_CMD} 'XEphem.ShareDir: ${PREFIX}/lib/X11/xephem' > ${WRKSRC}/XEphem.ad

post-install:
	${INSTALL_DATA} ${WRKSRC}/XEphem.ad ${PREFIX}/lib/X11/app-defaults/XEphem
	@${MKDIR} ${PREFIX}/lib/X11/xephem
	${TAR} -C ${WRKSRC} -cf - auxil catalogs fits fifos tools \
		| ${TAR} -C ${PREFIX}/lib/X11/xephem --unlink -xf -
	@${FIND} ${PREFIX}/lib/X11/xephem | ${XARGS} ${CHOWN} ${SHAREOWN}:${SHAREMODE}
	@${FIND} ${PREFIX}/lib/X11/xephem -type f | ${XARGS} ${CHMOD} ${SHAREMODE}

.include <bsd.port.post.mk>