1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
9 # define own package name
10 MY_PN="PenumbraCollection"
12 DESCRIPTION="Scary first-person adventure game trilogy which focuses on story, immersion and puzzles"
13 HOMEPAGE="http://www.penumbragame.com/"
14 SRC_URI="${MY_PN}-${PV}.sh"
16 LICENSE="PENUMBRA-COLLECTION"
20 PROPERTIES="interactive"
21 RESTRICT="fetch strip"
23 DEPEND="|| ( app-arch/xz-utils app-arch/lzma-utils )"
24 RDEPEND="virtual/opengl
28 media-gfx/nvidia-cg-toolkit
32 media-libs/libvorbis )
34 app-emulation/emul-linux-x86-sdl )"
36 GAMES_CHECK_LICENSE="yes"
37 dir=${GAMES_PREFIX_OPT}/${MY_PN}
38 INSTALL_KEY_FILE=${dir}/collectionkey
43 einfo "Please buy & download ${SRC_URI} from:"
45 einfo "and move it to ${DISTDIR}"
50 unpack_makeself || die "unpack installator"
52 # give proper extension to subarchive so unpack recognizes it
53 mv subarch subarch.tar.lzma || die "rename subarch"
55 unpack ./subarch.tar.lzma || die "unpack install archive"
57 # give proper extension to install archive so unpack recognizes it
58 mv instarchive_all instarchive_all.tar.lzma || \
59 die "rename instarchive_all"
61 unpack ./instarchive_all.tar.lzma || die "unpack install archive"
66 # perform instalation for each episode; note that Requiem is extension of
67 # Black Plague so it has no dedicated directory at this level
68 for episodeDir in Overture BlackPlague; do
69 local destDir="${dir}/${episodeDir}"
71 # install game data files
74 # >install every directory recursively except lib
76 $(find ${episodeDir}/* -maxdepth 0 -type d ! -name lib); do
77 doins -r ${directory} || die "doins game data files"
81 doins ${episodeDir}/*.cfg || die "doins .cfg files"
83 # install libraries and executables
85 doexe ${episodeDir}/openurl.sh ${episodeDir}/*.bin || \
88 # >amd64 does not provide some libs, use bundled ones
90 exeinto "${dir}/${episodeDir}/lib"
95 doexe ${episodeDir}/lib/${library} || die "doexe libraries"
99 # make sure that cache files are newer than models otherwise the game
100 # tries to regenerate them which sometimes causes a crash (as reported
101 # in bug #278326 comment #6)
102 touch ${D}/${destDir}/core/*cache/*
106 newicon Overture/penumbra.png penumbra-overture.png || \
107 die "newicon overture"
108 newicon BlackPlague/penumbra.png penumbra-blackplague.png || \
109 die "newicon black plague"
110 newicon BlackPlague/requiem.png penumbra-requiem.png || \
111 die "newicon requiem"
114 games_make_wrapper penumbra-overture ./penumbra.bin \
115 "${dir}/Overture" "${dir}/Overture/lib" || \
116 die "games_make_wrapper overture"
117 games_make_wrapper penumbra-blackplague ./blackplague.bin \
118 "${dir}/BlackPlague" "${dir}/BlackPlague/lib" || \
119 die "games_make_wrapper black plague"
120 games_make_wrapper penumbra-requiem ./requiem.bin \
121 "${dir}/BlackPlague" "${dir}/BlackPlague/lib" || \
122 die "games_make_wrapper requiem"
124 # make desktop entries
125 make_desktop_entry penumbra-overture "Penumbra: Overture" \
126 penumbra-overture || die "make_desktop_entry overture"
127 make_desktop_entry penumbra-blackplague "Penumbra: Black Plague" \
128 penumbra-blackplague || die "make_desktop_entry black plague"
129 make_desktop_entry penumbra-requiem "Penumbra: Requiem" \
130 penumbra-requiem || die "make_desktop_entry requiem"
132 # install documentation
134 dodoc Overture/CHANGELOG.txt Overture/Manual.pdf Overture/README.linux || \
137 dodoc BlackPlague/Manual.pdf BlackPlague/README.linux || \
138 die "dodoc black plague"
146 if [[ -f "${INSTALL_KEY_FILE}" ]] ; then
147 einfo "The installation key file already exists: ${INSTALL_KEY_FILE}"
149 ewarn "You MUST run this before playing the game:"
150 ewarn " emerge --config ${PN}"
151 ewarn "To enter your installation key."
158 ewarn "Your installation key is NOT checked for validity here."
159 ewarn "Make sure you type it in correctly."
160 ewarn "If you CTRL+C out of this, the game will not run!"
162 einfo "The key format is: XXXX-XXXX-XXXX-XXXX"
164 einfo "Please enter your key:"
166 if [[ -z "${key1}" ]] ; then
167 echo "You entered a blank key. Try again."
170 einfo "Please re-enter your key:"
172 if [[ -z "${key2}" ]] ; then
173 echo "You entered a blank key. Try again."
177 if [[ "${key1}" == "${key2}" ]] ; then
178 echo "${key1}" | tr a-z A-Z > "${INSTALL_KEY_FILE}"
179 echo -e "// Do not give this file to ANYONE.\n// Frictional Games Support will NEVER ask for this file" \
180 >> "${INSTALL_KEY_FILE}"
181 einfo "Thanks, created ${INSTALL_KEY_FILE}"
184 eerror "Your installation key entries do not match. Try again."