From df5da138a6221ef17d78d3edc8fd2bd0665e8eee Mon Sep 17 00:00:00 2001 From: Pawel Pekala Date: Fri, 18 Apr 2014 08:09:22 +0000 Subject: - Add staging support - Define DOCS option - Use @sample for config file --- games/sampsvr/Makefile | 42 +++++++++++++------------------------- games/sampsvr/files/pkg-message.in | 2 +- games/sampsvr/pkg-plist | 4 +--- 3 files changed, 16 insertions(+), 32 deletions(-) (limited to 'games') diff --git a/games/sampsvr/Makefile b/games/sampsvr/Makefile index 3b2ca1fff633..c0ddde2ecec2 100644 --- a/games/sampsvr/Makefile +++ b/games/sampsvr/Makefile @@ -3,6 +3,7 @@ PORTNAME= sampsvr PORTVERSION= 0.3c +PORTREVISION= 1 CATEGORIES= games linux MASTER_SITES= http://files.sa-mp.com/ DISTNAME= samp${PORTVERSION:S,.,,}svr @@ -21,44 +22,29 @@ PORTDOCS= LICENSE README PLIST_SUB= SAMPDIR="${SAMPDIR:S,^${PREFIX}/,,}" SUB_FILES= pkg-message SUB_LIST= SAMPDIR="${SAMPDIR}" SAMPBIN=samp03svr -.if !defined(NOPORTDOCS) -SUB_LIST+= NOTEWORK="Read ${DOCSDIR}/README to configure SA-MP Server" -.else -SUB_LIST+= NOTEWORK="" -.endif -NO_STAGE= yes -.include +OPTIONS_DEFINE= DOCS do-install: - ${MKDIR} ${SAMPDIR} + @${MKDIR} ${STAGEDIR}${SAMPDIR} .for i in announce samp-npc samp03svr ${BRANDELF} -t Linux ${WRKSRC}/${i} - ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${SAMPDIR} + ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${STAGEDIR}${SAMPDIR} .endfor - ${MKDIR} ${DATADIR} + @${MKDIR} ${STAGEDIR}${DATADIR} cd ${WRKSRC} && \ ${FIND} . -type d ! -empty -exec \ - ${MKDIR} "${DATADIR}/{}" \; + ${MKDIR} "${STAGEDIR}${DATADIR}/{}" \; .for i in filterscripts gamemodes include npcmodes scriptfiles cd ${WRKSRC} && \ ${FIND} ${i} -type f -exec \ - ${INSTALL_DATA} "{}" "${DATADIR}/{}" \; - ${LN} -sf ${DATADIR}/${i}/ ${SAMPDIR}/${i} + ${INSTALL_DATA} "{}" "${STAGEDIR}${DATADIR}/{}" \; + ${LN} -sf ${DATADIR}/${i} ${STAGEDIR}${SAMPDIR}/${i} .endfor -.if !exists(${PREFIX}/etc/${PORTNAME}.cfg) - ${INSTALL_DATA} ${WRKSRC}/server.cfg ${PREFIX}/etc/${PORTNAME}.cfg -.endif - ${INSTALL_DATA} ${WRKSRC}/server.cfg ${PREFIX}/etc/${PORTNAME}.cfg.dist - ${LN} -sf ${PREFIX}/etc/${PORTNAME}.cfg ${SAMPDIR}/server.cfg -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} -.for i in ${PORTDOCS} - ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR} -.endfor -.endif - -post-install: - @${CAT} ${PKGMESSAGE} + ${INSTALL_DATA} ${WRKSRC}/server.cfg \ + ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.cfg.sample + ${LN} -sf ${PREFIX}/etc/${PORTNAME}.cfg ${STAGEDIR}${SAMPDIR}/server.cfg + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} -.include +.include diff --git a/games/sampsvr/files/pkg-message.in b/games/sampsvr/files/pkg-message.in index 03daa1adf618..b91a9084efd2 100644 --- a/games/sampsvr/files/pkg-message.in +++ b/games/sampsvr/files/pkg-message.in @@ -1,5 +1,5 @@ *********************************************************************** Edit %%PREFIX%%/etc/sampsvr.cfg before using Your password must be changed from the default password -%%NOTEWORK%% +Read %%DOCSDIR%%/README to configure SA-MP Server *********************************************************************** diff --git a/games/sampsvr/pkg-plist b/games/sampsvr/pkg-plist index 1d649a2d9146..4503d0b89055 100644 --- a/games/sampsvr/pkg-plist +++ b/games/sampsvr/pkg-plist @@ -1,6 +1,4 @@ -@unexec if cmp -s %D/etc/sampsvr.cfg %D/etc/sampsvr.cfg.dist; then rm -f %D/etc/sampsvr.cfg; fi -etc/sampsvr.cfg.dist -@exec [ -f %B/sampsvr.cfg ] || cp %B/%f %B/sampsvr.cfg +@sample etc/sampsvr.cfg.sample %%SAMPDIR%%/announce %%SAMPDIR%%/samp-npc %%SAMPDIR%%/samp03svr -- cgit v1.2.3