aboutsummaryrefslogtreecommitdiff
path: root/games/ttt/Makefile
blob: d46d178e9606e208df42a9ba2a83798a42f6acb0 (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
# New ports collection makefile for:	ttt
# Date created:				11 July 2005
# Whom:					Alejandro Pulver <alejandro@varnet.biz>
#
# $FreeBSD$
#

PORTNAME=	ttt
PORTVERSION=	2003.03.14
CATEGORIES=	games
MASTER_SITES=	ftp://ftp.billsgames.com/unix/x/ttt/

MAINTAINER=	alejandro@varnet.biz
COMMENT=	Simple one or two player Tic Tac Toe game

USE_GMAKE=	yes
USE_SDL=	mixer sdl
USE_REINPLACE=	yes

OPTIONS=	OPTIMIZED_CFLAGS "Enable compilation optimizations" on

# net/ttt
CONFLICTS=	ttt-1*
NO_LATEST_LINK=	yes

.include <bsd.port.pre.mk>

post-patch:
# Fix Makefile
	@${REINPLACE_CMD} -e 's|sdl-config|${SDL_CONFIG}| ; \
			s|\(-Wall\)|${CFLAGS} \1|' \
				${WRKSRC}/${MAKEFILE}

# Enable/disable compilation optimizations
.if !defined(WITH_OPTIMIZED_CFLAGS)
	@${REINPLACE_CMD} -e 's|-O2||' ${WRKSRC}/${MAKEFILE}
.endif

# Fix paths to ${DATADIR}
	@${REINPLACE_CMD} -e 's|\(images/\)|${DATADIR}/\1| ; \
			s|\(sounds/\)|${DATADIR}/\1|' \
				${WRKSRC}/ttt.c

do-install:
# Program
	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin

# Data
	${MKDIR} ${DATADIR}
.for d in images sounds
	${CP} -R ${WRKSRC}/${d} ${DATADIR}
.endfor

# Fix wrong permissions
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DATADIR}
	${FIND} ${DATADIR} -type f -print0 | \
		${XARGS} -0 ${CHMOD} ${SHAREMODE}
	${FIND} ${DATADIR} -type d -print0 | \
		${XARGS} -0 ${CHMOD} ${BINMODE}

.include <bsd.port.post.mk>