summaryrefslogtreecommitdiff
path: root/games/linux-goodway/Makefile
blob: d61bacbc32c42877f7ac52807253037e2cd84027 (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
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
# New ports collection makefile for:	linux-goodway
# Date created:				25 Nov 2005
# Whom:					Jean-Yves Lefort <jylefort@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	linux-goodway
PORTVERSION=	3.2.0
PORTREVISION=	3
CATEGORIES=	games linux
MASTER_SITES=	http://www.xpgoodwayteam.org/dwn_goodway/
DISTNAME=	goodwayv${GWVERSION}_free

MAINTAINER=	jylefort@FreeBSD.org
COMMENT=	A flight planner for the X-Plane flight simulator

BUILD_DEPENDS=	icoconvert:${PORTSDIR}/graphics/icoconvert
RUN_DEPENDS=	X-Plane:${PORTSDIR}/games/linux-x-plane

WRKSRC=		${WRKDIR}/GoodWay${GWVERSION}F
USE_XLIB=	yes
USE_ZIP=	yes
USE_LINUX=	yes
RESTRICTED=	"Redistribution prohibited"
ONLY_FOR_ARCHS=	i386 amd64

GWVERSION=	${PORTVERSION:S|.||g}

XDIR=		${LOCALBASE}/lib/x-plane
GWDIR=		${PREFIX}/lib/goodway
GWDIR_REL=	${GWDIR:S,^${PREFIX}/,,}

PLIST=		${WRKDIR}/pkg-plist
PLIST_FILES=	bin/goodway share/pixmaps/goodway.png
PLIST_DIRS=	${GWDIR_REL}

SUB_FILES=	goodway
SUB_LIST=	GWDIR="${GWDIR}" PORTVERSION="${PORTVERSION}"

DESKTOP_ENTRIES="GoodWay" \
		"Manage flight plans" \
		"goodway.png" \
		"goodway" \
		"Application;Game;" \
		false

post-patch:
	@${MKDIR} ${WRKSRC}/.scripts
	@${MV} ${WRKSRC}/goodway ${WRKSRC}/.scripts
	@${MKDIR} ${WRKSRC}/.scripts/JRE/bin
	@${MV} ${WRKSRC}/JRE/bin/ControlPanel ${WRKSRC}/.scripts/JRE/bin
	@${MKDIR} ${WRKSRC}/.scripts/JRE/javaws
	@${MV} ${WRKSRC}/JRE/javaws/javaws ${WRKSRC}/.scripts/JRE/javaws
	@${MKDIR} ${WRKSRC}/.programs/JRE/bin
	@${MV} ${WRKSRC}/JRE/bin/* ${WRKSRC}/.programs/JRE/bin
	@${MKDIR} ${WRKSRC}/.programs/JRE/javaws
	@${MV} ${WRKSRC}/JRE/javaws/javawsbin ${WRKSRC}/.programs/JRE/javaws

do-build:
.for t in athlon-xp i586 pentium-3
	@if [ -e ${LOCALBASE}/lib/x-plane/X-Plane-${t} ]; then \
		${ECHO_CMD} 'GNL_XPlaneEXE=${LOCALBASE}/lib/x-plane/X-Plane-${t}' > ${WRKSRC}/Properties3.prf; \
	fi
.endfor
	@${ECHO_CMD} 'GNL_XPlaneDir=${LOCALBASE}/lib/x-plane' >> ${WRKSRC}/Properties3.prf
	@icoconvert ${WRKSRC}/ICON1.ICO
	@${MKDIR} ${WRKSRC}/.icons
	@${MV} ${WRKSRC}/ICON1_*.png ${WRKSRC}/.icons

pre-install:
	@${RM} -f ${PLIST}
	@${RM} -f ${PLIST}.dirs
.for d in "" .programs .scripts
	@cd ${WRKSRC}/${d} && \
	${FIND} * -type f | ${SORT} | ${SED} -e 's|^|${GWDIR_REL}/|' >> ${PLIST} && \
	${FIND} * -type d >> ${PLIST}.dirs
.endfor
	@${SORT} -ru ${PLIST}.dirs | ${SED} -e 's|^|@dirrm ${GWDIR_REL}/|' >> ${PLIST}

do-install:
	${INSTALL_SCRIPT} ${WRKDIR}/goodway ${PREFIX}/bin
	${MKDIR} ${PREFIX}/share/pixmaps
	${INSTALL_DATA} ${WRKSRC}/.icons/ICON1_48X48_32bpp.png ${PREFIX}/share/pixmaps/goodway.png
.for d in "" .programs .scripts
	cd ${WRKSRC}/${d} && ${FIND} * -type d -exec ${MKDIR} "${GWDIR}/{}" \;
.endfor
	cd ${WRKSRC} && ${FIND} * -type f -exec ${INSTALL_DATA} "{}" "${GWDIR}/{}" \;
	cd ${WRKSRC}/.programs && ${FIND} * -type f -exec ${INSTALL_PROGRAM} "{}" "${GWDIR}/{}" \;
	cd ${WRKSRC}/.scripts && ${FIND} * -type f -exec ${INSTALL_SCRIPT} "{}" "${GWDIR}/{}" \;

.include <bsd.port.mk>