aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Engels <lme@FreeBSD.org>2013-10-04 21:54:54 +0000
committerLars Engels <lme@FreeBSD.org>2013-10-04 21:54:54 +0000
commit8ce1e06af3717555b17ebbb86f1b4f7fea5f721b (patch)
treee8d8cdf0df16b8d694ab32f911bf04b752606aa8
parent91ac7b8d7b1a6aa39db361f6911dee617812be68 (diff)
- Support staging
- Use REINPLACE_CMD, COPYTREE_SHARE and SUB_FILES instead of copying, chmodding, chowning and replacing manually
Notes
Notes: svn path=/head/; revision=329394
-rw-r--r--games/thudboard/Makefile28
-rw-r--r--games/thudboard/files/thudboard2
-rw-r--r--games/thudboard/files/thudboard.in2
-rw-r--r--games/thudboard/pkg-plist62
4 files changed, 48 insertions, 46 deletions
diff --git a/games/thudboard/Makefile b/games/thudboard/Makefile
index 300181cc167d..3a6f0a5a098d 100644
--- a/games/thudboard/Makefile
+++ b/games/thudboard/Makefile
@@ -15,23 +15,25 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinte
NO_WRKSUBDIR= yes
USE_PYTHON= yes
-NO_STAGE= yes
-do-configure:
- @${SED} -e "s#%%PREFIX%%#${PREFIX}# ; s#%%PYTHON_CMD%%#${PYTHON_CMD}#" \
- ${FILESDIR}/thudboard > ${WRKDIR}/thudboard.tmp
+SUB_FILES= thudboard
+
+post-patch:
+ ${REINPLACE_CMD} -e 's|file:.*/docs|file://${DOCSDIR}|' \
+ ${WRKDIR}/thud.py
do-build:
@${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${WRKSRC} 2>/dev/null
do-install:
- ${INSTALL_SCRIPT} ${WRKDIR}/thudboard.tmp ${PREFIX}/bin/thudboard
- @${MKDIR} ${DATADIR}
- ${INSTALL_DATA} ${WRKSRC}/*.py ${DATADIR}
- ${INSTALL_DATA} ${WRKSRC}/*.pyc ${DATADIR}
- @${TAR} -C ${WRKSRC} -cf - docs koomvalley img | \
- ${TAR} -C ${DATADIR} --unlink -xf -
- @${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DATADIR}
- @${FIND} ${DATADIR} -type f | ${XARGS} ${CHMOD} ${SHAREMODE}
- @${FIND} ${DATADIR} -type d | ${XARGS} ${CHMOD} a+rx
+ ${INSTALL_SCRIPT} ${WRKDIR}/thudboard ${STAGEDIR}${PREFIX}/bin/thudboard
+ @${MKDIR} ${STAGEDIR}${DATADIR}
+ @${INSTALL_DATA} ${WRKSRC}/*.py ${STAGEDIR}${DATADIR}
+ @${INSTALL_DATA} ${WRKSRC}/*.pyc ${STAGEDIR}${DATADIR}
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ @(cd ${WRKDIR}/docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
+. for d in koomvalley img
+ @${MKDIR} ${STAGEDIR}${DATADIR}/${d}
+ @(cd ${WRKDIR}/${d} && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/${d})
+. endfor
.include <bsd.port.mk>
diff --git a/games/thudboard/files/thudboard b/games/thudboard/files/thudboard
deleted file mode 100644
index 16aa42ce407e..000000000000
--- a/games/thudboard/files/thudboard
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-cd %%PREFIX%%/share/thudboard && %%PYTHON_CMD%% thud.pyc $*
diff --git a/games/thudboard/files/thudboard.in b/games/thudboard/files/thudboard.in
new file mode 100644
index 000000000000..5b73c3920c9c
--- /dev/null
+++ b/games/thudboard/files/thudboard.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+cd %%PREFIX%%/share/thudboard && python thud.pyc $*
diff --git a/games/thudboard/pkg-plist b/games/thudboard/pkg-plist
index e8335f0330f5..a4ef2a17bcb5 100644
--- a/games/thudboard/pkg-plist
+++ b/games/thudboard/pkg-plist
@@ -1,34 +1,34 @@
bin/thudboard
+%%PORTDOCS%%%%DOCSDIR%%/about.html
+%%PORTDOCS%%%%DOCSDIR%%/download.html
+%%PORTDOCS%%%%DOCSDIR%%/howto.html
+%%PORTDOCS%%%%DOCSDIR%%/img/battleline.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/bcktile.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/copyicon.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/dwarf.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/filemenu.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/helpmenu.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/moveinprogress.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/movepiece.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/optionsmenu.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/pasteicon.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/quicksavemenu.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/quit.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/rock.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/selectname.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/singleline.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/thudpreview.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/thudscreen.jpg
+%%PORTDOCS%%%%DOCSDIR%%/img/thudscroll.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/troll.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/valid-xhtml11.gif
+%%PORTDOCS%%%%DOCSDIR%%/img/vcss.gif
+%%PORTDOCS%%%%DOCSDIR%%/index.html
+%%PORTDOCS%%%%DOCSDIR%%/thudboard.css
%%DATADIR%%/battle.py
%%DATADIR%%/battle.pyc
%%DATADIR%%/bugfix_askyesno.py
%%DATADIR%%/bugfix_askyesno.pyc
-%%DATADIR%%/docs/about.html
-%%DATADIR%%/docs/download.html
-%%DATADIR%%/docs/howto.html
-%%DATADIR%%/docs/img/battleline.gif
-%%DATADIR%%/docs/img/bcktile.gif
-%%DATADIR%%/docs/img/copyicon.gif
-%%DATADIR%%/docs/img/dwarf.gif
-%%DATADIR%%/docs/img/filemenu.gif
-%%DATADIR%%/docs/img/helpmenu.gif
-%%DATADIR%%/docs/img/moveinprogress.gif
-%%DATADIR%%/docs/img/movepiece.gif
-%%DATADIR%%/docs/img/optionsmenu.gif
-%%DATADIR%%/docs/img/pasteicon.gif
-%%DATADIR%%/docs/img/quicksavemenu.gif
-%%DATADIR%%/docs/img/quit.gif
-%%DATADIR%%/docs/img/rock.gif
-%%DATADIR%%/docs/img/selectname.gif
-%%DATADIR%%/docs/img/singleline.gif
-%%DATADIR%%/docs/img/thudpreview.gif
-%%DATADIR%%/docs/img/thudscreen.jpg
-%%DATADIR%%/docs/img/thudscroll.gif
-%%DATADIR%%/docs/img/troll.gif
-%%DATADIR%%/docs/img/valid-xhtml11.gif
-%%DATADIR%%/docs/img/vcss.gif
-%%DATADIR%%/docs/index.html
-%%DATADIR%%/docs/thudboard.css
%%DATADIR%%/img/banner.gif
%%DATADIR%%/img/bcktile.gif
%%DATADIR%%/img/board-grid.gif
@@ -64,8 +64,8 @@ bin/thudboard
%%DATADIR%%/texts.pyc
%%DATADIR%%/thud.py
%%DATADIR%%/thud.pyc
-@dirrm %%DATADIR%%/img
-@dirrm %%DATADIR%%/koomvalley
-@dirrm %%DATADIR%%/docs/img
-@dirrm %%DATADIR%%/docs
-@dirrm %%DATADIR%%
+@dirrmtry %%DATADIR%%/koomvalley
+@dirrmtry %%DATADIR%%/img
+@dirrmtry %%DATADIR%%
+%%PORTDOCS%%@dirrmtry %%DOCSDIR%%/img
+%%PORTDOCS%%@dirrmtry %%DOCSDIR%%