Import games/rocksndiamonds-data version 20130322
[dports.git] / games / rocksndiamonds-data / Makefile
1 # Created by: nemysis <nemysis@gmx.ch>
2 # $FreeBSD: games/rocksndiamonds-data/Makefile 314981 2013-03-23 02:31:44Z beech $
3
4 PORTNAME=       rocksndiamonds-data
5 PORTVERSION=    20130322
6 CATEGORIES=     games
7 MASTER_SITES+=  http://www.artsoft.org/RELEASES/rocksndiamonds/levels/:levels \
8                 http://www.artsoft.org/RELEASES/unix/rocksndiamonds/levels/:unix_levels \
9                 http://www.bd-fans.com/Files/RnD/Levels/
10 DISTFILES=      ZeldaII-1.0.0.zip:levels \
11                 Zelda-1.0.0.zip:levels \
12                 Emerald_Mine_Club-2.1.1.7z:levels \
13                 Snake_Bite-1.0.0.zip:levels \
14                 BD2K3-1.0.0.zip:levels \
15                 rockslevels-sp-1.0.tar.gz:unix_levels \
16                 rockslevels-dx-1.0.tar.gz:unix_levels \
17                 Boulder_Dash_Dream-1.0.0.zip:levels \
18                 ${LEVELS_BD_FANS:S/$/.zip/} \
19                 Tutorial_Alpha.zip \
20                 Puzzles_v1.8.zip
21 DIST_SUBDIR=    rocksndiamonds
22 EXTRACT_ONLY=   #empty
23
24 MAINTAINER=     nemysis@gmx.ch
25 COMMENT=        Additional Player Levels for Rocks'n'Diamonds and R'n'D jue
26
27 EXTRACT_DEPENDS+=${UNZIP_CMD}:${PORTSDIR}/archivers/unzip \
28                 7z:${PORTSDIR}/archivers/p7zip
29
30 NO_BUILD=       yes
31 NO_WRKSUBDIR=   yes
32
33 SUB_FILES=      pkg-message pkg-deinstall
34
35 LEVELS_ARTSOFT= zelda zelda2 Emerald_Mine_Club Snake_Bite BD2K3 \
36                 DX_Boulderdash Supaplex Boulder_Dash_Dream
37
38 LEVELS_BD_FANS= 42_Steps Alans_Random_Levels Alexanders_Levels Arcade_Levels \
39                 Be_a_bug Contest_Levels Danilo_Parantar_Serrano Danilo_Parantar_Serrano_2 \
40                 Hard_Skills Haspeton  Learning_Maths Little_Games \
41                 Magic_CEs Manuel Manuels_Sokoban_Levels Master-Rocks Memory \
42                 Mini_Levels_Ryan Missions Mixed_Levels Mixed_Levels_2 MultiRandomLevel \
43                 My_Levels_of_Fun Negundo_World_2 Negundo_World_3 P98_Level_Pack_1 \
44                 Pacman Random_Games Rocks_n_Diamonds_Fun Ryans_Random_Levels Slippery_Ground \
45                 Space_Invaders Space_Invaders_2 Springlis_Levels Stinky Super_BD-Rock \
46                 Super_Comic_Levels Venatir Veysi_Orak_2006 Warparound_Murphy
47
48 OPTIONS_SINGLE= SYMLINK
49 OPTIONS_SINGLE_SYMLINK= RnD RnD_jue
50
51 OPTIONS_DEFAULT=        RnD_jue
52
53 RnD_DESC=       Levels default for Rocks'n'Diamonds
54 RnD_jue_DESC=   Levels default for R'n'D jue
55
56 PREFIX=         /usr/local
57
58 .include <bsd.port.options.mk>
59
60 .if ${PORT_OPTIONS:MRnD}
61 RUN_DEPENDS+=   rocksndiamonds:${PORTSDIR}/games/rocksndiamonds
62 DATADIR=        ${PREFIX}/share/rocksndiamonds
63 DATADIR1=       ${PREFIX}/share/rnd_jue
64 .endif
65
66 .if ${PORT_OPTIONS:MRnD_jue}
67 RUN_DEPENDS+=   rnd_jue:${PORTSDIR}/games/rnd_jue
68 DATADIR=        ${PREFIX}/share/rnd_jue
69 DATADIR1=       ${PREFIX}/share/rocksndiamonds
70 .endif
71
72 post-extract-script:
73         ${MKDIR} ${WRKDIR}/${PORTNAME}
74         7z x ${_DISTDIR}/Emerald_Mine_Club-2.1.1.7z -o${WRKDIR}/${PORTNAME}
75 .for l in ZeldaII-1.0.0.zip Zelda-1.0.0.zip Snake_Bite-1.0.0.zip BD2K3-1.0.0.zip \
76                 Boulder_Dash_Dream-1.0.0.zip
77         @${UNZIP_CMD} -qo -d ${WRKDIR}/${PORTNAME} ${_DISTDIR}/${l}
78 .endfor
79
80 .for l in rockslevels-sp-1.0.tar.gz rockslevels-dx-1.0.tar.gz
81         @${TAR} xfjp ${_DISTDIR}/${l} -C ${WRKDIR}/${PORTNAME}
82 .endfor
83         @(cd ${WRKDIR}/${PORTNAME}/levels && ${MV} * .. && cd .. && ${RMDIR} levels)
84 .for l in DX_Boulderdash Supaplex
85         @${FIND} ${WRKDIR}/${PORTNAME}/${l} -name '*.level' | ${XARGS} ${CHMOD} 644
86 .endfor
87
88 .for l in ${LEVELS_BD_FANS:S/$/.zip/} Puzzles_v1.8.zip
89         @${UNZIP_CMD} -qo -d ${WRKDIR}/${PORTNAME} ${_DISTDIR}/${l}
90 .endfor
91         @${UNZIP_CMD} -qo -d ${WRKDIR}/${PORTNAME}/Tutorials ${_DISTDIR}/Tutorial_Alpha.zip
92                 @(cd ${WRKDIR}/${PORTNAME}/Tutorials && ${MV} "Tutorial Alpha" rnd_tutorial_alpha)
93         @(cd ${WRKDIR}/${PORTNAME} && ${MV} "Alan's_Random_Levels" Alans_Random_Levels)
94         @(cd ${WRKDIR}/${PORTNAME} && ${MV} "Veysi Orak 2006" Veysi_Orak_2006)
95         @${RM} -f ${WRKDIR}/${PORTNAME}/Readme.txt
96
97 do-install:
98         @(cd ${WRKDIR}/${PORTNAME} && ${COPYTREE_SHARE} . ${DATADIR}/levels)
99
100 post-install:
101 # Dynamically generate part of the PLIST, because the Levels are large
102 .for l in ${LEVELS_ARTSOFT}
103         @${FIND} ${DATADIR}/levels/${l}/ ! -type d | ${SED} 's|^${PREFIX}/||' >> ${TMPPLIST}
104         @${FIND} -ds ${DATADIR}/levels/${l}/ -type d | \
105                 ${SED} -E -e 's,(.*),@unexec ${RMDIR} "\1" 2>/dev/null || true,' >> ${TMPPLIST}
106 .endfor
107
108 .for l in ${LEVELS_BD_FANS} Puzzles
109         @${FIND} ${DATADIR}/levels/${l}/ ! -type d | ${SED} 's|^${PREFIX}/||' >> ${TMPPLIST}
110         @${FIND} -ds ${DATADIR}/levels/${l}/ -type d | \
111                 ${SED} -E -e 's,(.*),@unexec ${RMDIR} "\1" 2>/dev/null || true,' >> ${TMPPLIST}
112 .endfor
113         @${FIND} ${DATADIR}/levels/Tutorials/rnd_tutorial_alpha/ ! -type d | ${SED} 's|^${PREFIX}/||' >> ${TMPPLIST}
114         @${FIND} -ds ${DATADIR}/levels/Tutorials/rnd_tutorial_alpha/ -type d | \
115                 ${SED} -E -e 's,(.*),@unexec ${RMDIR} "\1" 2>/dev/null || true,' >> ${TMPPLIST}
116
117 # Symlink Levels which can use Rocks'n'Diamonds and R'n'D jue
118 .if exists(${PREFIX}/share/rocksndiamonds) && ${PORT_OPTIONS:MRnD_jue}
119 .for l in ${LEVELS_ARTSOFT} ${LEVELS_BD_FANS} Puzzles
120                 @${LN} -sf ${DATADIR}/levels/${l} ${PREFIX}/share/rocksndiamonds/levels
121 .endfor
122                 @${LN} -sf ${DATADIR}/levels/Tutorials/rnd_tutorial_alpha ${PREFIX}/share/rocksndiamonds/levels/Tutorials
123 .endif
124
125 .if exists(${PREFIX}/share/rnd_jue) && ${PORT_OPTIONS:MRnD}
126 .for l in ${LEVELS_ARTSOFT} ${LEVELS_BD_FANS} Puzzles
127                 @${LN} -sf ${DATADIR}/levels/${l} ${PREFIX}/share/rnd_jue/levels
128 .endfor
129                 @${LN} -sf ${DATADIR}/levels/Tutorials/rnd_tutorial_alpha ${PREFIX}/share/rnd_jue/levels/Tutorials
130 .endif
131
132         @${ECHO_CMD}
133         @${CAT} ${PKGMESSAGE}
134         @${ECHO_CMD}
135
136 .include <bsd.port.mk>