summaryrefslogtreecommitdiff
path: root/japanese/rogue_s/Makefile
blob: 30939e099c20f8b7dc541e41cdfb224c78f13f40 (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
# Created by: Yoshihiko Sarumaru <mistral@imasy.or.jp>
# $FreeBSD$

PORTNAME=	rogue_s
PORTVERSION=	1.3a
PORTREVISION=	2
CATEGORIES=	japanese games
MASTER_SITES=	${MASTER_SITE_LOCAL} \
		${MASTER_SITE_PORTS_JP:S,/%SUBDIR%/,/,}
MASTER_SITE_SUBDIR=	knu
DISTFILES=	rogue_s.tar.z rogue_s.patch02.z rogue_s.patch03.z \
		rogue_s.message.z
EXTRACT_ONLY=	rogue_s.tar.z

PATCH_SITES=	${MASTER_SITE_LOCAL} \
		${MASTER_SITE_PORTS_JP:S,/%SUBDIR%/,/,}
PATCH_SITE_SUBDIR=	knu
PATCHFILES=	rogue_s.patch04

MAINTAINER=	sarumaru@jp.FreeBSD.org
COMMENT=	Japanized and message separated version of Rogue-clone: Version II

.if !defined(NOPORTDATA)
BUILD_DEPENDS=	nkf:${PORTSDIR}/japanese/nkf
.endif

WRKSRC=		${WRKDIR}/${PORTNAME}
MAKEFILE=	Makefile.nix
ALL_TARGET=	rogue
MAKE_ENV+=	DATADIR="${DATADIR}"

SUB_FILES=	rogue_s.6
MAN6=		rogue_s.6
MANLANG=	ja
MANCOMPRESSED=	no

PLIST_FILES=	bin/rogue_s
PORTDATA=	mesg mesg_E mesg_fj mesg_utmc
PORTDOCS=	README README.1st README.doc options.doc rogue.doc

NO_STAGE=	yes
pre-patch:
	@(\
	  cd ${WRKSRC} ; \
	  ${GZCAT} ${DISTDIR}/rogue_s.patch02.z | uudecode -p | ${PATCH} --quiet ;\
	  ${GZCAT} ${DISTDIR}/rogue_s.patch03.z | ${PATCH} --quiet \
	)

post-build:
.if !defined(NOPORTDATA)
	${GZCAT} ${FILESDIR}/mesg_fj.gz > ${WRKDIR}/mesg_fj
	@(\
	  cd ${WRKDIR} ; \
	  ${GZCAT} ${DISTDIR}/rogue_s.message.z | \
		${AWK} '{if (/^\#/) x++} {if(x) print $$0}' | ${SH} \
	)
	nkf -e ${WRKDIR}/mesg_utmc > ${WRKDIR}/mesg_utmc.euc
.endif

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/rogue ${PREFIX}/bin/rogue_s
	${INSTALL_MAN} ${WRKDIR}/rogue_s.6 ${MAN6PREFIX}/man/ja/man6/rogue_s.6

.if !defined(NOPORTDATA)
	${MKDIR} ${DATADIR}
	${INSTALL_DATA} ${WRKSRC}/mesg ${DATADIR}
	${INSTALL_DATA} ${WRKSRC}/mesg_E ${DATADIR}
	${INSTALL_DATA} ${WRKDIR}/mesg_fj ${DATADIR}
	${INSTALL_DATA} ${WRKDIR}/mesg_utmc.euc ${DATADIR}/mesg_utmc
.endif

.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
	for _file in ${PORTDOCS}; do \
		${INSTALL_DATA} ${WRKSRC}/"$$_file" ${DOCSDIR} ; \
	done
.endif

.include <bsd.port.mk>