summaryrefslogtreecommitdiffstats
path: root/games/quake-extras/Makefile
blob: 38d788dd0fbe5791b408780fd0ee7b85ef0568d2 (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# New ports collection makefile for:	quake-extras
# Date created:				10 May 2006
# Whom:					alepulver
#
# $FreeBSD$
#

PORTNAME=	extras
PORTVERSION=	1.0
CATEGORIES=	games
MASTER_SITES=	http://www.fuhquake.net/files/extras/:fq \
		http://gamefiles.blueyonder.co.uk/blueyondergames/quake/quakeworld/clients/fuhquake/addons/:fq \
		http://facelift.quakedev.com/download/:rev
PKGNAMEPREFIX=	${Q1PKGNAMEPREFIX}
DISTFILES=	#
DIST_SUBDIR=	${PKGNAMEPREFIX}${PORTNAME}

MAINTAINER=	alepulver@FreeBSD.org
COMMENT=	Addons for Quake

NO_BUILD=	yes
NO_WRKSUBDIR=	yes

OPTIONS=	LITS "Coloured lighting (FuhQuake/JoeQuake)" on \
		REMODEL "High quality models" on \
		RETEXTURE_HQ "High quality textures (200MB)" off \
		RETEXTURE_OP "Optimal quality textures (50MB)" on \
		SKYBOXES "Skyboxes (sky replacement images)" on

DATADIR=	${Q1DIR}

LITSFILE=	fuhquake-lits.rar
SKINSFILE=	SKINSbmodels-48files-4-23-05.zip
SKYFILE=	fuhquake-skyboxes.zip

.include "${.CURDIR}/../quake-data/Makefile.include"

.include <bsd.port.pre.mk>

.if !defined(WITHOUT_REMODEL) || !defined(WITHOUT_SKYBOXES)
EXTRACT_DEPENDS+=	unzip:${PORTSDIR}/archivers/unzip
.endif

.if !defined(WITHOUT_LITS) || !defined(WITHOUT_RETEXTURE_OP) || \
    defined(WITH_RETEXTURE_HQ)
EXTRACT_DEPENDS+=	unrar:${PORTSDIR}/archivers/unrar
.endif

.if !defined(WITHOUT_LITS)
DISTFILES+=	${LITSFILE}:fq
PLIST_SUB+=	LITS=""
.else
PLIST_SUB+=	LITS="@comment "
.endif

.if !defined(WITHOUT_REMODEL)
DISTFILES+=	${SKINSFILE}:rev
PLIST_SUB+=	REMOD=""
.else
PLIST_SUB+=	REMOD="@comment "
.endif

.if defined(WITH_RETEXTURE_HQ)
TEXFILE=	textures-486files-8-20-05.rar
.elif !defined(WITHOUT_RETEXTURE_OP)
TEXFILE=	textures-486files-8-20-05-low.rar
.endif

.if !defined(WITHOUT_RETEXTURE_OP) || defined(WITH_RETEXTURE_HQ)
DISTFILES+=	${TEXFILE}:rev
PLIST_SUB+=	RETEX=""
.else
PLIST_SUB+=	RETEX="@comment "
.endif

.if !defined(WITHOUT_REMODEL) || !defined(WITHOUT_RETEXTURE_OP) || \
    defined(WITH_RETEXTURE_HQ)
PLIST_SUB+=	TEX_DIR=""
.else
PLIST_SUB+=	TEX_DIR="@comment "
.endif

.if !defined(WITHOUT_SKYBOXES)
DISTFILES+=	${SKYFILE}:fq
EXTRACT_DEPENDS+=	nwreckdum:${PORTSDIR}/archivers/nwreckdum
PLIST_SUB+=	SKYBOX=""
.else
PLIST_SUB+=	SKYBOX="@comment "
.endif

do-extract:
.if !defined(WITHOUT_LITS)
	@${MKDIR} ${WRKDIR}/lits
	@cd ${WRKDIR}/lits && \
		unrar x ${DISTDIR}/${DIST_SUBDIR}/${LITSFILE} >/dev/null
.endif
.if !defined(WITHOUT_REMODEL) || !defined(WITHOUT_RETEXTURE_OP) || \
    defined(WITH_RETEXTURE_HQ)
	@${MKDIR} ${WRKDIR}/textures
.endif
.if !defined(WITHOUT_REMODEL)
	@cd ${WRKDIR}/textures && \
		${UNZIP_CMD} -qo ${DISTDIR}/${DIST_SUBDIR}/${SKINSFILE}
	@${RM} ${WRKDIR}/textures/readme.txt
# Make links for compatibility.
	@cd ${WRKDIR}/textures && \
	for f in `${LS} | ${GREP} -E '[[:alnum:]]+_[[:digit:]]+'`; do \
		${LN} -s $$f `${ECHO_CMD} $$f | ${SED} -E -e 's/([[:alnum:]]+)_.+/\1/'`.mdl_`${ECHO_CMD} $$f | ${SED} -E -e 's/[[:alnum:]]+_(.+)/\1/'`; \
	done
.endif
.if !defined(WITHOUT_RETEXTURE_OP) || defined(WITH_RETEXTURE_HQ)
	@cd ${WRKDIR}/textures && \
		unrar x ${DISTDIR}/${DIST_SUBDIR}/${TEXFILE} >/dev/null
.endif
.if !defined(WITHOUT_SKYBOXES)
	@cd ${WRKDIR} && ${UNZIP_CMD} -qo ${DISTDIR}/${DIST_SUBDIR}/${SKYFILE}
	@nwreckdum -d ${WRKDIR}/skyboxes -p ${WRKDIR}/pakX.pak >/dev/null
.endif

do-install:
.if !defined(WITHOUT_LITS)
	${MKDIR} ${DATADIR}/id1/lits
	${INSTALL_DATA} ${WRKSRC}/lits/* ${DATADIR}/id1/lits
.endif
.if !defined(WITHOUT_REMODEL) || !defined(WITHOUT_RETEXTURE_OP) || \
    defined(WITH_RETEXTURE_HQ)
	${CP} -R ${WRKSRC}/textures ${DATADIR}/id1
.endif
.if !defined(WITHOUT_REMODEL)
	cd ${DATADIR}/id1/textures && \
		${LN} -s . bmodels && ${LN} -s . progs
.endif
.if !defined(WITHOUT_SKYBOXES)
	${CP} -R ${WRKSRC}/skyboxes/* ${DATADIR}/id1
.endif

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud