aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorrafan <rafan@FreeBSD.org>2006-12-17 14:39:59 +0800
committerrafan <rafan@FreeBSD.org>2006-12-17 14:39:59 +0800
commit13da10cc2b8d28704c93c5af9a7c64d7c7ff94f9 (patch)
treed32da0417f377d0629c2bdbb6346e47c0c4ee511 /games
parent0a726e0030fcbdab2772f63cdd828ede77e72805 (diff)
downloadfreebsd-ports-gnome-13da10cc2b8d28704c93c5af9a7c64d7c7ff94f9.tar.gz
freebsd-ports-gnome-13da10cc2b8d28704c93c5af9a7c64d7c7ff94f9.tar.zst
freebsd-ports-gnome-13da10cc2b8d28704c93c5af9a7c64d7c7ff94f9.zip
- Respect DOCSDIR for additional documents
- Install files into PREFIX/lib/PORTNAME - Handle configuration files according to Porter's Handbook - Improve rc.d script - BRANDELF where necessary Suggessted by: acm Submitted by: Alexander Logvinov <ports@logvinov.com> (maintainer)
Diffstat (limited to 'games')
-rw-r--r--games/mtaserver/Makefile41
-rw-r--r--games/mtaserver/files/mtad.in6
-rw-r--r--games/mtaserver/files/pkg-message.in6
-rw-r--r--games/mtaserver/pkg-plist10
4 files changed, 41 insertions, 22 deletions
diff --git a/games/mtaserver/Makefile b/games/mtaserver/Makefile
index ab99be3da03d..125321586d77 100644
--- a/games/mtaserver/Makefile
+++ b/games/mtaserver/Makefile
@@ -6,6 +6,7 @@
PORTNAME= ${MTANAME:L}
PORTVERSION= 0.5
+PORTREVISION= 1
CATEGORIES= games linux
MASTER_SITES= http://files.gonnaplay.com/201/:main \
http://www.trancevibez.com/mta/:both \
@@ -22,23 +23,43 @@ NO_WRKSUBDIR= yes
USE_RC_SUBR= mtad
MTANAME= MTAServer
-FILES= CHANGELOG LICENSE ${PORTNAME} README banned.lst ${PORTNAME}.conf.dist
-PLIST_SUB= MTADIR="${PORTNAME}"
+MTADIR= ${PREFIX}/lib/${PORTNAME}
+PORTDOCS= CHANGELOG LICENSE README
+PLIST_SUB= MTADIR=${MTADIR:S,^${PREFIX}/,,} MTADIRE=${PORTNAME}
SUB_FILES= pkg-message
-SUB_LIST= MTADIR="${PREFIX}/${PORTNAME}"
+SUB_LIST= MTADIR=${MTADIR} MTADIRE=${PORTNAME}
+.if !defined(NOPORTDOCS)
+SUB_LIST+= NOTEWORK="Read ${DOCSDIR}/README for details"
+.else
+SUB_LIST+= NOTEWORK=""
+.endif
-post-patch:
+.include <bsd.port.pre.mk>
+
+post-extract:
@${MV} ${WRKSRC}/${MTANAME} ${WRKSRC}/${PORTNAME}
- @${MV} ${WRKSRC}/${PORTNAME}.conf ${WRKSRC}/${PORTNAME}.conf.dist
- @${CHMOD} 600 ${WRKSRC}/${PORTNAME}.conf.dist
+ @${CHMOD} 600 ${WRKSRC}/${PORTNAME}.conf
+
+post-patch:
+ @${REINPLACE_CMD} "s|banned.lst|${PREFIX}/etc/${PORTNAME}/banned.lst|" ${WRKSRC}/${PORTNAME}.conf
do-install:
- @${MKDIR} ${PREFIX}/${PORTNAME}
-.for i in ${FILES}
- @${CP} -p ${WRKSRC}/${i} ${PREFIX}/${PORTNAME}/${i}
+ ${MKDIR} ${MTADIR}
+ ${BRANDELF} -t Linux ${WRKSRC}/${PORTNAME}
+ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${MTADIR}
+ ${MKDIR} ${PREFIX}/etc/${PORTNAME}
+.if !exists(${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf)
+ ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}
+.endif
+ ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}/${PORTNAME}.conf.dist
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for i in ${PORTDOCS}
+ ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
+.endif
post-install:
@${CAT} ${PKGMESSAGE}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/games/mtaserver/files/mtad.in b/games/mtaserver/files/mtad.in
index 9e1149dfa576..b28e342773c5 100644
--- a/games/mtaserver/files/mtad.in
+++ b/games/mtaserver/files/mtad.in
@@ -19,10 +19,12 @@ load_rc_config $name
: ${mtad_enable="NO"}
: ${mtad_chdir="%%MTADIR%%"}
+: ${mtad_config="%%PREFIX%%/etc/%%MTADIRE%%/mtaserver.conf"}
+: ${mtad_logfile="/var/log/mtaserver.log"}
command="%%MTADIR%%/mtaserver"
-command_args="-b 2>&1 > /dev/null &"
-required_files="%%MTADIR%%/mtaserver.conf"
+command_args="-b -c ${mtad_config} -l ${mtad_logfile} 2>&1 > /dev/null &"
+required_files=${mtad_config}
start_precmd="mtad_prestart"
stop_precmd="mtad_prestop"
diff --git a/games/mtaserver/files/pkg-message.in b/games/mtaserver/files/pkg-message.in
index 58c1f792d468..933f74c0e740 100644
--- a/games/mtaserver/files/pkg-message.in
+++ b/games/mtaserver/files/pkg-message.in
@@ -1,6 +1,4 @@
***********************************************************************
-# cp %%MTADIR%%/mtaserver.conf.dist \
- %%MTADIR%%/mtaserver.conf
-
-Read %%MTADIR%%/README for details
+Edit %%PREFIX%%/etc/%%MTADIRE%%/mtaserver.conf before using
+%%NOTEWORK%%
***********************************************************************
diff --git a/games/mtaserver/pkg-plist b/games/mtaserver/pkg-plist
index 414df341905d..bb4fce4a4516 100644
--- a/games/mtaserver/pkg-plist
+++ b/games/mtaserver/pkg-plist
@@ -1,8 +1,6 @@
-@unexec if cmp -s %D/%%MTADIR%%/mtaserver.conf %D/%%MTADIR%%/mtaserver.conf.dist; then rm -f %D/%%MTADIR%%/mtaserver.conf; fi
-%%MTADIR%%/CHANGELOG
-%%MTADIR%%/LICENSE
+@unexec if cmp -s %D/etc/%%MTADIRE%%/mtaserver.conf %D/etc/%%MTADIRE%%/mtaserver.conf.dist; then rm -f %D/etc/%%MTADIRE%%/mtaserver.conf; fi
%%MTADIR%%/mtaserver
-%%MTADIR%%/README
-%%MTADIR%%/banned.lst
-%%MTADIR%%/mtaserver.conf.dist
+etc/%%MTADIRE%%/mtaserver.conf.dist
+@exec [ -f %B/mtaserver.conf ] || cp %B/%f %B/mtaserver.conf
@dirrmtry %%MTADIR%%
+@dirrmtry etc/%%MTADIRE%%