1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

Support staging.

This commit is contained in:
Thierry Thomas 2014-04-11 20:11:13 +00:00
parent 5c8180c45b
commit 895173cc47
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=351037
3 changed files with 34 additions and 15 deletions

View File

@ -32,24 +32,25 @@ PLIST_SUB= SCOREDIR=${SCOREDIR}
DESKTOP_ENTRIES="Monsterz" "${COMMENT}" "${PORTNAME}" \
"${PORTNAME}" "Game;ArcadeGame;" false
NO_STAGE= yes
OPTIONS_DEFINE= DOCS
.include <bsd.port.options.mk>
post-install:
.for d in graphics sound
@(cd ${WRKSRC} && ${COPYTREE_SHARE} ${d} ${DATADIR})
(cd ${WRKSRC} && ${COPYTREE_SHARE} ${d} ${STAGEDIR}${DATADIR})
.endfor
${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME}.py ${DATADIR}
@${PYTHON_CMD} -m compileall ${DATADIR}
@${PYTHON_CMD} -O -m compileall ${DATADIR}
${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png ${PREFIX}/share/pixmaps/
${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME}.py ${STAGEDIR}${DATADIR}
(cd ${STAGEDIR}${PREFIX} \
&& ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py -d ${DATADIR} \
-f ${DATADIR:S;${PREFIX}/;;} \
&& ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py -d ${DATADIR}\
-f ${DATADIR:S;${PREFIX}/;;})
${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png ${STAGEDIR}${PREFIX}/share/pixmaps/
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/monsterz
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR}
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
.endif
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
--- Makefile.orig 2007-12-17 23:05:00.000000000 +0100
+++ Makefile 2013-08-19 08:57:30.000000000 +0200
+++ Makefile 2014-04-11 21:13:39.000000000 +0200
@@ -1,8 +1,8 @@
-prefix = /usr/local
@ -22,12 +22,26 @@
bitmap: $(BITMAP)
@@ -50,7 +50,7 @@
@@ -42,17 +42,17 @@
install: all
mkdir -p $(DESTDIR)$(gamesdir)
cp monsterz $(DESTDIR)$(gamesdir)/
- chown root:games $(DESTDIR)$(gamesdir)/monsterz
- chmod g+s $(DESTDIR)$(gamesdir)/monsterz
+ #chown root:games $(DESTDIR)$(gamesdir)/monsterz
+ #chmod g+s $(DESTDIR)$(gamesdir)/monsterz
mkdir -p $(DESTDIR)$(pkgdatadir)/graphics
mkdir -p $(DESTDIR)$(pkgdatadir)/sound
cp monsterz.py $(DESTDIR)$(pkgdatadir)/
cp $(BITMAP) $(DESTDIR)$(pkgdatadir)/graphics/
cp $(SOUND) $(MUSIC) $(DESTDIR)$(pkgdatadir)/sound/
mkdir -p $(DESTDIR)$(scoredir)
- test -f $(DESTDIR)$(scorefile) || echo "" > $(DESTDIR)$(scorefile)
- chown root:games $(DESTDIR)$(scorefile)
- chmod g+w $(DESTDIR)$(scorefile)
+ test -f $(DESTDIR)$(scorefile) || /usr/bin/touch $(DESTDIR)$(scorefile)
chown root:games $(DESTDIR)$(scorefile)
chmod g+w $(DESTDIR)$(scorefile)
+ #chown root:games $(DESTDIR)$(scorefile)
+ #chmod g+w $(DESTDIR)$(scorefile)
uninstall:
rm -f $(DESTDIR)$(gamesdir)/monsterz

View File

@ -1,4 +1,8 @@
@group games
@mode 2555
bin/monsterz
@mode
@group
%%DATADIR%%/graphics/background.png
%%DATADIR%%/graphics/bigtiles.png
%%DATADIR%%/graphics/board.png
@ -26,5 +30,5 @@ share/pixmaps/monsterz.png
@dirrm %%DATADIR%%/graphics
@dirrm %%DATADIR%%
@exec if [ ! -e %%SCOREDIR%% ] ; then mkdir -p -m 775 %%SCOREDIR%% ; fi
@exec [ -e %%SCOREDIR%%/monsterz ] || touch %%SCOREDIR%%/monsterz && chmod 664 %%SCOREDIR%%/monsterz && chgrp games %%SCOREDIR%%/monsterz
@unexec if [ ! -s %%SCOREDIR%%/monsterz ] ; then rm -f %%SCOREDIR%%/monsterz && rm -r %%SCOREDIR%% || true ; fi
@exec [ -e %%SCOREDIR%%/monsterz ] || touch %%SCOREDIR%%/monsterz && chmod 664 %%SCOREDIR%%/monsterz && chgrp games %%SCOREDIR%%/monsterz