summaryrefslogtreecommitdiff
path: root/games-strategy/settlers-2-gold-data
diff options
context:
space:
mode:
Diffstat (limited to 'games-strategy/settlers-2-gold-data')
-rw-r--r--games-strategy/settlers-2-gold-data/Manifest3
-rw-r--r--games-strategy/settlers-2-gold-data/metadata.xml8
-rw-r--r--games-strategy/settlers-2-gold-data/settlers-2-gold-data-0.ebuild96
3 files changed, 107 insertions, 0 deletions
diff --git a/games-strategy/settlers-2-gold-data/Manifest b/games-strategy/settlers-2-gold-data/Manifest
new file mode 100644
index 000000000000..075d5c9601fa
--- /dev/null
+++ b/games-strategy/settlers-2-gold-data/Manifest
@@ -0,0 +1,3 @@
+DIST setup_the_settlers_2_gold_1.5.1_(30319).exe 306652144 BLAKE2B d415d47e68c07b891c099d1a626f8b0641a49c5acd06953aa1280ddef2b4e7b360ee09739bae3b8489cf23c3e38e2a3d60311f360a0b3e5acf7884833380ae86 SHA512 743c2ab9eee293ec82178dac38c142366de4ef1a4c46517d30b457513bcbacf5f14d5309a2e357dd4785e439598266d90ce1c27e23165112e8f304a48f23d110
+EBUILD settlers-2-gold-data-0.ebuild 2327 BLAKE2B b70b506610696db7e49bccb49e1e5f1300a236250025501144230646cd691f2d58fad6e8c31fecc3103b62af245b6a501cf84c1a18083a9bf1755221da52de29 SHA512 c9d6ade3f3d1ed079fa4cd107106cb132849274d629ad9cffb69e6b3471d63d5b20e4673286e638b3b34303c8d2b1f71cf2ec4d5498a721ecfa7d5cf2d2d8cac
+MISC metadata.xml 253 BLAKE2B 443ca9c8d4f6801169382e87a0ecd1385c56e65229209e7200f9d313ef380e92ae8d7dc3c38e5989a4166289f22607a20b1e13bb960fff6b3d9f78629d8ab020 SHA512 61c4689cbc649d84a00be211b7b5b98dd03e1d3f813eff370df549f2998cd4343f391c18b57cf20e4a8f4dd2311e3bfa04eb60f356f2bbac78f0b68f5091f254
diff --git a/games-strategy/settlers-2-gold-data/metadata.xml b/games-strategy/settlers-2-gold-data/metadata.xml
new file mode 100644
index 000000000000..26079e608bed
--- /dev/null
+++ b/games-strategy/settlers-2-gold-data/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/games-strategy/settlers-2-gold-data/settlers-2-gold-data-0.ebuild b/games-strategy/settlers-2-gold-data/settlers-2-gold-data-0.ebuild
new file mode 100644
index 000000000000..dc17a23f065a
--- /dev/null
+++ b/games-strategy/settlers-2-gold-data/settlers-2-gold-data-0.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CDROM_OPTIONAL="yes"
+inherit cdrom estack
+
+# For GOG install
+MY_EXE="setup_the_settlers_2_gold_1.5.1_(30319).exe"
+
+DESCRIPTION="Data files for The Settlers II: Gold Edition"
+HOMEPAGE="https://www.gog.com/game/the_settlers_2_gold_edition"
+# There are non-English GOG downloads but RTTR uses its own translations.
+SRC_URI="!cdinstall? ( ${MY_EXE} )"
+LICENSE="!cdinstall? ( GOG-EULA ) cdinstall? ( all-rights-reserved )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+RESTRICT="bindist !cdinstall? ( fetch )"
+
+RDEPEND="
+ games-strategy/s25rttr
+"
+
+BDEPEND="
+ !cdinstall? ( >=app-arch/innoextract-1.8 )
+"
+
+S="${WORKDIR}/target"
+
+pkg_nofetch() {
+ einfo "Please buy and download ${MY_EXE} from:"
+ einfo " https://www.gog.com/game/the_settlers_2_gold_edition"
+ einfo "and move it to your distfiles directory."
+ echo
+ einfo "If you wish to install from CD-ROM instead, please enable the cdinstall flag."
+}
+
+dotar() {
+ eshopts_push -s globstar nocaseglob nullglob
+
+ # Uppercase
+ # Avoid copying files twice
+ # Don't include *.ENG or *.GER files as they are unused by RTTR
+
+ tar c \
+ --mode=u+w \
+ --ignore-case \
+ --xform='s:.*:\U\0:x' \
+ --exclude-from=<(find "${S}"/ -type f -printf "%P\n" 2>/dev/null) \
+ {DATA,GFX}/**/*.{BBM,BOB,DAT,FNT,IDX,LBM,LST,RTX,WLD} \
+ | tar x -C "${S}"
+
+ assert "tar failed"
+ eshopts_pop
+}
+
+src_unpack() {
+ unset CDROM_SET
+ mkdir -p "${S}" || die
+
+ if use cdinstall; then
+ default
+ cdrom_get_cds S2/GFX/PICS/MISSION/AFRICA.LBM:GFX/PICS/MISSION/AFRICA.LBM:S2/GFX/PICS/SETUP010.LBM ::S2/S2/GFX/PICS/MISSION/AFRICA.LBM
+
+ case ${CDROM_SET} in
+ 0)
+ einfo "Found The Settlers II: Gold Edition CD"
+ cd "${CDROM_ROOT}"/[Ss]2 || die ;;
+ 1)
+ einfo "Found The Settlers II: Gold Edition installation"
+ cd "${CDROM_ROOT}" || die ;;
+ 2)
+ einfo "Found The Settlers II: Veni, Vidi, Vici CD"
+ cd "${CDROM_ROOT}/"[Ss]2 || die ;;
+ esac
+ else
+ einfo "Unpacking ${MY_EXE}."
+ innoextract -e -s -p1 -I DATA -I GFX -d gog "${DISTDIR}/${MY_EXE}" || die
+ cd gog || die
+ fi
+
+ dotar
+
+ if [[ ${CDROM_SET} == 2 ]]; then
+ cdrom_load_next_cd
+ einfo "Found The Settlers II: Mission CD"
+ cd "${CDROM_ROOT}"/[Ss]2/[Ss]2 || die
+ dotar
+ fi
+}
+
+src_install() {
+ insinto /usr/share/s25rttr/S2
+ doins -r *
+}