summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>2019-05-14 00:54:49 +0900
committerJames Le Cuirot <chewi@gentoo.org>2020-08-26 17:03:35 +0100
commitee8b2f04fc1a9202e9541d1070ef50946854a0d1 (patch)
tree07e98104a89d1fa315a37360fff3e70cafe23201 /games-fps/chocolate-doom
parentapp-text/lesspipe: bump to v1.85 (diff)
downloadgentoo-ee8b2f04fc1a9202e9541d1070ef50946854a0d1.tar.gz
gentoo-ee8b2f04fc1a9202e9541d1070ef50946854a0d1.tar.bz2
gentoo-ee8b2f04fc1a9202e9541d1070ef50946854a0d1.zip
games-fps/chocolate-doom: New package
Closes: https://bugs.gentoo.org/147329 Bug: https://bugs.gentoo.org/729214 Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/12011 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'games-fps/chocolate-doom')
-rw-r--r--games-fps/chocolate-doom/Manifest1
-rw-r--r--games-fps/chocolate-doom/chocolate-doom-3.0.1.ebuild86
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Add-support-for-usr-share-doom-IWAD-search-path.patch27
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Fix-Python-check.patch54
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Introduce-configure-options-for-bash-completion-doc-.patch171
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Remove-redundant-demoextend-definition.patch28
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-AppStream-XML-files-to-current-0.11-standards.patch106
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-documentation-about-usr-share-doom-IWAD-locat.patch39
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-to-latest-AppStream-formerly-AppData-standard.patch119
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-Build-from-actual-shell-script-templ.patch53
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-always-install-into-datadir-bash-com.patch61
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-run-docgen-with-z-argument.patch25
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-configure-add-AM_PROG_AR-macro.patch28
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-further-manpage-substitutions-and-fixes.patch322
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-install-AppStream-metadata-into-the-proper-location.patch26
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-overhaul-manpages-add-parameters.patch695
-rw-r--r--games-fps/chocolate-doom/files/chocolate-doom-3.0.1-use-reverse-DNS-naming-for-installing-.desktop-files.patch162
-rw-r--r--games-fps/chocolate-doom/metadata.xml27
18 files changed, 2030 insertions, 0 deletions
diff --git a/games-fps/chocolate-doom/Manifest b/games-fps/chocolate-doom/Manifest
new file mode 100644
index 000000000000..86587c978d8d
--- /dev/null
+++ b/games-fps/chocolate-doom/Manifest
@@ -0,0 +1 @@
+DIST chocolate-doom-3.0.1.tar.gz 2245563 BLAKE2B 0c9babfbc9e52ea7822ca00c0dbf84e471bfe6d6ec94f729d3d0f72243205b060e5a3b5f1f99728da7764e81af735b45d001bb368dd2b5796666554e3c911090 SHA512 2a81905cf619ea2def7e2f9ebe65b38543d01bd83a95e535e88d04a79f2676f8ba0da64031a650bd905e1345cda1b9d28a398ad87c10c92f2d3d50f3253ec214
diff --git a/games-fps/chocolate-doom/chocolate-doom-3.0.1.ebuild b/games-fps/chocolate-doom/chocolate-doom-3.0.1.ebuild
new file mode 100644
index 000000000000..5809e2bf6321
--- /dev/null
+++ b/games-fps/chocolate-doom/chocolate-doom-3.0.1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8} )
+
+inherit autotools prefix python-any-r1 xdg
+
+DESCRIPTION="A Doom source port that is minimalist and historically accurate"
+HOMEPAGE="https://www.chocolate-doom.org"
+SRC_URI="https://github.com/${PN}/${PN}/archive/${P}.tar.gz"
+
+LICENSE="BSD GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="bash-completion doc libsamplerate +midi png vorbis"
+
+DEPEND="
+ media-libs/libsdl2[video]
+ media-libs/sdl2-mixer[midi?,vorbis?]
+ media-libs/sdl2-net
+ libsamplerate? ( media-libs/libsamplerate )
+ png? ( media-libs/libpng:= )"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ bash-completion? ( ${PYTHON_DEPS} )
+ doc? ( ${PYTHON_DEPS} )"
+
+S="${WORKDIR}/${PN}-${P}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-overhaul-manpages-add-parameters.patch"
+ "${FILESDIR}/${P}-further-manpage-substitutions-and-fixes.patch"
+ "${FILESDIR}/${P}-bash-completion-run-docgen-with-z-argument.patch"
+ "${FILESDIR}/${P}-install-AppStream-metadata-into-the-proper-location.patch"
+ "${FILESDIR}/${P}-Update-AppStream-XML-files-to-current-0.11-standards.patch"
+ "${FILESDIR}/${P}-bash-completion-Build-from-actual-shell-script-templ.patch"
+ "${FILESDIR}/${P}-configure-add-AM_PROG_AR-macro.patch"
+ "${FILESDIR}/${P}-bash-completion-always-install-into-datadir-bash-com.patch"
+ "${FILESDIR}/${P}-Update-to-latest-AppStream-formerly-AppData-standard.patch"
+ "${FILESDIR}/${P}-use-reverse-DNS-naming-for-installing-.desktop-files.patch"
+ "${FILESDIR}/${P}-Remove-redundant-demoextend-definition.patch"
+ "${FILESDIR}/${P}-Introduce-configure-options-for-bash-completion-doc-.patch"
+ "${FILESDIR}/${P}-Add-support-for-usr-share-doom-IWAD-search-path.patch"
+ "${FILESDIR}/${P}-Update-documentation-about-usr-share-doom-IWAD-locat.patch"
+ "${FILESDIR}/${P}-Fix-Python-check.patch"
+)
+
+DOCS=(
+ "AUTHORS"
+ "ChangeLog"
+ "NEWS.md"
+ "NOT-BUGS.md"
+ "PHILOSOPHY.md"
+ "README.md"
+ "README.Music.md"
+ "README.Strife.md"
+)
+
+src_prepare() {
+ default
+
+ hprefixify src/d_iwad.c
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable bash-completion) \
+ $(use_enable doc) \
+ --disable-fonts \
+ --disable-icons \
+ $(use_with libsamplerate) \
+ $(use_with png libpng)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # Remove redundant documentation files
+ rm -r "${ED}/usr/share/doc/"* || die
+
+ einstalldocs
+}
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Add-support-for-usr-share-doom-IWAD-search-path.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Add-support-for-usr-share-doom-IWAD-search-path.patch
new file mode 100644
index 000000000000..719ec12a93dc
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Add-support-for-usr-share-doom-IWAD-search-path.patch
@@ -0,0 +1,27 @@
+From 405662edfda15bd4ba2a6e32023eeb8c5e73646f Mon Sep 17 00:00:00 2001
+From: William Breathitt Gray <vilhelm.gray@gmail.com>
+Date: Thu, 25 Jun 2020 11:13:55 -0400
+Subject: [PATCH] Add support for /usr/share/doom IWAD search path
+
+Some Linux distros such as Gentoo have deprecated the /usr/share/games
+directory. IWADs are typically installed under the /usr/share directory
+for these distros.
+---
+ src/d_iwad.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/d_iwad.c b/src/d_iwad.c
+index 09853a64..e112e4f4 100644
+--- a/src/d_iwad.c
++++ b/src/d_iwad.c
+@@ -657,6 +657,7 @@ static void AddXdgDirs(void)
+ // source ports is /usr/share/games/doom - we support this through the
+ // XDG_DATA_DIRS mechanism, through which it can be overridden.
+ AddIWADPath(env, "/games/doom");
++ AddIWADPath(env, "/doom");
+
+ // The convention set by RBDOOM-3-BFG is to install Doom 3: BFG
+ // Edition into this directory, under which includes the Doom
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Fix-Python-check.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Fix-Python-check.patch
new file mode 100644
index 000000000000..8d4f169bd03e
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Fix-Python-check.patch
@@ -0,0 +1,54 @@
+From ab1a38d8e902baebc7183fb511bd58c50e2b4571 Mon Sep 17 00:00:00 2001
+From: William Breathitt Gray <vilhelm.gray@gmail.com>
+Date: Mon, 24 Aug 2020 09:03:57 -0400
+Subject: [PATCH] Fix Python check for doc, bash-completion, fonts, and icons
+ options
+
+Fixes: cfc56fa6 ("Introduce configure options for bash-completion, doc, fonts, and icons")
+---
+ configure.ac | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9bef517a..4dbd2db7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -40,7 +40,7 @@ AC_ARG_ENABLE([bash-completion],
+ AS_HELP_STRING([--disable-bash-completion], [Disable bash-completion])
+ )
+ AS_IF([test "x$enable_bash_completion" != xno], [
+- AS_IF([test HAVE_PYTHON = false], [
++ AS_IF([test "x$HAVE_PYTHON" = xfalse], [
+ AC_MSG_WARN([Building bash-completion requires Python, but Python not found])
+ enable_bash_completion=no
+ ])
+@@ -51,7 +51,7 @@ AC_ARG_ENABLE([doc],
+ AS_HELP_STRING([--disable-doc], [Disable documentation])
+ )
+ AS_IF([test "x$enable_doc" != xno], [
+- AS_IF([test HAVE_PYTHON = false], [
++ AS_IF([test "x$HAVE_PYTHON" = xfalse], [
+ AC_MSG_WARN([Building documentation requires Python, but Python not found])
+ enable_doc=no
+ ])
+@@ -62,7 +62,7 @@ AC_ARG_ENABLE([fonts],
+ AS_HELP_STRING([--disable-fonts], [Disable fonts])
+ )
+ AS_IF([test "x$enable_fonts" != xno], [
+- AS_IF([test HAVE_PYTHON = false], [
++ AS_IF([test "x$HAVE_PYTHON" = xfalse], [
+ AC_MSG_WARN([Building fonts require Python, but Python not found])
+ enable_fonts=no
+ ])
+@@ -73,7 +73,7 @@ AC_ARG_ENABLE([icons],
+ AS_HELP_STRING([--disable-icons], [Disable icons])
+ )
+ AS_IF([test "x$enable_icons" != xno], [
+- AS_IF([test HAVE_PYTHON = false], [
++ AS_IF([test "x$HAVE_PYTHON" = xfalse], [
+ AC_MSG_WARN([Building icons require Python, but Python not found])
+ enable_icons=no
+ ])
+--
+2.28.0
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Introduce-configure-options-for-bash-completion-doc-.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Introduce-configure-options-for-bash-completion-doc-.patch
new file mode 100644
index 000000000000..bb1e000460a5
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Introduce-configure-options-for-bash-completion-doc-.patch
@@ -0,0 +1,171 @@
+From cfc56fa6a5809c2dbc7276df3579836e586d9193 Mon Sep 17 00:00:00 2001
+From: William Breathitt Gray <vilhelm.gray@gmail.com>
+Date: Tue, 23 Jun 2020 12:56:01 -0400
+Subject: [PATCH] Introduce configure options for bash-completion, doc, fonts,
+ and icons
+
+This patch introduces the --enable-bash-completion, --enable-doc,
+--enable-fonts, and --enable-icons configuration options to control the
+build of bash-completion, documentation, fonts, and icons respectively.
+This is useful for users of systems such as Gentoo which allow custom
+configuration of packages, or for package maintainers in general who
+would like finer control over the components built when compiling
+Chocolate Doom.
+---
+ Makefile.am | 2 +-
+ configure.ac | 49 ++++++++++++++++++++++++++++++++-
+ man/Makefile.am | 2 +-
+ man/bash-completion/Makefile.am | 2 +-
+ src/Makefile.am | 2 +-
+ src/setup/Makefile.am | 2 +-
+ textscreen/fonts/Makefile.am | 2 +-
+ 7 files changed, 54 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 1bd91a43..70f2e5b9 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -50,7 +50,7 @@ SUBDIRS=textscreen midiproc opl pcsound data src man
+
+ DIST_SUBDIRS=pkg $(SUBDIRS)
+
+-if HAVE_PYTHON
++if HAVE_DOC
+
+ INSTALL : man/INSTALL.template man/simplecpp
+ ./man/simplecpp -DDOOM -DHERETIC -DHEXEN -DSTRIFE \
+diff --git a/configure.ac b/configure.ac
+index 8e18a0e9..9bef517a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -35,6 +35,50 @@ PKG_CHECK_MODULES(SDL, [sdl2 >= 2.0.1])
+ PKG_CHECK_MODULES(SDLMIXER, [SDL2_mixer >= 2.0.0])
+ PKG_CHECK_MODULES(SDLNET, [SDL2_net >= 2.0.0])
+
++# Check for bash-completion.
++AC_ARG_ENABLE([bash-completion],
++AS_HELP_STRING([--disable-bash-completion], [Disable bash-completion])
++)
++AS_IF([test "x$enable_bash_completion" != xno], [
++ AS_IF([test HAVE_PYTHON = false], [
++ AC_MSG_WARN([Building bash-completion requires Python, but Python not found])
++ enable_bash_completion=no
++ ])
++])
++
++# Check for doc.
++AC_ARG_ENABLE([doc],
++AS_HELP_STRING([--disable-doc], [Disable documentation])
++)
++AS_IF([test "x$enable_doc" != xno], [
++ AS_IF([test HAVE_PYTHON = false], [
++ AC_MSG_WARN([Building documentation requires Python, but Python not found])
++ enable_doc=no
++ ])
++])
++
++# Check for fonts.
++AC_ARG_ENABLE([fonts],
++AS_HELP_STRING([--disable-fonts], [Disable fonts])
++)
++AS_IF([test "x$enable_fonts" != xno], [
++ AS_IF([test HAVE_PYTHON = false], [
++ AC_MSG_WARN([Building fonts require Python, but Python not found])
++ enable_fonts=no
++ ])
++])
++
++# Check for icons.
++AC_ARG_ENABLE([icons],
++AS_HELP_STRING([--disable-icons], [Disable icons])
++)
++AS_IF([test "x$enable_icons" != xno], [
++ AS_IF([test HAVE_PYTHON = false], [
++ AC_MSG_WARN([Building icons require Python, but Python not found])
++ enable_icons=no
++ ])
++])
++
+ # Check for libsamplerate.
+ AC_ARG_WITH([libsamplerate],
+ AS_HELP_STRING([--without-libsamplerate],
+@@ -106,7 +150,10 @@ AS_IF([test "x$enable_werror" = "xyes"], [
+ ])
+
+ AM_CONDITIONAL(HAVE_WINDRES, test "$WINDRES" != "")
+-AM_CONDITIONAL(HAVE_PYTHON, $HAVE_PYTHON)
++AM_CONDITIONAL(HAVE_BASH_COMPLETION, [test "x$enable_bash_completion" != xno])
++AM_CONDITIONAL(HAVE_DOC, [test "x$enable_doc" != xno])
++AM_CONDITIONAL(HAVE_FONTS, [test "x$enable_fonts" != xno])
++AM_CONDITIONAL(HAVE_ICONS, [test "x$enable_icons" != xno])
+
+ dnl Automake v1.8.0 is required, please upgrade!
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 915cb206..5a886fc9 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -15,7 +15,7 @@ hereticdocsdir = ${docdir}/../${PROGRAM_PREFIX}heretic
+ hexendocsdir = ${docdir}/../${PROGRAM_PREFIX}hexen
+ strifedocsdir = ${docdir}/../${PROGRAM_PREFIX}strife
+
+-if HAVE_PYTHON
++if HAVE_DOC
+
+ GENERATED_MAN_PAGES = \
+ @PROGRAM_PREFIX@doom.6 \
+diff --git a/man/bash-completion/Makefile.am b/man/bash-completion/Makefile.am
+index 9c1400f1..a79fe623 100644
+--- a/man/bash-completion/Makefile.am
++++ b/man/bash-completion/Makefile.am
+@@ -6,7 +6,7 @@ BASH_COMPLETION_TEMPLATES = \
+ hexen.template \
+ strife.template
+
+-if HAVE_PYTHON
++if HAVE_BASH_COMPLETION
+
+ BASH_COMPLETION_SCRIPTLETS = \
+ @PROGRAM_PREFIX@doom \
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 19a42598..698d2ce0 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -271,7 +271,7 @@ CLEANFILES = $(execgames_SCRIPTS) $(app_DATA) $(screensaver_DATA)
+ %.o : %.rc
+ $(WINDRES) $< -o $@
+
+-if HAVE_PYTHON
++if HAVE_ICONS
+
+ icon.c : $(top_builddir)/data/doom.png
+ $(top_builddir)/data/convert-icon $(top_builddir)/data/doom.png $@
+diff --git a/src/setup/Makefile.am b/src/setup/Makefile.am
+index a9dd240c..493b0b47 100644
+--- a/src/setup/Makefile.am
++++ b/src/setup/Makefile.am
+@@ -33,7 +33,7 @@ CLEANFILES = $(app_DATA)
+ @PACKAGE_RDNS@.Setup.desktop : Setup.desktop
+ cp Setup.desktop $@
+
+-if HAVE_PYTHON
++if HAVE_ICONS
+
+ setup_icon.c : $(top_builddir)/data/setup.png
+ $(top_builddir)/data/convert-icon $(top_builddir)/data/setup.png $@
+diff --git a/textscreen/fonts/Makefile.am b/textscreen/fonts/Makefile.am
+index 67ae8a21..5f6ad066 100644
+--- a/textscreen/fonts/Makefile.am
++++ b/textscreen/fonts/Makefile.am
+@@ -3,7 +3,7 @@ EXTRA_DIST = small.png normal.png large.png convert-font $(FONT_HDRS)
+
+ noinst_DATA = $(FONT_HDRS)
+
+-if HAVE_PYTHON
++if HAVE_FONTS
+
+ small.h: small.png convert-font
+ ./convert-font small small.png small.h
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Remove-redundant-demoextend-definition.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Remove-redundant-demoextend-definition.patch
new file mode 100644
index 000000000000..9c087769a26c
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Remove-redundant-demoextend-definition.patch
@@ -0,0 +1,28 @@
+From a8fd4b1f563d24d4296c3e8225c8404e2724d4c2 Mon Sep 17 00:00:00 2001
+From: Jordan Christiansen <xordspar0@gmail.com>
+Date: Sun, 15 Mar 2020 16:55:33 -0500
+Subject: [PATCH] Remove redundant demoextend definition
+
+GCC 10 enables -fno-common by default, which causes the linker to fail when
+there are multple definitions of a global variable.
+
+See https://gcc.gnu.org/gcc-10/porting_to.html
+---
+ src/hexen/mn_menu.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c
+index 059f45b3..a97b7fcd 100644
+--- a/src/hexen/mn_menu.c
++++ b/src/hexen/mn_menu.c
+@@ -131,7 +131,6 @@ boolean MenuActive;
+ int InfoType;
+ int messageson = true;
+ boolean mn_SuicideConsole;
+-boolean demoextend; // from h2def.h
+
+ // PRIVATE DATA DEFINITIONS ------------------------------------------------
+
+--
+2.28.0
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-AppStream-XML-files-to-current-0.11-standards.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-AppStream-XML-files-to-current-0.11-standards.patch
new file mode 100644
index 000000000000..7c2bfa48de29
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-AppStream-XML-files-to-current-0.11-standards.patch
@@ -0,0 +1,106 @@
+From 35827930553ca522270bd74df37a378d6b2dea8a Mon Sep 17 00:00:00 2001
+From: Mike Swanson <mikeonthecomputer@gmail.com>
+Date: Mon, 22 Jan 2018 20:41:16 -0800
+Subject: [PATCH] Update AppStream XML files to current (0.11) standards
+
+<id> tag is changed to a Reverse-DNS form, and an accommodating
+PACKAGE_RDNS is set in configure.ac to use it.
+
+<name> and <summary> tags have been added, using existing autoconf
+variable values.
+
+The `appstream-util validate` command will complain about some
+optionally-missing tags and a strict string length limit on some of
+the <caption> tags. `validate-relax` passes, and by the letter of the
+AppStream specification, we should be completely valid.
+---
+ configure.ac | 2 ++
+ src/doom.appdata.xml.in | 4 +++-
+ src/heretic.appdata.xml.in | 4 +++-
+ src/hexen.appdata.xml.in | 4 +++-
+ src/strife.appdata.xml.in | 4 +++-
+ 5 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 17299714..2190a32b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -7,6 +7,7 @@ PACKAGE_COPYRIGHT="Copyright (C) 1993-2017"
+ PACKAGE_LICENSE="GNU General Public License, version 2"
+ PACKAGE_MAINTAINER="Simon Howard"
+ PACKAGE_URL="https://www.chocolate-doom.org/"
++PACKAGE_RDNS="org.chocolate_doom"
+ PACKAGE_ISSUES="https://github.com/chocolate-doom/chocolate-doom/issues"
+
+ AC_CONFIG_AUX_DIR(autotools)
+@@ -142,6 +143,7 @@ AC_SUBST(PACKAGE_COPYRIGHT)
+ AC_SUBST(PACKAGE_LICENSE)
+ AC_SUBST(PACKAGE_MAINTAINER)
+ AC_SUBST(PACKAGE_URL)
++AC_SUBST(PACKAGE_RDNS)
+ AC_SUBST(PACKAGE_ISSUES)
+
+ AC_SUBST(bashcompletiondir)
+diff --git a/src/doom.appdata.xml.in b/src/doom.appdata.xml.in
+index ed499f47..42747251 100644
+--- a/src/doom.appdata.xml.in
++++ b/src/doom.appdata.xml.in
+@@ -1,7 +1,9 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+
+ <component type="desktop">
+- <id>@PROGRAM_PREFIX@doom.desktop</id>
++ <id>@PACKAGE_RDNS@.Doom</id>
++ <name>@PACKAGE_SHORTNAME@ Doom</name>
++ <summary>@PACKAGE_SHORTDESC@</summary>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <developer_name>@PACKAGE_MAINTAINER@</developer_name>
+diff --git a/src/heretic.appdata.xml.in b/src/heretic.appdata.xml.in
+index 36a1739a..dc8093de 100644
+--- a/src/heretic.appdata.xml.in
++++ b/src/heretic.appdata.xml.in
+@@ -1,7 +1,9 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+
+ <component type="desktop">
+- <id>@PROGRAM_PREFIX@heretic.desktop</id>
++ <id>@PACKAGE_RDNS@.Heretic</id>
++ <name>@PACKAGE_SHORTNAME@ Heretic</name>
++ <summary>@PACKAGE_SHORTDESC@</summary>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <developer_name>@PACKAGE_MAINTAINER@</developer_name>
+diff --git a/src/hexen.appdata.xml.in b/src/hexen.appdata.xml.in
+index b5a526f2..7583cca8 100644
+--- a/src/hexen.appdata.xml.in
++++ b/src/hexen.appdata.xml.in
+@@ -1,7 +1,9 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+
+ <component type="desktop">
+- <id>@PROGRAM_PREFIX@hexen.desktop</id>
++ <id>@PACKAGE_RDNS@.Hexen</id>
++ <name>@PACKAGE_SHORTNAME@ Hexen</name>
++ <summary>@PACKAGE_SHORTDESC@</summary>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <developer_name>@PACKAGE_MAINTAINER@</developer_name>
+diff --git a/src/strife.appdata.xml.in b/src/strife.appdata.xml.in
+index 7be869c3..6db4fad4 100644
+--- a/src/strife.appdata.xml.in
++++ b/src/strife.appdata.xml.in
+@@ -1,7 +1,9 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+
+ <component type="desktop">
+- <id>@PROGRAM_PREFIX@strife.desktop</id>
++ <id>@PACKAGE_RDNS@.Strife</id>
++ <name>@PACKAGE_SHORTNAME@ Strife</name>
++ <summary>@PACKAGE_SHORTDESC@</summary>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <developer_name>@PACKAGE_MAINTAINER@</developer_name>
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-documentation-about-usr-share-doom-IWAD-locat.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-documentation-about-usr-share-doom-IWAD-locat.patch
new file mode 100644
index 000000000000..90cd352a5874
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-documentation-about-usr-share-doom-IWAD-locat.patch
@@ -0,0 +1,39 @@
+From: William Breathitt Gray <vilhelm.gray@gmail.com>
+Date: Thu, 25 Jun 2020 11:30:42 -0400
+Subject: [PATCH] Update documentation about /usr/share/doom IWAD location
+
+---
+ man/INSTALL.template | 2 ++
+ man/iwad_paths.man | 3 ++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/man/INSTALL.template b/man/INSTALL.template
+index f04e98e6..9c9f7601 100644
+--- a/man/INSTALL.template
++++ b/man/INSTALL.template
+@@ -199,6 +199,8 @@ do one of the following:
+ * Put the file into one of the following directories:
+
++ /usr/share/doom
+ /usr/share/games/doom
++ /usr/local/share/doom
+ /usr/local/share/games/doom
+
+ * Set the environment variable DOOMWADDIR to specify the path to a
+diff --git a/man/iwad_paths.man b/man/iwad_paths.man
+index 98058154..a41aba41 100644
+--- a/man/iwad_paths.man
++++ b/man/iwad_paths.man
+@@ -35,7 +35,8 @@ Writeable directory in the user's home directory. The path can be overridden
+ using the \fBXDG_DATA_HOME\fR environment variable (see the XDG Base Directory
+ Specification).
+ .TP
+-\fB/usr/local/share/games/doom, /usr/share/games/doom\fR
++\fB/usr/local/share/doom, /usr/local/share/games/doom, /usr/share/doom,
++/usr/share/games/doom\fR
+ System-wide locations that can be accessed by all users. The path
+ \fB/usr/share/games/doom\fR is a standard path that is supported by most
+ Doom source ports. These paths can be overridden using the \fBXDG_DATA_DIRS\fR
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-to-latest-AppStream-formerly-AppData-standard.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-to-latest-AppStream-formerly-AppData-standard.patch
new file mode 100644
index 000000000000..39cef73483e9
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-Update-to-latest-AppStream-formerly-AppData-standard.patch
@@ -0,0 +1,119 @@
+From: Mike Swanson <mikeonthecomputer@gmail.com>
+Date: Sat, 7 Sep 2019 10:43:57 -0700
+Subject: [PATCH] Update to latest AppStream (formerly AppData) standards
+
+Install files into ${prefix}/share/metainfo rather than
+${prefix}/share/appdata, name files by reverse-DNS and suffixed
+.metainfo.xml.
+
+"appstream-util validate" still complains about a missing
+update_contact tag and issues with the caption tags being either short
+or long, but the specification at
+https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html
+says these are not errors.
+---
+ configure.ac | 8 +++---
+ ...om.appdata.xml.in => Doom.metainfo.xml.in} | 0
+ ...appdata.xml.in => Heretic.metainfo.xml.in} | 0
+ ...n.appdata.xml.in => Hexen.metainfo.xml.in} | 0
+ src/Makefile.am | 28 +++++++++----------
+ ....appdata.xml.in => Strife.metainfo.xml.in} | 0
+ 7 files changed, 19 insertions(+), 19 deletions(-)
+ rename src/{doom.appdata.xml.in => Doom.metainfo.xml.in} (100%)
+ rename src/{heretic.appdata.xml.in => Heretic.metainfo.xml.in} (100%)
+ rename src/{hexen.appdata.xml.in => Hexen.metainfo.xml.in} (100%)
+ rename src/{strife.appdata.xml.in => Strife.metainfo.xml.in} (100%)
+
+diff --git a/configure.ac b/configure.ac
+index 5ec9dfbf..8a3e1bbc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -167,14 +167,14 @@ pkg/osx/Info.plist
+ rpm.spec
+ data/Makefile
+ src/Makefile
+-src/doom.appdata.xml
++src/Doom.metainfo.xml
+ src/doom.desktop
+ src/doom-screensaver.desktop
+ src/doom/Makefile
+-src/heretic.appdata.xml
++src/Heretic.metainfo.xml
+ src/heretic.desktop
+ src/heretic/Makefile
+-src/hexen.appdata.xml
++src/Hexen.metainfo.xml
+ src/hexen.desktop
+ src/hexen/Makefile
+ src/resource.rc
+@@ -182,7 +182,7 @@ src/setup-res.rc
+ src/setup/Makefile
+ src/setup/setup.desktop
+ src/setup/setup-manifest.xml
+-src/strife.appdata.xml
++src/Strife.metainfo.xml
+ src/strife.desktop
+ src/strife/Makefile
+ textscreen/Makefile
+diff --git a/src/doom.appdata.xml.in b/src/Doom.metainfo.xml.in
+similarity index 100%
+rename from src/doom.appdata.xml.in
+rename to src/Doom.metainfo.xml.in
+diff --git a/src/heretic.appdata.xml.in b/src/Heretic.metainfo.xml.in
+similarity index 100%
+rename from src/heretic.appdata.xml.in
+rename to src/Heretic.metainfo.xml.in
+diff --git a/src/hexen.appdata.xml.in b/src/Hexen.metainfo.xml.in
+similarity index 100%
+rename from src/hexen.appdata.xml.in
+rename to src/Hexen.metainfo.xml.in
+diff --git a/src/Makefile.am b/src/Makefile.am
+index e54aeead..6880bd3c 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -220,24 +220,24 @@ EXTRA_DIST = \
+ doom-screensaver.desktop.in \
+ manifest.xml
+
+-appdatadir = $(prefix)/share/metainfo
+-appdata_DATA = \
+- @PROGRAM_PREFIX@doom.appdata.xml \
+- @PROGRAM_PREFIX@heretic.appdata.xml \
+- @PROGRAM_PREFIX@hexen.appdata.xml \
+- @PROGRAM_PREFIX@strife.appdata.xml
++metainfodir = $(prefix)/share/metainfo
++metainfo_DATA = \
++ @PACKAGE_RDNS@.Doom.metainfo.xml \
++ @PACKAGE_RDNS@.Heretic.metainfo.xml \
++ @PACKAGE_RDNS@.Hexen.metainfo.xml \
++ @PACKAGE_RDNS@.Strife.metainfo.xml
+
+-@PROGRAM_PREFIX@doom.appdata.xml : doom.appdata.xml
+- cp doom.appdata.xml $@
++@PACKAGE_RDNS@.Doom.metainfo.xml : Doom.metainfo.xml
++ cp Doom.metainfo.xml $@
+
+-@PROGRAM_PREFIX@heretic.appdata.xml : heretic.appdata.xml
+- cp heretic.appdata.xml $@
++@PACKAGE_RDNS@.Heretic.metainfo.xml : Heretic.metainfo.xml
++ cp Heretic.metainfo.xml $@
+
+-@PROGRAM_PREFIX@hexen.appdata.xml : hexen.appdata.xml
+- cp hexen.appdata.xml $@
++@PACKAGE_RDNS@.Hexen.metainfo.xml : Hexen.metainfo.xml
++ cp Hexen.metainfo.xml $@
+
+-@PROGRAM_PREFIX@strife.appdata.xml : strife.appdata.xml
+- cp strife.appdata.xml $@
++@PACKAGE_RDNS@.Strife.metainfo.xml : Strife.metainfo.xml
++ cp Strife.metainfo.xml $@
+
+ appdir = $(prefix)/share/applications
+ app_DATA = \
+diff --git a/src/strife.appdata.xml.in b/src/Strife.metainfo.xml.in
+similarity index 100%
+rename from src/strife.appdata.xml.in
+rename to src/Strife.metainfo.xml.in
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-Build-from-actual-shell-script-templ.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-Build-from-actual-shell-script-templ.patch
new file mode 100644
index 000000000000..48445cf6efc2
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-Build-from-actual-shell-script-templ.patch
@@ -0,0 +1,53 @@
+From da88012088dad9f7a5d53c26aa40aa393cb5b703 Mon Sep 17 00:00:00 2001
+From: Mike Swanson <mikeonthecomputer@gmail.com>
+Date: Sat, 27 Jan 2018 04:49:08 -0800
+Subject: [PATCH] bash-completion: Build from actual shell script templates.
+
+At some point, the Makefile was inerrantly modified so that it
+generated manpage sources instead of shell script, making completions
+very screwed up.
+---
+ man/bash-completion/Makefile.am | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/man/bash-completion/Makefile.am b/man/bash-completion/Makefile.am
+index 60e7ae9c..bb706fc7 100644
+--- a/man/bash-completion/Makefile.am
++++ b/man/bash-completion/Makefile.am
+@@ -17,28 +17,27 @@ BASH_COMPLETION_SCRIPTLETS = \
+ bashcompletion_DATA = $(BASH_COMPLETION_SCRIPTLETS)
+ CLEANFILES = $(BASH_COMPLETION_SCRIPTLETS)
+
+-MANDIR = $(top_srcdir)/man
+-DOCGEN = $(MANDIR)/docgen
++DOCGEN = $(top_srcdir)/man/docgen
+ DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@" -z "@PACKAGE_SHORTNAME@"
+
+ @PROGRAM_PREFIX@doom: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+- -g doom -b $(MANDIR)/doom.template \
++ -g doom -b doom.template \
+ $(top_srcdir)/src $(top_srcdir)/src/doom > $@
+
+ @PROGRAM_PREFIX@heretic: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+- -g heretic -b $(MANDIR)/heretic.template \
++ -g heretic -b heretic.template \
+ $(top_srcdir)/src $(top_srcdir)/src/heretic > $@
+
+ @PROGRAM_PREFIX@hexen: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+- -g hexen -b $(MANDIR)/hexen.template \
++ -g hexen -b hexen.template \
+ $(top_srcdir)/src $(top_srcdir)/src/hexen > $@
+
+ @PROGRAM_PREFIX@strife: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+- -g strife -b $(MANDIR)/strife.template \
++ -g strife -b strife.template \
+ $(top_srcdir)/src $(top_srcdir)/src/strife > $@
+
+ EXTRA_DIST = \
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-always-install-into-datadir-bash-com.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-always-install-into-datadir-bash-com.patch
new file mode 100644
index 000000000000..3931166599f9
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-always-install-into-datadir-bash-com.patch
@@ -0,0 +1,61 @@
+From b9d4c04c840321f5ec70787d8afb1256766aaa01 Mon Sep 17 00:00:00 2001
+From: Mike Swanson <mikeonthecomputer@gmail.com>
+Date: Tue, 6 Aug 2019 15:40:46 -0700
+Subject: [PATCH] bash-completion: always install into $datadir/bash-completion
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The bash-completion package by default searches in $HOME/.local and
+/usr/local first before /usr, and we should respect local installation
+locations instead of always trying to write to a path that is
+accessible only to root and could conflict with a package manager.
+
+This removes a toggle in the configure script, which neither actually
+worked properly (setting DIR didn’t work) and I believe did the wrong
+thing by default anyway.
+---
+ configure.ac | 9 ---------
+ man/bash-completion/Makefile.am | 2 +-
+ 2 files changed, 1 insertion(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f12eae68..5ec9dfbf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -87,13 +87,6 @@ AC_CHECK_DECLS([strcasecmp, strncasecmp], [], [], [[#include <strings.h>]])
+ AC_CHECK_LIB(i386, i386_iopl)
+ AC_CHECK_LIB(amd64, amd64_iopl)
+
+-AC_ARG_WITH([bashcompletiondir],
+- AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completion directory]),
+- [],
+- [AS_IF([$($PKG_CONFIG --exists bash-completion 2> /dev/null)],
+- [bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)],
+- [bashcompletiondir=${datadir}/bash-completion/completions])])
+-
+ case "$host" in
+ *-*-mingw* | *-*-cygwin* | *-*-msvc* )
+ AC_CHECK_TOOL(WINDRES, windres, )
+@@ -153,8 +146,6 @@ AC_SUBST(PACKAGE_URL)
+ AC_SUBST(PACKAGE_RDNS)
+ AC_SUBST(PACKAGE_ISSUES)
+
+-AC_SUBST(bashcompletiondir)
+-
+ dnl Shut up the datarootdir warnings.
+ AC_DEFUN([AC_DATAROOTDIR_CHECKED])
+
+diff --git a/man/bash-completion/Makefile.am b/man/bash-completion/Makefile.am
+index bb706fc7..9c1400f1 100644
+--- a/man/bash-completion/Makefile.am
++++ b/man/bash-completion/Makefile.am
+@@ -1,4 +1,4 @@
+-bashcompletiondir=@bashcompletiondir@
++bashcompletiondir=@datadir@/bash-completion/completions
+
+ BASH_COMPLETION_TEMPLATES = \
+ doom.template \
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-run-docgen-with-z-argument.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-run-docgen-with-z-argument.patch
new file mode 100644
index 000000000000..d9df5743d765
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-bash-completion-run-docgen-with-z-argument.patch
@@ -0,0 +1,25 @@
+From ccfbd4a046de9590cadb522d1f754c78ee9f8d4e Mon Sep 17 00:00:00 2001
+From: Jonathan Dowland <jon@dow.land>
+Date: Mon, 15 Jan 2018 19:10:16 +0000
+Subject: [PATCH] bash-completion: run docgen with -z argument
+
+---
+ man/bash-completion/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/man/bash-completion/Makefile.am b/man/bash-completion/Makefile.am
+index 801dd212..60e7ae9c 100644
+--- a/man/bash-completion/Makefile.am
++++ b/man/bash-completion/Makefile.am
+@@ -19,7 +19,7 @@ CLEANFILES = $(BASH_COMPLETION_SCRIPTLETS)
+
+ MANDIR = $(top_srcdir)/man
+ DOCGEN = $(MANDIR)/docgen
+-DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@"
++DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@" -z "@PACKAGE_SHORTNAME@"
+
+ @PROGRAM_PREFIX@doom: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-configure-add-AM_PROG_AR-macro.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-configure-add-AM_PROG_AR-macro.patch
new file mode 100644
index 000000000000..725ddb2dba55
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-configure-add-AM_PROG_AR-macro.patch
@@ -0,0 +1,28 @@
+From 560cdc3e4572cc84d493c5450092b6ce1694bd89 Mon Sep 17 00:00:00 2001
+From: Simon Howard <fraggle@soulsphere.org>
+Date: Sun, 30 Sep 2018 23:34:52 -0400
+Subject: [PATCH] configure: add AM_PROG_AR macro.
+
+Some platforms (eg. Emscripten) have their own version of the ar tool,
+so it is important to pick one that matches the target architecture.
+Without this macro we always use the default system-installed version
+of ar.
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index 175d7f3b..6dfced8d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -15,6 +15,7 @@ AC_CANONICAL_HOST
+
+ orig_CFLAGS="$CFLAGS"
+
++AM_PROG_AR
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_CHECK_PROG(HAVE_PYTHON, python, true, false)
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-further-manpage-substitutions-and-fixes.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-further-manpage-substitutions-and-fixes.patch
new file mode 100644
index 000000000000..62fc424f42b9
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-further-manpage-substitutions-and-fixes.patch
@@ -0,0 +1,322 @@
+From c1f553b92a7a4873b33026463866101e18be8e76 Mon Sep 17 00:00:00 2001
+From: Jonathan Dowland <jon@dow.land>
+Date: Mon, 27 Nov 2017 22:24:04 +0000
+Subject: [PATCH] further manpage substitutions and fixes
+
+Convert chocolate-setup.6 into a template file and generate outputs
+based on @PROGRAM_PREFIX@.
+
+Add @PACKAGE_SHORTNAME@ to the list of parameters handed to docgen
+and make appropriate substitutions in the manpage templates.
+---
+ man/Makefile.am | 15 ++++++++----
+ man/docgen | 30 ++++++++++++++---------
+ man/heretic.template | 8 +++---
+ man/hexen.template | 8 +++---
+ man/{chocolate-setup.6 => setup.template} | 4 +--
+ man/strife.template | 14 +++++------
+ 6 files changed, 45 insertions(+), 34 deletions(-)
+ rename man/{chocolate-setup.6 => setup.template} (94%)
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 5916edf9..f0099c79 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -30,6 +30,7 @@ GENERATED_MAN_PAGES = \
+ @PROGRAM_PREFIX@strife.6 \
+ strife.cfg.5 \
+ @PROGRAM_PREFIX@strife.cfg.5 \
++ @PROGRAM_PREFIX@setup.6 \
+ @PROGRAM_PREFIX@server.6
+
+ SETUP_MAN_PAGES = \
+@@ -38,8 +39,7 @@ SETUP_MAN_PAGES = \
+ @PROGRAM_PREFIX@hexen-setup.6 \
+ @PROGRAM_PREFIX@strife-setup.6
+
+-man_MANS = chocolate-setup.6 \
+- $(GENERATED_MAN_PAGES) \
++man_MANS = $(GENERATED_MAN_PAGES) \
+ $(SETUP_MAN_PAGES)
+
+ doomdocs_DATA = INSTALL.doom CMDLINE.doom
+@@ -51,10 +51,10 @@ CLEANFILES = $(GENERATED_MAN_PAGES) $(SETUP_MAN_PAGES) \
+ $(doomdocs_DATA) $(hereticdocs_DATA) \
+ $(hexendocs_DATA) $(strifedocs_DATA)
+ DOCGEN = $(srcdir)/docgen
+-DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@"
++DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@" -z "@PACKAGE_SHORTNAME@"
+
+-$(SETUP_MAN_PAGES): chocolate-setup.6
+- cp $(srcdir)/chocolate-setup.6 $@
++$(SETUP_MAN_PAGES): @PROGRAM_PREFIX@setup.6
++ cp $(srcdir)/@PROGRAM_PREFIX@setup.6 $@
+
+ @PROGRAM_PREFIX@doom.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+@@ -138,6 +138,11 @@ INSTALL.hexen: INSTALL.template
+ -g server -m $(srcdir)/server.template \
+ $(top_srcdir)/src > $@
+
++@PROGRAM_PREFIX@setup.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g setup -m $(srcdir)/setup.template \
++ $(top_srcdir)/src > $@
++
+ strife.cfg.5: $(top_srcdir)/src default.cfg.template
+ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+ -g strife -m $(srcdir)/default.cfg.template \
+diff --git a/man/docgen b/man/docgen
+index defb9060..1c8a2471 100755
+--- a/man/docgen
++++ b/man/docgen
+@@ -430,7 +430,7 @@ def process_files(path):
+
+ process_file(path)
+
+-def print_template(template_file, program_prefix, package_name, content):
++def print_template(template_file, program_prefix, package_name, package_shortname, content):
+ f = io.open(template_file, encoding='UTF-8')
+
+ try:
+@@ -440,16 +440,18 @@ def print_template(template_file, program_prefix, package_name, content):
+ filename = match.group(1)
+ filename = os.path.join(os.path.dirname(template_file),
+ filename)
+- print_template(filename, program_prefix, package_name, content)
++ print_template(filename, program_prefix, package_name, package_shortname, content)
+ else:
+ line = line.replace("@content", content)
+ line = line.replace("@PROGRAM_SPREFIX@", program_prefix)
+- line = line.replace("@PACKAGE_SHORTNAME@", package_name)
++ line = line.replace("@PACKAGE_NAME@", package_name)
++ if package_shortname:
++ line = line.replace("@PACKAGE_SHORTNAME@", package_shortname)
+ stdout(line.rstrip().encode('UTF-8') + b'\n')
+ finally:
+ f.close()
+
+-def manpage_output(targets, program_prefix, package_name, template_file):
++def manpage_output(targets, program_prefix, package_name, package_shortname, template_file):
+
+ content = ""
+
+@@ -458,7 +460,7 @@ def manpage_output(targets, program_prefix, package_name, template_file):
+
+ content = content.replace("-", "\\-")
+
+- print_template(template_file, program_prefix, package_name, content)
++ print_template(template_file, program_prefix, package_name, package_shortname, content)
+
+ def wiki_output(targets, template):
+ read_wikipages()
+@@ -466,30 +468,31 @@ def wiki_output(targets, template):
+ for t in targets:
+ stdout(t.wiki_output().encode('UTF-8') + b'\n')
+
+-def plaintext_output(targets, program_prefix, package_name, template_file):
++def plaintext_output(targets, program_prefix, package_name, package_shortname, template_file):
+
+ content = ""
+
+ for t in targets:
+ content += t.plaintext_output() + "\n"
+
+- print_template(template_file, program_prefix, package_name, content)
++ print_template(template_file, program_prefix, package_name, package_shortname, content)
+
+-def completion_output(targets, program_prefix, package_name, template_file):
++def completion_output(targets, program_prefix, package_name, package_shortname, template_file):
+
+ content = ""
+
+ for t in targets:
+ content += t.completion_output() + "\n"
+
+- print_template(template_file, program_prefix, package_name, content)
++ print_template(template_file, program_prefix, package_name, package_shortname, content)
+
+ def usage():
+- print("Usage: %s [-V] [-c tag] [-g game] -n name ( -m | -w | -p ) <dir>..." \
++ print("Usage: %s [-V] [-c tag] [-g game] -n program_name -s package_name [ -z shortname ] ( -m | -w | -p ) <dir>..." \
+ % sys.argv[0])
+ print(" -c : Provide documentation for the specified configuration file")
+ print(" (matches the given tag name in the source file)")
+ print(" -s : Package name (for substitution)")
++ print(" -z : Package short-name (for substitution)")
+ print(" -n : Program name (for substitution)")
+ print(" -m : Manpage output")
+ print(" -w : Wikitext output")
+@@ -501,7 +504,7 @@ def usage():
+
+ # Parse command line
+
+-opts, args = getopt.getopt(sys.argv[1:], "n:s:m:wp:b:c:g:V")
++opts, args = getopt.getopt(sys.argv[1:], "n:s:z:m:wp:b:c:g:V")
+
+ output_function = None
+ template = None
+@@ -509,12 +512,15 @@ doc_config_file = None
+ match_game = None
+ program_prefix = None
+ package_name = None
++package_shortname = None
+
+ for opt in opts:
+ if opt[0] == "-n":
+ program_prefix = opt[1]
+ if opt[0] == "-s":
+ package_name = opt[1]
++ if opt[0] == "-z":
++ package_shortname = opt[1]
+ if opt[0] == "-m":
+ output_function = manpage_output
+ template = opt[1]
+@@ -556,5 +562,5 @@ else:
+
+ # Generate the output
+
+- output_function(documentation_targets, program_prefix, package_name, template)
++ output_function(documentation_targets, program_prefix, package_name, package_shortname, template)
+
+diff --git a/man/heretic.template b/man/heretic.template
+index c078c7c6..3fa4ce1d 100644
+--- a/man/heretic.template
++++ b/man/heretic.template
+@@ -6,7 +6,7 @@
+ [\fIOPTIONS\fR]
+ .SH DESCRIPTION
+ .PP
+-Chocolate Heretic is a port of Raven Software's 1994 game "Heretic" that
++@PACKAGE_SHORTNAME@ Heretic is a port of Raven Software's 1994 game "Heretic" that
+ aims to behave as similar to the original DOS version of Heretic as
+ possible.
+ .br
+@@ -14,16 +14,16 @@ possible.
+ .SH IWAD SEARCH PATHS
+ @include iwad_paths.man
+ .SH ENVIRONMENT
+-This section describes environment variables that control Chocolate Heretic's
++This section describes environment variables that control @PACKAGE_SHORTNAME@ Heretic's
+ behavior.
+ @include environ.man
+ .SH FILES
+ .TP
+ \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/heretic.cfg\fR
+-The main configuration file for Chocolate Heretic. See \fBheretic.cfg\fR(5).
++The main configuration file for @PACKAGE_SHORTNAME@ Heretic. See \fBheretic.cfg\fR(5).
+ .TP
+ \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-heretic.cfg\fR
+-Extra configuration values that are specific to Chocolate Heretic and not
++Extra configuration values that are specific to @PACKAGE_SHORTNAME@ Heretic and not
+ present in Vanilla Heretic. See \fB@PROGRAM_SPREFIX@\-heretic.cfg\fR(5).
+ .SH SEE ALSO
+ \fB@PROGRAM_SPREFIX@\-doom\fR(6),
+diff --git a/man/hexen.template b/man/hexen.template
+index 9184a27e..fc953edf 100644
+--- a/man/hexen.template
++++ b/man/hexen.template
+@@ -6,7 +6,7 @@
+ [\fIOPTIONS\fR]
+ .SH DESCRIPTION
+ .PP
+-Chocolate Hexen is a port of Raven Software's 1995 game "Hexen" that
++@PACKAGE_SHORTNAME@ Hexen is a port of Raven Software's 1995 game "Hexen" that
+ aims to behave as similar to the original DOS version of Hexen as
+ possible.
+ .br
+@@ -14,16 +14,16 @@ possible.
+ .SH IWAD SEARCH PATHS
+ @include iwad_paths.man
+ .SH ENVIRONMENT
+-This section describes environment variables that control Chocolate Hexen's
++This section describes environment variables that control @PACKAGE_SHORTNAME@ Hexen's
+ behavior.
+ @include environ.man
+ .SH FILES
+ .TP
+ \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/hexen.cfg\fR
+-The main configuration file for Chocolate Hexen. See \fBhexen.cfg\fR(5).
++The main configuration file for @PACKAGE_SHORTNAME@ Hexen. See \fBhexen.cfg\fR(5).
+ .TP
+ \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-hexen.cfg\fR
+-Extra configuration values that are specific to Chocolate Hexen and not
++Extra configuration values that are specific to @PACKAGE_SHORTNAME@ Hexen and not
+ present in Vanilla Hexen. See \fB@PROGRAM_SPREFIX@\-hexen.cfg\fR(5).
+ .SH SEE ALSO
+ \fB@PROGRAM_SPREFIX@\-doom\fR(6),
+diff --git a/man/chocolate-setup.6 b/man/setup.template
+similarity index 94%
+rename from man/chocolate-setup.6
+rename to man/setup.template
+index 64f65937..2b5a45ea 100644
+--- a/man/chocolate-setup.6
++++ b/man/setup.template
+@@ -25,9 +25,9 @@ Load configuration from the specified file, instead of default.cfg.
+ \fB-extraconfig <file>\fR
+ Load extra configuration from the specified file, instead of @PROGRAM_SPREFIX@\-doom.cfg.
+ .SH SEE ALSO
+-\fB@CHOCOLATE_SPREFIX@\-doom\fR(6),
++\fB@PROGRAM_SPREFIX@\-doom\fR(6),
+ \fBdefault.cfg\fR(5),
+-\fB@CHOCOLATE_SPREFIX@\-doom.cfg\fR(5)
++\fB@PROGRAM_SPREFIX@\-doom.cfg\fR(5)
+ .SH AUTHOR
+ Chocolate Doom is written and maintained by Simon Howard.
+ .PP
+diff --git a/man/strife.template b/man/strife.template
+index 9ca7f14e..b82c39d4 100644
+--- a/man/strife.template
++++ b/man/strife.template
+@@ -6,7 +6,7 @@
+ [\fIOPTIONS\fR]
+ .SH DESCRIPTION
+ .PP
+-Chocolate Strife is an accurate and complete recreation of Rogue
++@PACKAGE_SHORTNAME@ Strife is an accurate and complete recreation of Rogue
+ Entertainment's "Strife: Quest for the Sigil". It was created through
+ more than two years of reverse engineering effort with the blessings
+ of the original programmers of the game (see the section HISTORY below).
+@@ -16,17 +16,17 @@ of the original programmers of the game (see the section HISTORY below).
+ .SH IWAD SEARCH PATHS
+ @include iwad_paths.man
+ .SH ENVIRONMENT
+-This section describes environment variables that control Chocolate Strife's
++This section describes environment variables that control @PACKAGE_SHORTNAME@ Strife's
+ behavior.
+ @include environ.man
+
+ .SH FILES
+ .TP
+ \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/strife.cfg\fR
+-The main configuration file for Chocolate Strife. See \fBstrife.cfg\fR(5).
++The main configuration file for @PACKAGE_SHORTNAME@ Strife. See \fBstrife.cfg\fR(5).
+ .TP
+ \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-strife.cfg\fR
+-Extra configuration values that are specific to Chocolate Strife and not
++Extra configuration values that are specific to @PACKAGE_SHORTNAME@ Strife and not
+ present in Vanilla Strife. See \fB@PROGRAM_SPREFIX@\-strife.cfg\fR(5).
+ .SH SEE ALSO
+ \fB@PROGRAM_SPREFIX@\-doom\fR(6),
+@@ -57,15 +57,15 @@ and neither Rogue nor their publisher, Velocity, Inc., exist any longer as
+ legal entities, this is effectively legal permission.
+
+ .SH BUGS
+-Chocolate Strife is almost, but not entirely perfect, in recreating the
++@PACKAGE_SHORTNAME@ Strife is almost, but not entirely perfect, in recreating the
+ behavior of Vanilla Strife. Help us by reporting any discrepancies you
+ might notice between this executable and the vanilla DOS program.
+
+ However, do *not* report any glitch that you can replicate in the vanilla EXE
+-as a bug. The point of Chocolate Strife, like Chocolate Doom before it, is to
++as a bug. The point of @PACKAGE_SHORTNAME Strife, like Chocolate Doom before it, is to
+ be as bug-compatible with the original game as possible. Also be aware that
+ some glitches are impossible to compatibly recreate, and wherever this is the
+-case, Chocolate Strife has erred on the side of not crashing the program,
++case, @PACKAGE_SHORTNAME@ Strife has erred on the side of not crashing the program,
+ for example by initializing pointers to NULL rather than using them without
+ setting a value first.
+
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-install-AppStream-metadata-into-the-proper-location.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-install-AppStream-metadata-into-the-proper-location.patch
new file mode 100644
index 000000000000..025ccf0ad179
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-install-AppStream-metadata-into-the-proper-location.patch
@@ -0,0 +1,26 @@
+From 12d69a4ee62094b48b37f550d31113e84cca0043 Mon Sep 17 00:00:00 2001
+From: Fabian Greffrath <fabian@greffrath.com>
+Date: Mon, 22 Jan 2018 17:24:41 +0100
+Subject: [PATCH] install AppStream metadata into the proper location
+
+AppStream metadata is to be placed in the /usr/share/metainfo/ directory, /usr/share/appdata is a legacy location.
+---
+ src/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index e3bc7bb1..04474ab3 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -212,7 +212,7 @@ EXTRA_DIST = \
+ doom-screensaver.desktop.in \
+ manifest.xml
+
+-appdatadir = $(prefix)/share/appdata
++appdatadir = $(prefix)/share/metainfo
+ appdata_DATA = \
+ @PROGRAM_PREFIX@doom.appdata.xml \
+ @PROGRAM_PREFIX@heretic.appdata.xml \
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-overhaul-manpages-add-parameters.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-overhaul-manpages-add-parameters.patch
new file mode 100644
index 000000000000..95e01e53e1f7
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-overhaul-manpages-add-parameters.patch
@@ -0,0 +1,695 @@
+From e0b8a7e0a9e0ee8c5983b94b849a8a69a5592464 Mon Sep 17 00:00:00 2001
+From: Jonathan Dowland <jon@dow.land>
+Date: Mon, 27 Nov 2017 21:17:55 +0000
+Subject: [PATCH] overhaul manpages, add parameters
+
+This is in order to better support derivative engines.
+
+Rework the manpages to be parameterized with @PROGRAM_PREFIX@ and
+@PACKAGE_NAME@. Alter the `docgen` generator to substitute those
+parameters. Supply those parameters via the autofoo Makefile.
+
+Adjust the fixed path chocolate-server.6 to be generated from
+server.template, similar to doom.template -> chocolate-doom.6.
+
+Further work is required, not least renaming chocolate-setup.6,
+but several further parameterizations.
+---
+ man/Makefile.am | 68 ++++++++++++++-------
+ man/bash-completion/Makefile.am | 13 ++--
+ man/chocolate-setup.6 | 22 +++----
+ man/default.cfg.template | 18 +++---
+ man/docgen | 32 ++++++----
+ man/doom.template | 30 ++++-----
+ man/extra.cfg.template | 24 ++++----
+ man/heretic.template | 20 +++---
+ man/hexen.template | 20 +++---
+ man/{chocolate-server.6 => server.template} | 20 +++---
+ man/strife.template | 18 +++---
+ 11 files changed, 161 insertions(+), 124 deletions(-)
+ rename man/{chocolate-server.6 => server.template} (74%)
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index cfd2dc66..5916edf9 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -29,7 +29,8 @@ GENERATED_MAN_PAGES = \
+ @PROGRAM_PREFIX@hexen.cfg.5 \
+ @PROGRAM_PREFIX@strife.6 \
+ strife.cfg.5 \
+- @PROGRAM_PREFIX@strife.cfg.5
++ @PROGRAM_PREFIX@strife.cfg.5 \
++ @PROGRAM_PREFIX@server.6
+
+ SETUP_MAN_PAGES = \
+ @PROGRAM_PREFIX@doom-setup.6 \
+@@ -37,8 +38,7 @@ SETUP_MAN_PAGES = \
+ @PROGRAM_PREFIX@hexen-setup.6 \
+ @PROGRAM_PREFIX@strife-setup.6
+
+-man_MANS = chocolate-server.6 \
+- chocolate-setup.6 \
++man_MANS = chocolate-setup.6 \
+ $(GENERATED_MAN_PAGES) \
+ $(SETUP_MAN_PAGES)
+
+@@ -51,24 +51,29 @@ CLEANFILES = $(GENERATED_MAN_PAGES) $(SETUP_MAN_PAGES) \
+ $(doomdocs_DATA) $(hereticdocs_DATA) \
+ $(hexendocs_DATA) $(strifedocs_DATA)
+ DOCGEN = $(srcdir)/docgen
++DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@"
+
+ $(SETUP_MAN_PAGES): chocolate-setup.6
+ cp $(srcdir)/chocolate-setup.6 $@
+
+ @PROGRAM_PREFIX@doom.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+- $(DOCGEN) -g doom -m $(srcdir)/doom.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g doom -m $(srcdir)/doom.template \
+ $(top_srcdir)/src $(top_srcdir)/src/doom > $@
+
+ default.cfg.5: $(top_srcdir)/src $(srcdir)/default.cfg.template
+- $(DOCGEN) -g doom -m $(srcdir)/default.cfg.template \
+- -c default $(top_srcdir)/src/m_config.c > $@
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g doom -m $(srcdir)/default.cfg.template \
++ -c default $(top_srcdir)/src/m_config.c > $@
+
+ @PROGRAM_PREFIX@doom.cfg.5: $(top_srcdir)/src extra.cfg.template
+- $(DOCGEN) -g doom -m $(srcdir)/extra.cfg.template \
+- -c extended $(top_srcdir)/src/m_config.c > $@
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g doom -m $(srcdir)/extra.cfg.template \
++ -c extended $(top_srcdir)/src/m_config.c > $@
+
+ CMDLINE.doom : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/doom
+- $(DOCGEN) -p $(srcdir)/CMDLINE.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -p $(srcdir)/CMDLINE.template \
+ $(top_srcdir)/src/ $(top_srcdir)/src/doom/ > $@
+
+ INSTALL.doom: INSTALL.template
+@@ -76,19 +81,23 @@ INSTALL.doom: INSTALL.template
+
+
+ @PROGRAM_PREFIX@heretic.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES) heretic.template
+- $(DOCGEN) -g heretic -m $(srcdir)/heretic.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g heretic -m $(srcdir)/heretic.template \
+ $(top_srcdir)/src $(top_srcdir)/src/heretic > $@
+
+ heretic.cfg.5: $(top_srcdir)/src $(srcdir)/default.cfg.template
+- $(DOCGEN) -g heretic -m $(srcdir)/default.cfg.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g heretic -m $(srcdir)/default.cfg.template \
+ -c default $(top_srcdir)/src/m_config.c > $@
+
+ @PROGRAM_PREFIX@heretic.cfg.5: $(top_srcdir)/src extra.cfg.template
+- $(DOCGEN) -g heretic -m $(srcdir)/extra.cfg.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g heretic -m $(srcdir)/extra.cfg.template \
+ -c extended $(top_srcdir)/src/m_config.c > $@
+
+ CMDLINE.heretic : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/heretic
+- $(DOCGEN) -p $(srcdir)/CMDLINE.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -p $(srcdir)/CMDLINE.template \
+ $(top_srcdir)/src/ $(top_srcdir)/src/heretic/ > $@
+
+ INSTALL.heretic: INSTALL.template
+@@ -96,19 +105,23 @@ INSTALL.heretic: INSTALL.template
+
+
+ @PROGRAM_PREFIX@hexen.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+- $(DOCGEN) -g hexen -m $(srcdir)/hexen.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g hexen -m $(srcdir)/hexen.template \
+ $(top_srcdir)/src $(top_srcdir)/src/hexen > $@
+
+ hexen.cfg.5: $(top_srcdir)/src default.cfg.template
+- $(DOCGEN) -g hexen -m $(srcdir)/default.cfg.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g hexen -m $(srcdir)/default.cfg.template \
+ -c default $(top_srcdir)/src/m_config.c > $@
+
+ @PROGRAM_PREFIX@hexen.cfg.5: $(top_srcdir)/src extra.cfg.template
+- $(DOCGEN) -g hexen -m $(srcdir)/extra.cfg.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g hexen -m $(srcdir)/extra.cfg.template \
+ -c extended $(top_srcdir)/src/m_config.c > $@
+
+ CMDLINE.hexen : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/hexen
+- $(DOCGEN) -p $(srcdir)/CMDLINE.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -p $(srcdir)/CMDLINE.template \
+ $(top_srcdir)/src/ $(top_srcdir)/src/hexen/ > $@
+
+ INSTALL.hexen: INSTALL.template
+@@ -116,19 +129,28 @@ INSTALL.hexen: INSTALL.template
+
+
+ @PROGRAM_PREFIX@strife.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+- $(DOCGEN) -g strife -m $(srcdir)/strife.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g strife -m $(srcdir)/strife.template \
+ $(top_srcdir)/src $(top_srcdir)/src/strife > $@
+
++@PROGRAM_PREFIX@server.6: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g server -m $(srcdir)/server.template \
++ $(top_srcdir)/src > $@
++
+ strife.cfg.5: $(top_srcdir)/src default.cfg.template
+- $(DOCGEN) -g strife -m $(srcdir)/default.cfg.template \
+- -c default $(top_srcdir)/src/m_config.c > $@
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g strife -m $(srcdir)/default.cfg.template \
++ -c default $(top_srcdir)/src/m_config.c > $@
+
+ @PROGRAM_PREFIX@strife.cfg.5: $(top_srcdir)/src extra.cfg.template
+- $(DOCGEN) -g strife -m $(srcdir)/extra.cfg.template \
+- -c extended $(top_srcdir)/src/m_config.c > $@
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g strife -m $(srcdir)/extra.cfg.template \
++ -c extended $(top_srcdir)/src/m_config.c > $@
+
+ CMDLINE.strife : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/strife
+- $(DOCGEN) -p $(srcdir)/CMDLINE.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -p $(srcdir)/CMDLINE.template \
+ $(top_srcdir)/src/ $(top_srcdir)/src/strife/ > $@
+
+ INSTALL.strife: INSTALL.template
+diff --git a/man/bash-completion/Makefile.am b/man/bash-completion/Makefile.am
+index 2c036acf..801dd212 100644
+--- a/man/bash-completion/Makefile.am
++++ b/man/bash-completion/Makefile.am
+@@ -19,21 +19,26 @@ CLEANFILES = $(BASH_COMPLETION_SCRIPTLETS)
+
+ MANDIR = $(top_srcdir)/man
+ DOCGEN = $(MANDIR)/docgen
++DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@"
+
+ @PROGRAM_PREFIX@doom: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+- $(DOCGEN) -g doom -b $(MANDIR)/doom.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g doom -b $(MANDIR)/doom.template \
+ $(top_srcdir)/src $(top_srcdir)/src/doom > $@
+
+ @PROGRAM_PREFIX@heretic: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+- $(DOCGEN) -g heretic -b $(MANDIR)/heretic.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g heretic -b $(MANDIR)/heretic.template \
+ $(top_srcdir)/src $(top_srcdir)/src/heretic > $@
+
+ @PROGRAM_PREFIX@hexen: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+- $(DOCGEN) -g hexen -b $(MANDIR)/hexen.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g hexen -b $(MANDIR)/hexen.template \
+ $(top_srcdir)/src $(top_srcdir)/src/hexen > $@
+
+ @PROGRAM_PREFIX@strife: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
+- $(DOCGEN) -g strife -b $(MANDIR)/strife.template \
++ $(DOCGEN) $(DOCGEN_COMMON_ARGS) \
++ -g strife -b $(MANDIR)/strife.template \
+ $(top_srcdir)/src $(top_srcdir)/src/strife > $@
+
+ EXTRA_DIST = \
+diff --git a/man/chocolate-setup.6 b/man/chocolate-setup.6
+index 21c9d5d4..64f65937 100644
+--- a/man/chocolate-setup.6
++++ b/man/chocolate-setup.6
+@@ -1,20 +1,20 @@
+-.TH chocolate\-setup 6
++.TH @PROGRAM_SPREFIX@\-setup 6
+ .SH NAME
+-chocolate\-setup \- configuration tool for chocolate\-doom
++@PROGRAM_SPREFIX@\-setup \- configuration tool for @PROGRAM_SPREFIX@\-doom
+ .SH SYNOPSIS
+-.B chocolate\-setup
++.B @PROGRAM_SPREFIX@\-setup
+ [OPTIONS]
+ .SH DESCRIPTION
+ .PP
+-Chocolate Doom is a modern Doom engine designed to behave
++@PACKAGE_NAME@ is a modern Doom engine designed to behave
+ as similar to the original Doom game as is possible.
+ .PP
+-.B chocolate\-setup
+-is a tool for configuring Chocolate Doom. It provides a menu\-based
++.B @PROGRAM_SPREFIX@\-setup
++is a tool for configuring @PACKAGE_NAME@. It provides a menu\-based
+ interface for the display, joystick, keyboard, mouse, sound and
+ compatibility settings.
+ .PP
+-.B chocolate\-setup
++.B @PROGRAM_SPREFIX@\-setup
+ can also be used to start and join network games.
+ .PP
+ .SH OPTIONS
+@@ -23,15 +23,15 @@ can also be used to start and join network games.
+ Load configuration from the specified file, instead of default.cfg.
+ .TP
+ \fB-extraconfig <file>\fR
+-Load extra configuration from the specified file, instead of chocolate-doom.cfg.
++Load extra configuration from the specified file, instead of @PROGRAM_SPREFIX@\-doom.cfg.
+ .SH SEE ALSO
+-\fBchocolate-doom\fR(6),
++\fB@CHOCOLATE_SPREFIX@\-doom\fR(6),
+ \fBdefault.cfg\fR(5),
+-\fBchocolate-doom.cfg\fR(5)
++\fB@CHOCOLATE_SPREFIX@\-doom.cfg\fR(5)
+ .SH AUTHOR
+ Chocolate Doom is written and maintained by Simon Howard.
+ .PP
+-This manual was written by Jon Dowland.
++This manual was written by Jonathan Dowland.
+ .SH COPYRIGHT
+ Copyright \(co id Software Inc.
+ Copyright \(co 2005-8 Simon Howard.
+diff --git a/man/default.cfg.template b/man/default.cfg.template
+index 5cf6256f..70c0d657 100644
+--- a/man/default.cfg.template
++++ b/man/default.cfg.template
+@@ -1,21 +1,21 @@
+ .TH default.cfg 5
+ .SH NAME
+-default.cfg \- Chocolate Doom configuration file
++default.cfg \- @PACKAGE_NAME@ configuration file
+ .SH DESCRIPTION
+ .PP
+ \fIdefault.cfg\fR
+-is the configuration file for \fBchocolate-doom\fR(6). The configuration
++is the configuration file for \fB@PROGRAM_SPREFIX@\-doom\fR(6). The configuration
+ options stored in the file are the same as those stored in the
+ original DOS Vanilla Doom.
+-Extra Chocolate Doom-specific options are stored in a separate
+-configuration file, \fBchocolate-doom.cfg\fR.
++Extra @PACKAGE_NAME@-specific options are stored in a separate
++configuration file, \fB@PROGRAM_SPREFIX@\-doom.cfg\fR.
+ .PP
+ \fIdefault.cfg\fR is normally stored in the user's home directory,
+-as \fI~/.local/share/chocolate-doom/default.cfg\fR. The path can be
++as \fI~/.local/share/@PROGRAM_SPREFIX@\-doom/default.cfg\fR. The path can be
+ overridden using the \fBXDG_DATA_HOME\fR environment variable (see the XDG
+ Base Directory Specification).
+ .PP
+-The \fBchocolate-setup\fR(6) tool provides a simple to use front-end
++The \fB@PROGRAM_SPREFIX@\-setup\fR(6) tool provides a simple to use front-end
+ for editing \fIdefault.cfg\fR.
+ .br
+ .SH FILE FORMAT
+@@ -49,7 +49,7 @@ indicating "false" and a non-zero value indicating "true".
+ @content
+
+ .SH SEE ALSO
+-\fBchocolate-doom\fR(6),
+-\fBchocolate-doom.cfg\fR(5),
+-\fBchocolate-setup\fR(6)
++\fB@PROGRAM_SPREFIX@\-doom\fR(6),
++\fB@PROGRAM_SPREFIX@\-doom.cfg\fR(5),
++\fB@PROGRAM_SPREFIX@\-setup\fR(6)
+
+diff --git a/man/docgen b/man/docgen
+index e477e74e..defb9060 100755
+--- a/man/docgen
++++ b/man/docgen
+@@ -430,7 +430,7 @@ def process_files(path):
+
+ process_file(path)
+
+-def print_template(template_file, content):
++def print_template(template_file, program_prefix, package_name, content):
+ f = io.open(template_file, encoding='UTF-8')
+
+ try:
+@@ -440,14 +440,16 @@ def print_template(template_file, content):
+ filename = match.group(1)
+ filename = os.path.join(os.path.dirname(template_file),
+ filename)
+- print_template(filename, content)
++ print_template(filename, program_prefix, package_name, content)
+ else:
+ line = line.replace("@content", content)
++ line = line.replace("@PROGRAM_SPREFIX@", program_prefix)
++ line = line.replace("@PACKAGE_SHORTNAME@", package_name)
+ stdout(line.rstrip().encode('UTF-8') + b'\n')
+ finally:
+ f.close()
+
+-def manpage_output(targets, template_file):
++def manpage_output(targets, program_prefix, package_name, template_file):
+
+ content = ""
+
+@@ -456,7 +458,7 @@ def manpage_output(targets, template_file):
+
+ content = content.replace("-", "\\-")
+
+- print_template(template_file, content)
++ print_template(template_file, program_prefix, package_name, content)
+
+ def wiki_output(targets, template):
+ read_wikipages()
+@@ -464,29 +466,31 @@ def wiki_output(targets, template):
+ for t in targets:
+ stdout(t.wiki_output().encode('UTF-8') + b'\n')
+
+-def plaintext_output(targets, template_file):
++def plaintext_output(targets, program_prefix, package_name, template_file):
+
+ content = ""
+
+ for t in targets:
+ content += t.plaintext_output() + "\n"
+
+- print_template(template_file, content)
++ print_template(template_file, program_prefix, package_name, content)
+
+-def completion_output(targets, template_file):
++def completion_output(targets, program_prefix, package_name, template_file):
+
+ content = ""
+
+ for t in targets:
+ content += t.completion_output() + "\n"
+
+- print_template(template_file, content)
++ print_template(template_file, program_prefix, package_name, content)
+
+ def usage():
+- print("Usage: %s [-V] [-c tag] [-g game] ( -m | -w | -p ) <dir>..." \
++ print("Usage: %s [-V] [-c tag] [-g game] -n name ( -m | -w | -p ) <dir>..." \
+ % sys.argv[0])
+ print(" -c : Provide documentation for the specified configuration file")
+ print(" (matches the given tag name in the source file)")
++ print(" -s : Package name (for substitution)")
++ print(" -n : Program name (for substitution)")
+ print(" -m : Manpage output")
+ print(" -w : Wikitext output")
+ print(" -p : Plaintext output")
+@@ -497,14 +501,20 @@ def usage():
+
+ # Parse command line
+
+-opts, args = getopt.getopt(sys.argv[1:], "m:wp:b:c:g:V")
++opts, args = getopt.getopt(sys.argv[1:], "n:s:m:wp:b:c:g:V")
+
+ output_function = None
+ template = None
+ doc_config_file = None
+ match_game = None
++program_prefix = None
++package_name = None
+
+ for opt in opts:
++ if opt[0] == "-n":
++ program_prefix = opt[1]
++ if opt[0] == "-s":
++ package_name = opt[1]
+ if opt[0] == "-m":
+ output_function = manpage_output
+ template = opt[1]
+@@ -546,5 +556,5 @@ else:
+
+ # Generate the output
+
+- output_function(documentation_targets, template)
++ output_function(documentation_targets, program_prefix, package_name, template)
+
+diff --git a/man/doom.template b/man/doom.template
+index 845147a8..da8d2141 100644
+--- a/man/doom.template
++++ b/man/doom.template
+@@ -1,35 +1,35 @@
+-.TH chocolate\-doom 6
++.TH @PROGRAM_SPREFIX@\-doom 6
+ .SH NAME
+-chocolate\-doom \- historically compatible Doom engine
++@PROGRAM_SPREFIX@\-doom \- historically compatible Doom engine
+ .SH SYNOPSIS
+-.B chocolate\-doom
++.B @PROGRAM_SPREFIX@\-doom
+ [\fIOPTIONS\fR]
+ .SH DESCRIPTION
+ .PP
+-Chocolate Doom is a port of Id Software's 1993 game "Doom" that is designed
++@PACKAGE_NAME@ is a port of Id Software's 1993 game "Doom" that is designed
+ to behave as similar to the original DOS version of Doom as is possible.
+ .br
+ @content
+ .SH IWAD SEARCH PATHS
+ @include iwad_paths.man
+ .SH ENVIRONMENT
+-This section describes environment variables that control Chocolate Doom's
++This section describes environment variables that control @PACKAGE_NAME@'s
+ behavior.
+ @include environ.man
+ .SH FILES
+ .TP
+-\fB$HOME/.local/share/chocolate-doom/default.cfg\fR
+-The main configuration file for Chocolate Doom. See \fBdefault.cfg\fR(5).
++\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/default.cfg\fR
++The main configuration file for @PACKAGE_NAME@. See \fBdefault.cfg\fR(5).
+ .TP
+-\fB$HOME/.local/share/chocolate-doom/chocolate-doom.cfg\fR
+-Extra configuration values that are specific to Chocolate Doom and not
+-present in Vanilla Doom. See \fBchocolate-doom.cfg\fR(5).
++\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-doom.cfg\fR
++Extra configuration values that are specific to @PACKAGE_NAME@ and not
++present in Vanilla Doom. See \fB@PROGRAM_SPREFIX@\-doom.cfg\fR(5).
+ .SH SEE ALSO
+-\fBchocolate-server\fR(6),
+-\fBchocolate-setup\fR(6),
+-\fBchocolate-heretic\fR(6),
+-\fBchocolate-hexen\fR(6),
+-\fBchocolate-strife\fR(6)
++\fB@PROGRAM_SPREFIX@\-server\fR(6),
++\fB@PROGRAM_SPREFIX@\-setup\fR(6),
++\fB@PROGRAM_SPREFIX@\-heretic\fR(6),
++\fB@PROGRAM_SPREFIX@\-hexen\fR(6),
++\fB@PROGRAM_SPREFIX@\-strife\fR(6)
+ .SH AUTHOR
+ Chocolate Doom is written and maintained by Simon Howard. It is based on
+ the LinuxDoom source code, released by Id Software.
+diff --git a/man/extra.cfg.template b/man/extra.cfg.template
+index b9317c53..77cc0dd3 100644
+--- a/man/extra.cfg.template
++++ b/man/extra.cfg.template
+@@ -1,23 +1,23 @@
+-.TH chocolate-doom.cfg 5
++.TH @PROGRAM_SPREFIX@\-doom.cfg 5
+ .SH NAME
+-chocolate-doom.cfg \- Chocolate Doom configuration file
++@PROGRAM_SPREFIX@\-doom.cfg \- @PACKAGE_NAME@ configuration file
+ .SH DESCRIPTION
+ .PP
+-\fIchocolate-doom.cfg\fR
+-is a configuration file for \fBchocolate-doom\fR(6). This file acts
++\fI@PROGRAM_SPREFIX@\-doom.cfg\fR
++is a configuration file for \fB@PROGRAM_SPREFIX@\-doom\fR(6). This file acts
+ as an auxiliary configuration file; the main configuration options
+ are stored in \fBdefault.cfg\fR, which contains the same configuration
+-options as Vanilla Doom (for compatibility). \fIchocolate-doom.cfg\fR
+-contains configuration options that are specific to Chocolate Doom
++options as Vanilla Doom (for compatibility). \fI@PROGRAM_SPREFIX@\-doom.cfg\fR
++contains configuration options that are specific to @PACKAGE_NAME@
+ only.
+ .PP
+-\fIchocolate-doom.cfg\fR is normally stored in the user's home directory,
+-as \fI~/.local/share/chocolate-doom/chocolate-doom.cfg\fR. The path can be
++\fI@PROGRAM_SPREFIX@\-doom.cfg\fR is normally stored in the user's home directory,
++as \fI~/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-doom.cfg\fR. The path can be
+ overridden using the \fBXDG_DATA_HOME\fR environment variable (see the XDG
+ Base Directory Specification).
+ .PP
+-The \fBchocolate-setup\fR(6) tool provides a simple to use front-end
+-for editing \fIchocolate-doom.cfg\fR.
++The \fB@PROGRAM_SPREFIX@\-setup\fR(6) tool provides a simple to use front-end
++for editing \fI@PROGRAM_SPREFIX@\-doom.cfg\fR.
+ .SH FILE FORMAT
+ .PP
+ The file format is the same as that used for \fBdefault.cfg\fR(5).
+@@ -26,7 +26,7 @@ The file format is the same as that used for \fBdefault.cfg\fR(5).
+ @content
+
+ .SH SEE ALSO
+-\fBchocolate-doom\fR(6),
++\fB@PROGRAM_SPREFIX@\-doom\fR(6),
+ \fBdefault.cfg\fR(5),
+-\fBchocolate-setup\fR(6)
++\fB@PROGRAM_SPREFIX@\-setup\fR(6)
+
+diff --git a/man/heretic.template b/man/heretic.template
+index 944d4a83..c078c7c6 100644
+--- a/man/heretic.template
++++ b/man/heretic.template
+@@ -1,8 +1,8 @@
+-.TH chocolate\-heretic 6
++.TH @PROGRAM_SPREFIX@\-heretic 6
+ .SH NAME
+-chocolate\-heretic \- historically compatible Heretic engine
++@PROGRAM_SPREFIX@\-heretic \- historically compatible Heretic engine
+ .SH SYNOPSIS
+-.B chocolate\-heretic
++.B @PROGRAM_SPREFIX@\-heretic
+ [\fIOPTIONS\fR]
+ .SH DESCRIPTION
+ .PP
+@@ -19,17 +19,17 @@ behavior.
+ @include environ.man
+ .SH FILES
+ .TP
+-\fB$HOME/.local/share/chocolate-doom/heretic.cfg\fR
++\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/heretic.cfg\fR
+ The main configuration file for Chocolate Heretic. See \fBheretic.cfg\fR(5).
+ .TP
+-\fB$HOME/.local/share/chocolate-doom/chocolate-heretic.cfg\fR
++\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-heretic.cfg\fR
+ Extra configuration values that are specific to Chocolate Heretic and not
+-present in Vanilla Heretic. See \fBchocolate-heretic.cfg\fR(5).
++present in Vanilla Heretic. See \fB@PROGRAM_SPREFIX@\-heretic.cfg\fR(5).
+ .SH SEE ALSO
+-\fBchocolate-doom\fR(6),
+-\fBchocolate-hexen\fR(6),
+-\fBchocolate-server\fR(6),
+-\fBchocolate-setup\fR(6)
++\fB@PROGRAM_SPREFIX@\-doom\fR(6),
++\fB@PROGRAM_SPREFIX@\-hexen\fR(6),
++\fB@PROGRAM_SPREFIX@\-server\fR(6),
++\fB@PROGRAM_SPREFIX@\-setup\fR(6)
+ .SH AUTHOR
+ Chocolate Heretic is part of the Chocolate Doom project, written and
+ maintained by Simon Howard. It is based on the Heretic source code,
+diff --git a/man/hexen.template b/man/hexen.template
+index 7772b1d4..9184a27e 100644
+--- a/man/hexen.template
++++ b/man/hexen.template
+@@ -1,8 +1,8 @@
+-.TH chocolate\-hexen 6
++.TH @PROGRAM_SPREFIX@\-hexen 6
+ .SH NAME
+-chocolate\-hexen \- historically compatible Hexen engine
++@PROGRAM_SPREFIX@\-hexen \- historically compatible Hexen engine
+ .SH SYNOPSIS
+-.B chocolate\-hexen
++.B @PROGRAM_SPREFIX@\-hexen
+ [\fIOPTIONS\fR]
+ .SH DESCRIPTION
+ .PP
+@@ -19,17 +19,17 @@ behavior.
+ @include environ.man
+ .SH FILES
+ .TP
+-\fB$HOME/.local/share/chocolate-doom/hexen.cfg\fR
++\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/hexen.cfg\fR
+ The main configuration file for Chocolate Hexen. See \fBhexen.cfg\fR(5).
+ .TP
+-\fB$HOME/.local/share/chocolate-doom/chocolate-hexen.cfg\fR
++\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-hexen.cfg\fR
+ Extra configuration values that are specific to Chocolate Hexen and not
+-present in Vanilla Hexen. See \fBchocolate-hexen.cfg\fR(5).
++present in Vanilla Hexen. See \fB@PROGRAM_SPREFIX@\-hexen.cfg\fR(5).
+ .SH SEE ALSO
+-\fBchocolate-doom\fR(6),
+-\fBchocolate-heretic\fR(6),
+-\fBchocolate-server\fR(6),
+-\fBchocolate-setup\fR(6)
++\fB@PROGRAM_SPREFIX@\-doom\fR(6),
++\fB@PROGRAM_SPREFIX@\-heretic\fR(6),
++\fB@PROGRAM_SPREFIX@\-server\fR(6),
++\fB@PROGRAM_SPREFIX@\-setup\fR(6)
+ .SH AUTHOR
+ Chocolate Hexen is part of the Chocolate Doom project, written and
+ maintained by Simon Howard. It is based on the Hexen source code,
+diff --git a/man/chocolate-server.6 b/man/server.template
+similarity index 74%
+rename from man/chocolate-server.6
+rename to man/server.template
+index 74dc6f42..643779f6 100644
+--- a/man/chocolate-server.6
++++ b/man/server.template
+@@ -1,18 +1,18 @@
+-.TH chocolate\-server 6
++.TH @PROGRAM_SPREFIX@\-server 6
+ .SH NAME
+-chocolate\-server \- dedicated server for chocolate\-doom
++@PROGRAM_SPREFIX@\-server \- dedicated server for @PROGRAM_SPREFIX@\-doom
+ .SH SYNOPSIS
+-.B chocolate\-server
++.B @PROGRAM_SPREFIX@\-server
+ [OPTIONS]
+ .SH DESCRIPTION
+ .PP
+-Chocolate Doom is a modern doom engine designed to behave
++@PACKAGE_SHORTNAME@ is a modern doom engine designed to behave
+ as similar to the original doom game as is possible.
+ .PP
+-.B chocolate\-server
+-is a dedicated server for Chocolate Doom. It is equivalent to
++.B @PROGRAM_SPREFIX@\-server
++is a dedicated server for @PACKAGE_SHORTNAME@. It is equivalent to
+ running
+-.B chocolate\-doom
++.B @PROGRAM_SPREFIX@\-doom
+ with the "\-dedicated" option.
+ .PP
+ Game options are not specified to the server, which merely acts to
+@@ -36,12 +36,12 @@ Don't register with the global master server.
+ \fB-servername <name>\fR
+ Specify a name for the server.
+ .SH SEE ALSO
+-\fBchocolate-doom\fR(6),
+-\fBchocolate-setup\fR(6)
++\fB@PROGRAM_SPREFIX@-doom\fR(6),
++\fB@PROGRAM_SPREFIX@-setup\fR(6)
+ .SH AUTHOR
+ Chocolate Doom is written and maintained by Simon Howard.
+ .PP
+-This manual was written by Jon Dowland.
++This manual was written by Jonathan Dowland.
+ .SH COPYRIGHT
+ Copyright \(co id Software Inc.
+ Copyright \(co 2005-8 Simon Howard.
+diff --git a/man/strife.template b/man/strife.template
+index d616c17b..9ca7f14e 100644
+--- a/man/strife.template
++++ b/man/strife.template
+@@ -1,8 +1,8 @@
+-.TH chocolate\-strife 6
++.TH @PROGRAM_SPREFIX@\-strife 6
+ .SH NAME
+-chocolate\-strife \- historically compatible strife engine
++@PROGRAM_SPREFIX@\-strife \- historically compatible Strife engine
+ .SH SYNOPSIS
+-.B chocolate\-strife
++.B @PROGRAM_SPREFIX@\-strife
+ [\fIOPTIONS\fR]
+ .SH DESCRIPTION
+ .PP
+@@ -22,16 +22,16 @@ behavior.
+
+ .SH FILES
+ .TP
+-\fB$HOME/.local/share/chocolate-doom/strife.cfg\fR
++\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/strife.cfg\fR
+ The main configuration file for Chocolate Strife. See \fBstrife.cfg\fR(5).
+ .TP
+-\fB$HOME/.local/share/chocolate-doom/chocolate-strife.cfg\fR
++\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-strife.cfg\fR
+ Extra configuration values that are specific to Chocolate Strife and not
+-present in Vanilla Strife. See \fBchocolate-strife.cfg\fR(5).
++present in Vanilla Strife. See \fB@PROGRAM_SPREFIX@\-strife.cfg\fR(5).
+ .SH SEE ALSO
+-\fBchocolate-doom\fR(6),
+-\fBchocolate-server\fR(6),
+-\fBchocolate-setup\fR(6)
++\fB@PROGRAM_SPREFIX@\-doom\fR(6),
++\fB@PROGRAM_SPREFIX@\-server\fR(6),
++\fB@PROGRAM_SPREFIX@\-setup\fR(6)
+
+ .SH HISTORY
+ The source code for Strife was lost, which means, unlike the code for all the
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-use-reverse-DNS-naming-for-installing-.desktop-files.patch b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-use-reverse-DNS-naming-for-installing-.desktop-files.patch
new file mode 100644
index 000000000000..ceed45834ff0
--- /dev/null
+++ b/games-fps/chocolate-doom/files/chocolate-doom-3.0.1-use-reverse-DNS-naming-for-installing-.desktop-files.patch
@@ -0,0 +1,162 @@
+From bc50bd123e2b43ff404599b2a017a98261a66e47 Mon Sep 17 00:00:00 2001
+From: Mike Swanson <mikeonthecomputer@gmail.com>
+Date: Sat, 7 Sep 2019 10:57:50 -0700
+Subject: [PATCH] use reverse-DNS naming for installing *.desktop files
+
+This is similar to and consistent with the previous commit, and the
+desktop entry specification recommends doing this as well.
+---
+ configure.ac | 12 +++----
+ src/{doom.desktop.in => Doom.desktop.in} | 0
+ ...desktop.in => Doom_Screensaver.desktop.in} | 0
+ ...{heretic.desktop.in => Heretic.desktop.in} | 0
+ src/{hexen.desktop.in => Hexen.desktop.in} | 0
+ src/Makefile.am | 32 +++++++++----------
+ src/{strife.desktop.in => Strife.desktop.in} | 0
+ src/setup/Makefile.am | 6 ++--
+ .../{setup.desktop.in => Setup.desktop.in} | 0
+ 9 files changed, 25 insertions(+), 25 deletions(-)
+ rename src/{doom.desktop.in => Doom.desktop.in} (100%)
+ rename src/{doom-screensaver.desktop.in => Doom_Screensaver.desktop.in} (100%)
+ rename src/{heretic.desktop.in => Heretic.desktop.in} (100%)
+ rename src/{hexen.desktop.in => Hexen.desktop.in} (100%)
+ rename src/{strife.desktop.in => Strife.desktop.in} (100%)
+ rename src/setup/{setup.desktop.in => Setup.desktop.in} (100%)
+
+diff --git a/configure.ac b/configure.ac
+index 8a3e1bbc..032a8be2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -168,22 +168,22 @@ rpm.spec
+ data/Makefile
+ src/Makefile
+ src/Doom.metainfo.xml
+-src/doom.desktop
+-src/doom-screensaver.desktop
++src/Doom.desktop
++src/Doom_Screensaver.desktop
+ src/doom/Makefile
+ src/Heretic.metainfo.xml
+-src/heretic.desktop
++src/Heretic.desktop
+ src/heretic/Makefile
+ src/Hexen.metainfo.xml
+-src/hexen.desktop
++src/Hexen.desktop
+ src/hexen/Makefile
+ src/resource.rc
+ src/setup-res.rc
+ src/setup/Makefile
+-src/setup/setup.desktop
++src/setup/Setup.desktop
+ src/setup/setup-manifest.xml
+ src/Strife.metainfo.xml
+-src/strife.desktop
++src/Strife.desktop
+ src/strife/Makefile
+ textscreen/Makefile
+ textscreen/examples/Makefile
+diff --git a/src/doom.desktop.in b/src/Doom.desktop.in
+similarity index 100%
+rename from src/doom.desktop.in
+rename to src/Doom.desktop.in
+diff --git a/src/doom-screensaver.desktop.in b/src/Doom_Screensaver.desktop.in
+similarity index 100%
+rename from src/doom-screensaver.desktop.in
+rename to src/Doom_Screensaver.desktop.in
+diff --git a/src/heretic.desktop.in b/src/Heretic.desktop.in
+similarity index 100%
+rename from src/heretic.desktop.in
+rename to src/Heretic.desktop.in
+diff --git a/src/hexen.desktop.in b/src/Hexen.desktop.in
+similarity index 100%
+rename from src/hexen.desktop.in
+rename to src/Hexen.desktop.in
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 6880bd3c..19a42598 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -217,7 +217,7 @@ endif
+ EXTRA_DIST = \
+ CMakeLists.txt \
+ icon.c \
+- doom-screensaver.desktop.in \
++ Doom_Screensaver.desktop.in \
+ manifest.xml
+
+ metainfodir = $(prefix)/share/metainfo
+@@ -241,28 +241,28 @@ metainfo_DATA = \
+
+ appdir = $(prefix)/share/applications
+ app_DATA = \
+- @PROGRAM_PREFIX@doom.desktop \
+- @PROGRAM_PREFIX@heretic.desktop \
+- @PROGRAM_PREFIX@hexen.desktop \
+- @PROGRAM_PREFIX@strife.desktop
++ @PACKAGE_RDNS@.Doom.desktop \
++ @PACKAGE_RDNS@.Heretic.desktop \
++ @PACKAGE_RDNS@.Hexen.desktop \
++ @PACKAGE_RDNS@.Strife.desktop
+
+-@PROGRAM_PREFIX@doom.desktop : doom.desktop
+- cp doom.desktop $@
++@PACKAGE_RDNS@.Doom.desktop : Doom.desktop
++ cp Doom.desktop $@
+
+-@PROGRAM_PREFIX@heretic.desktop : heretic.desktop
+- cp heretic.desktop $@
++@PACKAGE_RDNS@.Heretic.desktop : Heretic.desktop
++ cp Heretic.desktop $@
+
+-@PROGRAM_PREFIX@hexen.desktop : hexen.desktop
+- cp hexen.desktop $@
++@PACKAGE_RDNS@.Hexen.desktop : Hexen.desktop
++ cp Hexen.desktop $@
+
+-@PROGRAM_PREFIX@strife.desktop : strife.desktop
+- cp strife.desktop $@
++@PACKAGE_RDNS@.Strife.desktop : Strife.desktop
++ cp Strife.desktop $@
+
+ screensaverdir = $(prefix)/share/applications/screensavers
+-screensaver_DATA = @PROGRAM_PREFIX@doom-screensaver.desktop
++screensaver_DATA = @PACKAGE_RDNS@.Doom_Screensaver.desktop
+
+-@PROGRAM_PREFIX@doom-screensaver.desktop: doom-screensaver.desktop
+- cp doom-screensaver.desktop $@
++@PACKAGE_RDNS@.Doom_Screensaver.desktop: Doom_Screensaver.desktop
++ cp Doom_Screensaver.desktop $@
+
+ CLEANFILES = $(execgames_SCRIPTS) $(app_DATA) $(screensaver_DATA)
+
+diff --git a/src/strife.desktop.in b/src/Strife.desktop.in
+similarity index 100%
+rename from src/strife.desktop.in
+rename to src/Strife.desktop.in
+diff --git a/src/setup/Makefile.am b/src/setup/Makefile.am
+index 76db29cf..a9dd240c 100644
+--- a/src/setup/Makefile.am
++++ b/src/setup/Makefile.am
+@@ -26,12 +26,12 @@ EXTRA_DIST= \
+ setup_icon.c
+
+ appdir = $(prefix)/share/applications
+-app_DATA = @PROGRAM_PREFIX@setup.desktop
++app_DATA = @PACKAGE_RDNS@.Setup.desktop
+
+ CLEANFILES = $(app_DATA)
+
+-@PROGRAM_PREFIX@setup.desktop : setup.desktop
+- cp setup.desktop $@
++@PACKAGE_RDNS@.Setup.desktop : Setup.desktop
++ cp Setup.desktop $@
+
+ if HAVE_PYTHON
+
+diff --git a/src/setup/setup.desktop.in b/src/setup/Setup.desktop.in
+similarity index 100%
+rename from src/setup/setup.desktop.in
+rename to src/setup/Setup.desktop.in
+--
+2.26.2
+
diff --git a/games-fps/chocolate-doom/metadata.xml b/games-fps/chocolate-doom/metadata.xml
new file mode 100644
index 000000000000..2b0187cf2a63
--- /dev/null
+++ b/games-fps/chocolate-doom/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription lang="en">
+ Chocolate Doom aims to accurately reproduce the original DOS version of Doom and other games based on the Doom engine in a form that can be run on modern computers.
+ </longdescription>
+ <maintainer type="person">
+ <email>vilhelm.gray@gmail.com</email>
+ <name>William Breathitt Gray</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="midi">basic support for MIDI files</flag>
+ </use>
+ <upstream>
+ <bugs-to>https://github.com/chocolate-doom/chocolate-doom/issues</bugs-to>
+ <doc lang="en">https://www.chocolate-doom.org</doc>
+ <remote-id type="github">chocolate-doom/chocolate-doom</remote-id>
+ </upstream>
+</pkgmetadata>