commit:     562a08dca458234a309833c45d861c5386747ed7
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 10 22:45:37 2021 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Jan 10 23:20:35 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=562a08dc

games-fps/duke3d-data: bump to EAPI=7

This is a major overhaul of the ebuild.

Changes:
* Integration of 'games-fps/duke3d-demodata' (will be last-rited)
* Switch to 3DRealms FTP for shareware version.
* Simplify handling of lower- and uppercase files.
* Unpacking all files directly in lowercase.
* Installing shipped maps (_SE, _ST and _ZOO), as they are not present
  in the *.GRP file.
* Updated CDROM_NAME_SET to CDROM_NAMES.
* Updated CD names.

Tested with Duke Nukem 3D Retail 1.3 and Atomic 1.5 CDs, Existing
Install, GOG version and shareware version.

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 games-fps/duke3d-data/Manifest                  |   1 +
 games-fps/duke3d-data/duke3d-data-1.0-r5.ebuild | 111 ++++++++++++++++++++++++
 games-fps/duke3d-data/metadata.xml              |   7 +-
 3 files changed, 118 insertions(+), 1 deletion(-)

diff --git a/games-fps/duke3d-data/Manifest b/games-fps/duke3d-data/Manifest
index af0c417af3b..872c196b345 100644
--- a/games-fps/duke3d-data/Manifest
+++ b/games-fps/duke3d-data/Manifest
@@ -1 +1,2 @@
+DIST 3dduke13.zip 5924374 BLAKE2B 
177329f04defdd2a2ab35a1926a321bbc8de023878ad6bec610669b5578cbe2f38bc0b03a37c0d0d2dcc99acf2b473ddf683b498b971b857b20964bcdbc7d7c8
 SHA512 
eb92daa88b4e7cfeebe1fb3d2c021e0a4a66262d0d6e76b5e27fe3cedd382e381d23b392a6d9adb42a418b9318e011c2d8adfbdc77d7c5371e61d8c091c7eb65
 DIST gog_duke_nukem_3d_atomic_edition_2.0.0.9.sh 31969896 BLAKE2B 
7e93515f8aedaedf6f0dc90faf5e7fef165c000414ae9dc62bad77c78568ecdec1f16b72befe1c80c7c9c8c4bd7fb11f2fd3c36f53aa9ef9d787f8b7215228f3
 SHA512 
d06f20bc1334172b80e4a75bd3321c3835cd95ac823836899fda8d5f8667ac83471b04a5863646aa953a39fd1cb64eb1818ee668340ede62d0a356ebdcb4065c

diff --git a/games-fps/duke3d-data/duke3d-data-1.0-r5.ebuild 
b/games-fps/duke3d-data/duke3d-data-1.0-r5.ebuild
new file mode 100644
index 00000000000..27e3d901411
--- /dev/null
+++ b/games-fps/duke3d-data/duke3d-data-1.0-r5.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CDROM_OPTIONAL="yes"
+MY_PN_DEMO="3dduke"
+MY_PN_GOG="gog_duke_nukem_3d_atomic_edition"
+MY_PV_DEMO="13"
+MY_PV_GOG="2.0.0.9"
+MY_P_DEMO="${MY_PN_DEMO}${MY_PV_DEMO}"
+MY_P_GOG="${MY_PN_GOG}_${MY_PV_GOG}"
+
+inherit cdrom
+
+DESCRIPTION="Duke Nukem 3D (Atomic Edition) data files"
+HOMEPAGE="http://www.3drealms.com/";
+SRC_URI="
+       demo? ( "ftp://ftp.3drealms.com/share/${MY_P_DEMO}.zip"; )
+       gog? ( "${MY_P_GOG}.sh" )
+"
+S="${WORKDIR}"
+
+LICENSE="DUKE3D gog? ( GOG-EULA )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="+demo gog"
+REQUIRED_USE="^^ ( cdinstall demo gog )"
+RESTRICT="bindist gog? ( fetch ) mirror"
+
+BDEPEND="
+       demo? ( app-arch/unzip )
+       gog? ( app-arch/unzip )
+"
+
+pkg_nofetch() {
+       if use gog; then
+               einfo "Please download ${MY_P_GOG}.sh from your GOG.com account 
after"
+               einfo "buying Duke Nukem 3D and place it into your DISTDIR 
directory."
+       fi
+}
+
+src_unpack() {
+       if use cdinstall ; then
+               local CDROM_NAMES=(
+                       "Existing installation"
+                       "Duke Nukem 3D CD"
+                       "Duke Nukem 3D Atomic Edition CD"
+               )
+
+               cdrom_get_cds duke3d.grp:dn3dinst/duke3d.grp:atominst/duke3d.grp
+
+               ! [[ "${CDROM_SET}" -ge 0 && "${CDROM_SET}" -le 2 ]] && die 
"Could not locate data files."
+       fi
+
+       if use demo; then
+               # Use '-LL' to extract everything in lowercase.
+               unzip "${DISTDIR}/${MY_P_DEMO}.zip" || die
+               unzip -LL "DN3DSW${MY_PV_DEMO}.SHR" || die
+       fi
+
+       if use gog; then
+               # Since 'unpacker' eclass does not support options,
+               # doing manual unpack and checking for return code,
+               # as all non-fatal errors should be ignored, because
+               # it's a self-extracting archive and will fail otherwise.
+               # Also use '-LL' to extract everything in lowercase.
+               unzip -LL "${DISTDIR}/${MY_P_GOG}.sh"
+               [[ $? -le 1 ]] || die
+       fi
+}
+
+src_install() {
+       if use cdinstall; then
+               local DATAROOT
+
+               case ${CDROM_SET} in
+                       0) DATAROOT="" ;;
+                       1) DATAROOT="dn3dinst" ;;
+                       2) DATAROOT="atominst" ;;
+               esac
+
+               pushd "${CDROM_ROOT}/${DATAROOT}" || die
+       fi
+
+       if use gog; then
+               pushd "${S}/data/noarch/data" || die
+       fi
+
+       insinto /usr/share/duke3d
+       for file in *.con *.dmo *.grp *.rts; do
+               newins "${file}" "${file,,}"
+       done
+
+       if ! use demo; then
+               if use cdinstall && [[ "${CDROM_SET}" -ne 0 ]]; then
+                       doins ../goodies/build/*.map
+               else
+                       doins *.map
+               fi
+
+               popd || die
+       fi
+}
+
+pkg_postinst() {
+       if use demo; then
+               einfo "Please keep in mind, that many addons for Duke Nukem 3D 
will require"
+               einfo "the registered version and will not work with the 
shareware version."
+       fi
+}

diff --git a/games-fps/duke3d-data/metadata.xml 
b/games-fps/duke3d-data/metadata.xml
index bb71cbd28b6..c4c07706b93 100644
--- a/games-fps/duke3d-data/metadata.xml
+++ b/games-fps/duke3d-data/metadata.xml
@@ -1,11 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
+       <maintainer type="person">
+               <email>conik...@gentoo.org</email>
+               <name>Conrad Kostecki</name>
+       </maintainer>
        <maintainer type="project">
                <email>ga...@gentoo.org</email>
                <name>Gentoo Games Project</name>
        </maintainer>
        <use>
-               <flag name="gog">Extract the data from the GOG.com 
installer.</flag>
+               <flag name="demo">Extract data files from the shareware 
version.</flag>
+               <flag name="gog">Extract data files from the GOG.com 
version.</flag>
        </use>
 </pkgmetadata>

Reply via email to