From 3f7c784fe78b99bf0903e26764336aacc7800f74 Mon Sep 17 00:00:00 2001 From: Mario Sergio Fujikawa Ferreira Date: Tue, 10 Apr 2001 11:13:01 +0000 Subject: - Prepare this port to be a MASTER_PORT - Lowercase PORTNAME - Update MASTER_SISTES - USE_LINUX_PREFIX - Inherit as much as possible from halflifeserver port - Use tweakable variables instead of hardcoded values - PKGNAMEPREFIX with hlserver- - Add a little PERL program that parses the PLIST and installs correctly dirs and files with proper permissions as per halflifeserver port - Remove hardcoded distfile version from COMMENT and DESCR - Add trailing / to WWW tag PR: 26183 Discussed and worked with: maintainer --- games/hlserver-cs/Makefile | 88 +++++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 24 deletions(-) (limited to 'games/hlserver-cs/Makefile') diff --git a/games/hlserver-cs/Makefile b/games/hlserver-cs/Makefile index f5467f1e4b20..26193a4deb82 100644 --- a/games/hlserver-cs/Makefile +++ b/games/hlserver-cs/Makefile @@ -5,36 +5,76 @@ # $FreeBSD$ # -PORTNAME= CS -PORTVERSION= 1.1b +PORTNAME?= cs +PORTVERSION?= 1.1b CATEGORIES= games linux -MASTER_SITES= http://hex.databits.net/~pat/ \ - ftp://ftp.icrontic.com/pub/ \ +MASTER_SITES?= ftp://ftp.icrontic.com/pub/ \ http://flf.playnet.com/ -DISTNAME= cs_11b_full -EXTRACT_ONLY= +PKGNAMEPREFIX= hlserver- +DISTNAME?= cs_11b_full -MAINTAINER= pat@databits.net +MAINTAINER?= pat@databits.net -BUILD_DEPENDS= /compat/linux/lib/ld.so:${PORTSDIR}/emulators/linux_base -RUN_DEPENDS= /compat/linux/usr/i486-linux-libc5/lib/libc.so.5:${PORTSDIR}/emulators/linux_base \ - hlds_l:${PORTSDIR}/games/halflifeserver +RUN_DEPENDS= ${LINUXBASE}${HLDSDIR}${HL_PROGRAM}:${HALFLIFESERVER_PORT} +USE_LINUX_PREFIX= yes NO_CDROM= "Size; the data set is much too big" NO_BUILD= yes -PREFIX= /compat/linux -WRKSRC= ${WRKDIR}/hlds_l -EXTRACT_ONLY_1= cs_11b_full.tar.gz - -HLDSDIR= /usr/games/hlds_l - -do-install: - @cd ${PREFIX}${HLDSDIR} ;\ - for file in ${EXTRACT_ONLY_1}; do \ - if ! (${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$${file} ${EXTRACT_AFTER_ARGS}) ;\ - then \ - exit 1 ;\ - fi \ - done +WRKSRC?= ${WRKDIR}/cstrike +PLIST_SUB= ${PLIST_SUB_MASTER} + +INSTALL_DIR= ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} +SORT?= /usr/bin/sort + +HALFLIFESERVER_PORT= ${.CURDIR}/../halflifeserver +HLDSDIR!= cd ${HALFLIFESERVER_PORT} && ${MAKE} -V HLDSDIR +HL_PROGRAM!= cd ${HALFLIFESERVER_PORT} && ${MAKE} -V HL_PROGRAM +PLIST_SUB_MASTER!= cd ${HALFLIFESERVER_PORT} && ${MAKE} -V PLIST_SUB + +pre-patch: +# remove trailing ^M +.for file in *.cfg */*.cfg *.gam */*.gam *.htm */*.htm \ + *.inf */*.inf *.lst */*.lst *.sc */*.sc \ + *.scr */*.scr *.txt */*.txt + @${PERL} -pi -ne 's!\r\n!\n!' ${WRKDIR}/${file} >/dev/null 2>/dev/null +.endfor + +# if you change the PLIST, please re-think the following +# Parses PLIST +# creates dirs from @dirrm entries +# copies files from non ^@ entries +do-install: install-parse-plist install-run-scripts +# scan libraries + @( cd ${HALFLIFESERVER_PORT} ; ${MAKE} scan-libs ) + +# kaboom, ashes to ashes, .... The problem is dead :) +# Contributed by +install-parse-plist: + @${PERL} -e 'open(FHANDLER,"${PLIST}");' \ + -e 'open(FDIR,">${WRKDIR}/dirs.sh.tmp");' \ + -e 'open(FFILES,">${WRKDIR}/files.sh");' \ + -e 'while (!eof(FHANDLER)) {' \ + -e 'chop($$file = );' \ + -e '$$file =~ s!%%HLDSDIR%%!!;' \ + -e '$$dir = $$file;' \ + -e '$$file =~ s!^\@.+!!;' \ + -e 'print FDIR "${INSTALL_DIR}", \ + " ", "\"${PREFIX}/${HLDSDIR}/$$dir\"", \ + "\n" if $$dir =~ s!(^\@dirrm\s+)!!;' \ + -e 'print FFILES "${INSTALL_DATA}", \ + " ", "\"${WRKDIR}/$$file\"", \ + " ", "\"${PREFIX}/${HLDSDIR}/$$file\"", \ + "\n" if (length($$file) > 0);' \ + -e '}' \ + -e 'close(FFILES);' \ + -e 'close(FDIR);' \ + -e 'close(FHANDLER);' +# we want it sorted + @${SORT} ${WRKDIR}/dirs.sh.tmp > ${WRKDIR}/dirs.sh + +install-run-scripts: +.for script in dirs files + @${SH} ${WRKDIR}/${script}.sh +.endfor .include -- cgit v1.2.3