1 # Copyright 1999-2025 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 MY_BRANCH=$(ver_cut 1-2)
9 DESCRIPTION="The MediaWiki wiki web application (as used on wikipedia.org)"
10 HOMEPAGE="http://www.mediawiki.org"
11 SRC_URI="http://releases.wikimedia.org/${PN}/${MY_BRANCH}/${P}.tar.gz"
14 KEYWORDS="~alpha amd64 ~arm ~arm64 ppc x86"
15 IUSE="imagemagick mysql postgres +sqlite"
16 REQUIRED_USE="|| ( mysql postgres sqlite )"
18 RDEPEND="dev-lang/php[calendar,ctype,fileinfo,iconv,intl,json(+),postgres?,session,ssl,unicode,xml,xmlreader]
19 imagemagick? ( virtual/imagemagick-tools )
20 !imagemagick? ( dev-lang/php[gd] )
21 mysql? ( dev-lang/php[mysql,mysqli] )
23 dev-db/sqlite[fts3(+)]
24 dev-lang/php[pdo,sqlite]
35 # remove lua binaries (bug #631554)
36 rm -r "${S}"/extensions/Scribunto/includes/engines/LuaStandalone/binaries || die "Failed to remove lua binaries"
42 # First we install docs and then copy everything left into htdocs dir
43 # to avoid bugs like #236411.
45 # We ensure the directories are prepared for writing. The post-
46 # install instructions guide the user to enable the feature.
47 local DOCS="FAQ HISTORY INSTALL README.md RELEASE-NOTES-${PV:0:4} UPGRADE"
48 dodoc ${DOCS} docs/*.txt
50 dodoc docs/databases/*
51 # Clean everything not used at the site...
52 rm -r ${DOCS} COPYING tests docs || die
53 find . -name Makefile -delete || die
55 insinto "${MY_HTDOCSDIR}"
58 # If imagemagick is enabled then setup for image upload.
59 # We ensure the directory is prepared for writing.
60 if use imagemagick ; then
61 webapp_serverowned "${MY_HTDOCSDIR}"/images
64 webapp_postinst_txt en "${FILESDIR}/postinstall-1.18-en.txt"
65 webapp_postupgrade_txt en "${FILESDIR}/postupgrade-1.16-en.txt"
72 if [[ -n ${REPLACING_VERSIONS} ]]; then
74 elog "=== Consult the release notes ==="
75 elog "Before doing anything, stop and consult the release notes"
76 elog "/usr/share/doc/${PF}/RELEASE-NOTES-${PV:0:4}.bz2"
78 elog "These detail bug fixes, new features and functionality, and any"
79 elog "particular points that may need to be noted during the upgrade procedure."
81 elog "If you plan to use the Scribunto extension with Lua, make sure to configure"
82 elog "path to Lua executable using this documentation:"
83 elog "https://www.mediawiki.org/wiki/Extension:Scribunto#Lua_binary"
85 ewarn "Back up existing files and the database before upgrade."
86 ewarn "http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki"
87 ewarn "provides an overview of the backup process."