aboutsummaryrefslogtreecommitdiffstats
path: root/games/quakeserver/Makefile
blob: b8c2637941c2d451ef35cfb2b99f16d30ceafaaa (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
# New ports collection makefile for:    quakeserver
# Version required:         0.991
# Date created:             October 26th 1996
# Whom:                 jfitz@FreeBSD.ORG
#
# $Id: Makefile,v 1.10 1997/04/20 13:19:03 wosch Exp $
#

PKGNAME=    quakeserver-1.0
CATEGORIES= games tk41
MASTER_SITES=   ftp://ftp.idsoftware.com/idstuff/quakeworld/unix/ \
        ftp://ftp.idsoftware.com/idstuff/quake/
DISTFILES=  unixded-1.0-i386-unknown-bsdi3.0.tar.gz \
        quake106.zip
 
MAINTAINER= jfitz@freebsd.org

BUILD_DEPENDS=  unzip:${PORTSDIR}/archivers/unzip \
        lha:${PORTSDIR}/archivers/lha

NO_WRKSUBDIR=   YES
NO_BUILD=   YES
NO_CDROM=   "This software is shareware"

do-extract:
        @ unzip -q -o ${DISTDIR}/quake106.zip -d ${WRKDIR} resource.*
        @ cat ${WRKDIR}/resource.dat ${WRKDIR}/resource.1 > ${WRKDIR}/resource.exe
        @ cd ${WRKDIR}; lha xfq resource.exe id1/pak0.pak
        @ cd ${WRKDIR}; tar zxf ${DISTDIR}/unixded-1.0-i386-unknown-bsdi3.0.tar.gz

do-configure:
        @ ${CP} ${FILESDIR}/readme.port ${WRKSRC}
        @ ${CP} ${FILESDIR}/qserver.sh ${WRKSRC}
        @ ${CP} ${FILESDIR}/stopserver.sh ${WRKSRC}
        @ ${SETENV} ${MAKE_ENV} /usr/bin/perl -pi -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/readme.port ${WRKSRC}/qserver.sh ${WRKSRC}/stopserver.sh

do-install:
        @ ${MKDIR} ${PREFIX}/quakeserver
        @ ${MKDIR} ${PREFIX}/quakeserver/id1
        ${INSTALL_DATA} ${WRKSRC}/id1/pak0.pak ${PREFIX}/quakeserver/id1
        ${INSTALL} -c -o nobody -g nobody -m 0500 ${WRKSRC}/unixded ${PREFIX}/quakeserver
        ${INSTALL_DATA} ${WRKSRC}/readme.unixded ${PREFIX}/quakeserver
        ${INSTALL_DATA} ${WRKSRC}/readme.port ${PREFIX}/quakeserver
        ${INSTALL} -c -o nobody -g nobody -m 0500 ${WRKSRC}/qserver.sh ${PREFIX}/quakeserver
        ${INSTALL} -c -o nobody -g nobody -m 0500 ${WRKSRC}/stopserver.sh ${PREFIX}/quakeserver
        /usr/bin/mkfifo ${PREFIX}/quakeserver/quakeserver.in
        /usr/bin/touch ${PREFIX}/quakeserver/quakeserver.log
        @ /bin/chmod 700 ${PREFIX}/quakeserver/quakeserver.in ${PREFIX}/quakeserver/quakeserver.log
        @ /usr/sbin/chown -R nobody.nobody ${PREFIX}/quakeserver
        @ echo "Installing ${PREFIX}/etc/rc.d/quakeserver.sh startup script"
        @ echo "#!/bin/sh" > ${PREFIX}/etc/rc.d/quakeserver.sh
        @ echo "#" >> ${PREFIX}/etc/rc.d/quakeserver.sh
        @ echo "" >> ${PREFIX}/etc/rc.d/quakeserver.sh
        @ echo "if [ -x ${PREFIX}/quakeserver/unixded ]" >> ${PREFIX}/etc/rc.d/quakeserver.sh
        @ echo "then" >> ${PREFIX}/etc/rc.d/quakeserver.sh
        @ echo "    su nobody -c ${PREFIX}/quakeserver/qserver.sh &" >> ${PREFIX}/etc/rc.d/quakeserver.sh
        @ echo "fi" >> ${PREFIX}/etc/rc.d/quakeserver.sh
        @ /bin/chmod 750 ${PREFIX}/etc/rc.d/quakeserver.sh
.if !defined(BATCH)
        @ /usr/bin/more -e ${PREFIX}/quakeserver/readme.port
.endif
        
.include <bsd.port.mk>