aboutsummaryrefslogtreecommitdiffstats
path: root/games/quakeforge/Makefile
blob: 62e78dcbdfead7d51d9916518c0779d21afa1c25 (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
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
138
139
140
141
142
143
# New ports collection makefile for:    QuakeForge
# Version required: 0.10.0
# Date created:     4 January 2000
# Whom:         darius@dons.net.au
#
# $FreeBSD$
#

DISTNAME=   quakeforge
PKGNAME=    QuakeForge-0.10.0pre
CATEGORIES= games
# ${MASTER_SITES} is only for if CVS won't work, period.
MASTER_SITES=   http://www.gsoft.com.au/~doconnor/

MAINTAINER= darius@dons.net.au

.if defined(USE_GLX)
LIB_DEPENDS=    GL.1:${PORTSDIR}/graphics/glx
.else
CONFIGURE_ARGS+= --without-opengl
.endif

.include <bsd.port.pre.mk>
CAT?=       /bin/cat
DISTFILES!= ${CAT} ${FILESDIR}/distfiles

CVS_CMD?=   cvs -z3
CVS_DATE=   Tue Jan 4 03:20:17 GMT 2000
SED?=       /usr/bin/sed
CVS_DATE_!= ${ECHO} -n "${CVS_DATE}" | ${SED} 's/[ \t:]/_/g'
CVS_SITES=  :pserver:anonymous@cvs.quake.sourceforge.net:/cvsroot/quake
STAMPFILE=  ${DISTDIR}/${PKGNAME}/.stamp
WRKSRC=     ${WRKDIR}/quakeforge
USE_GMAKE=  yes
USE_AUTOCONF=   yes
USE_XLIB=   yes
PLIST=      ${WRKDIR}/PLIST

pre-fetch:
.if !defined(USE_GLX)
    @${ECHO_MSG} "Define USE_GLX to use GLX (otherwise it is explicitly disabled!)"
.endif

.if defined(BATCH)
do-fetch: fetchsrctarball
.else
do-fetch:
    @if [ ! -e ${STAMPFILE} ] || \
        [ "X${CVS_DATE}" != "X$$(${CAT} ${STAMPFILE})" ]; then \
        ${ECHO_MSG} "No stamp file (or out of date)"; \
        if [ -e ${DISTDIR}/${PKGNAME}.${CVS_DATE_}.tar.gz ]; then \
            cd ${DISTDIR}; \
            ${TAR} xfz ${PKGNAME}.${CVS_DATE_}.tar.gz \
                ${DISTFILES}; \
            ${ECHO} -n "${CVS_DATE}" > ${STAMPFILE}; \
            exit; \
        fi; \
        unset CVS_RSH CVS_SERVER CVS_LOGIN || ${TRUE}; \
        if [ -n "${PORTS_CVS_RSH}" ]; then \
            export CVS_RSH="${PORTS_CVS_RSH}"; \
        fi; \
        ${MKDIR} ${DISTDIR}/${PKGNAME} && \
        cd ${DISTDIR}/${PKGNAME}; \
        for CVS_SITE in ${CVS_SITES}; do \
            ${ECHO_MSG} ">> Attempting to CVS checkout from $${CVS_SITE}."; \
            case "$${CVS_SITE}" in \
            :pserver:*) \
                CVS_LOGIN=yes; \
                ;; \
            *) \
                CVS_LOGIN=no; \
                ;; \
            esac; \
            if [ "X$${CVS_LOGIN}" = "Xyes" ]; then \
                ${ECHO_MSG} ">>** Please hit enter here for the password."; \
                ${CVS_CMD} -d $${CVS_SITE} login < /dev/null; \
            fi; \
            if ${CVS_CMD} -d $${CVS_SITE} co -D "${CVS_DATE}" \
                ${DISTNAME}; then \
                if [ "X$${CVS_LOGIN}" = "Xyes" ]; then \
                    ${CVS_CMD} -d $${CVS_SITE} logout < /dev/null; \
                fi; \
                ${ECHO} -n ${CVS_DATE} > ${STAMPFILE}; \
                exit; \
            fi; \
            if [ "X$${CVS_LOGIN}" = "Xyes" ]; then \
                ${CVS_CMD} -d $${CVS_SITE} logout < /dev/null; \
            fi; \
        done; \
        ${ECHO_MSG} ">> Couldn't CVS checkout ${PKGNAME}.  Please try to retrieve"; \
        ${ECHO_MSG} ">> a snapshot with \"make fetchsrctarball\" and try again."; \
        exit 1; \
    fi
.endif

makesrctarball: fetch
    @cd ${DISTDIR}; \
    ${ECHO_MSG} ">> Creating source tarball in ${DISTDIR}"; \
    ${ECHO_MSG} ">> \"${PKGNAME}.${CVS_DATE_}.tar.gz\"."; \
    ${TAR} cfz ${PKGNAME}.${CVS_DATE_}.tar.gz ${PKGNAME}

fetchsrctarball:
    @cd ${DISTDIR}; \
    file=${PKGNAME}.${CVS_DATE_}.tar.gz; \
    if [ -e $$file ]; then \
        exit; \
    fi; \
    ${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
    for site in ${MASTER_SITES}; do \
        ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
        if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} \
            $${site}$${file}; then \
            exit; \
        fi; \
    done; \
    ${ECHO_MSG} ">> Couldn't fetch $$file."; \
    ${ECHO_MSG} ">> Please try to retrieve this file manually into"; \
    ${ECHO_MSG" ">> ${_DISTDIR} and try again."; \
    exit 1 ;

do-extract:
    @${MKDIR} ${WRKDIR}
    @${CP} -r ${DISTDIR}/${PKGNAME}/${DISTNAME} ${WRKDIR}

pre-configure:
    @${CP} ${PKGDIR}/PLIST ${PLIST}
.if defined(USE_GLX)
    ${CAT} ${PKGDIR}/PLIST.glx >>${PLIST}
.endif
    cd ${WRKSRC}; \
    autoheader;

BINARIES=   quake-x11 qw-client-x11 qw-server
.if defined(USE_GLX)
BINARIES+=  quake-gl qw-client-gl
.endif

do-install:
.for binary in ${BINARIES}
    ${INSTALL_PROGRAM} ${WRKSRC}/targets/${binary} ${PREFIX}/bin/
.endfor

.include <bsd.port.post.mk>