aboutsummaryrefslogtreecommitdiff
path: root/games/bsdgames/Makefile
blob: 32cff10bf87076eaebb5b29b67b3a5e002f7cb7c (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
# Created by: Mark Murray <markm@FreeBSD.org>
# $FreeBSD$

PORTNAME=	bsdgames
PORTVERSION=	3.8.2
PORTREVISION=	4
PORTEPOCH=	1
CATEGORIES=	games
# Fetched from git://git.dragonflybsd.org/dragonfly.git, v${PORTVERSION}, /games
MASTER_SITES=	${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR=	adamw

MAINTAINER=	adamw@FreeBSD.org
COMMENT=	Traditional BSD games taken from DragonFly BSD

LICENSE=	BSD3CLAUSE

CONFLICTS=	hangman-[0-9]*

USES=		uidfix tar:xz
MAKE_ENV+=	NO_WERROR=1
MAKE_ARGS=	BINGRP=${BINGRP}

# contain /usr/share/games
SHAREPATH_FILES=atc/atc.6 \
		atc/pathnames.h \
		cribbage/cribbage.6 \
		cribbage/pathnames.h \
		fish/pathnames.h \
		larn/pathnames.h \
		quiz/datfiles/index \
		quiz/pathnames.h \
		quiz/quiz.6 \
		wump/pathnames.h

# contain /usr/games/*
GAMESPATH_FILES=backgammon/backgammon/backgammon.6 \
		backgammon/common_source/init.c \
		canfield/canfield/canfield.6 \
		cribbage/cribbage.6 \
		hunt/hunt/hunt.6 \
		hunt/huntd/huntd.6 \
		phantasia/pathnames.h \
		wargames/wargames.sh

# These keep score in /var/games
SGID_BINARIES=	atc battlestar canfield/canfield cribbage hack phantasia \
		robots sail snake/snake

post-patch:
	@${REINPLACE_CMD} -e "s/NOMAN/NO_MAN/" \
		${WRKSRC}/backgammon/teachgammon/Makefile \
		${WRKSRC}/canfield/cfscores/Makefile \
		${WRKSRC}/snake/snscore/Makefile \
		${WRKSRC}/fortune/unstr/Makefile \
		${WRKSRC}/primes/Makefile
	@for f in ${SHAREPATH_FILES}; do \
		${REINPLACE_CMD} -e 's|/usr/share/games|${PREFIX}/share/games|g' \
			${WRKSRC}/$${f}; \
	done
	@for f in ${GAMESPATH_FILES}; do \
		${REINPLACE_CMD} -e 's|/usr/games|${PREFIX}/bin|g' \
			${WRKSRC}/$${f}; \
	done
	@for f in ${SGID_BINARIES}; do \
		${REINPLACE_CMD} -e 's/HIDEGAME/SGIDGAME/' \
			${WRKSRC}/$${f}/Makefile; \
	done

pre-install:
.for d in atc larn quiz.db
	@${MKDIR} ${STAGEDIR}${PREFIX}/share/games/$d
.endfor
.for d in atc battlestar hackdir/save larn phantasia
	@${MKDIR} ${STAGEDIR}/var/games/$d
.endfor

post-install:
# avoid conflict with games/bs and shells/fish
.for prog in bs fish
	${MV} ${STAGEDIR}${PREFIX}/bin/${prog} ${STAGEDIR}${PREFIX}/bin/${prog}-game
	${MV} ${STAGEDIR}${MAN6PREFIX}/man/man6/${prog}.6.gz ${STAGEDIR}${MAN6PREFIX}/man/man6/${prog}-game.6.gz
.endfor

	@${TOUCH} ${STAGEDIR}/var/games/atc_score
	@${FIND} ${STAGEDIR}/var/games -type f -exec ${MV} {} {}.sample \;

.include <bsd.port.mk>