diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2024-04-22 19:58:02 +0000 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2024-04-22 19:58:02 +0000 |
commit | d949e46589855bdfdd35a6be9f5e502886db2a73 (patch) | |
tree | eec9334c682b8299996b504a4d8b61430138c466 /www-apps | |
parent | www-apps/moodle: bumps to 4.2.7, 4.3.4 (diff) | |
download | gentoo-d949e46589855bdfdd35a6be9f5e502886db2a73.tar.gz gentoo-d949e46589855bdfdd35a6be9f5e502886db2a73.tar.bz2 gentoo-d949e46589855bdfdd35a6be9f5e502886db2a73.zip |
www-apps/moodle: add 4.4
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'www-apps')
-rw-r--r-- | www-apps/moodle/Manifest | 1 | ||||
-rw-r--r-- | www-apps/moodle/moodle-4.4.ebuild | 123 |
2 files changed, 124 insertions, 0 deletions
diff --git a/www-apps/moodle/Manifest b/www-apps/moodle/Manifest index acd87d8e83d8..32fb842836a5 100644 --- a/www-apps/moodle/Manifest +++ b/www-apps/moodle/Manifest @@ -1,2 +1,3 @@ DIST moodle-4.2.7.tgz 65414482 BLAKE2B 987ade651e5b6b7c2cca89afb40f9c0bc4fc6f166e4c5b009b9a0fa509d1c464f8b6f6051274d304be7adcc877c21a43d78fe92eee3b73b763d64a36dfc88ca4 SHA512 8d7545a2c1a0b443698760b4c4341bd5ffb26c92f3409bea798e85a3ab99f1e1c4ca10b8c8f2f744483ff89af46ee9d4393379e6a32927fd254bf2ccb8b82836 DIST moodle-4.3.4.tgz 66773789 BLAKE2B 586653e30739d42583b7ce100c02b1c9e521551dc796567652b0f10bdf1ae94484250885220b97c74b225998c1c05b94bcd42a923c71460c0a7ee0ccbffbe6ce SHA512 03eb49308a2da72920f43bcc4c161e8822acfd4667623548c51770b3b9a79cafdb265dde9fb6615a563b4e16a4ce0ada992ea7dbd682f845e216a57bbb88b95c +DIST moodle-4.4.tgz 71137364 BLAKE2B 32ddecccd2f745080a43056f2624137dec77392ca9c4c14e6fcc4abac6a3d98a58c7e4b064902cae7752a324d7ec6f690f321e052adc67b98320eb689f0b716b SHA512 d64411867ab8ef4411ec7f39f4de1ae1d57591ce08b7ac4356025703c9161a69a3259ed6cafd4db55da0ab1f33747600a19567e5db47a8fb101efa1bc4f1a218 diff --git a/www-apps/moodle/moodle-4.4.ebuild b/www-apps/moodle/moodle-4.4.ebuild new file mode 100644 index 000000000000..55200877a180 --- /dev/null +++ b/www-apps/moodle/moodle-4.4.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +inherit webapp + +DESCRIPTION="The Moodle Course Management System" +HOMEPAGE="https://moodle.org" + +MY_BRANCH="stable$(ver_cut 1)0$(ver_cut 2)" +SRC_URI="https://download.moodle.org/download.php/direct/${MY_BRANCH}/${P}.tgz" +S="${WORKDIR}/${PN}" + +LICENSE="GPL-3+" +KEYWORDS="~amd64 ~arm ~ppc64 ~x86" +#SLOT empty due to webapp + +DB_FLAGS="mysqli?,mssql?,postgres?" +DB_TYPES=${DB_FLAGS//\?/} +DB_TYPES=${DB_TYPES//,/ } + +AUTHENTICATION_FLAGS="imap?,ldap?,odbc?" +AUTHENTICATION_MODES=${AUTHENTICATION_FLAGS//\?/} +AUTHENTICATION_MODES=${AUTHENTICATION_MODES//,/ } + +PHP_REQUIRED_FLAGS="ctype,curl,iconv,json(+),session,simplexml,sodium,xml,zip" +PHP_OPTIONAL_FLAGS="gd,intl,soap,ssl,tokenizer" +PHP_FLAGS="${PHP_REQUIRED_FLAGS},${PHP_OPTIONAL_FLAGS}" + +IUSE="${DB_TYPES} ${AUTHENTICATION_MODES} vhosts" + +# No forced dependency on +# mssql? - lives on a windows server +# mysql? ( virtual/mysql ) +# postgres? ( dev-db/postgresql-server-9* ) +# which may live on another server. These USE flags affect the configuration +# file and the dependency on php. However other dbs are possible. See config.php +# and the moodle documentation for other possibilities. +DEPEND="" +RDEPEND=" + || ( + dev-lang/php:8.1[${DB_FLAGS},${AUTHENTICATION_FLAGS},${PHP_FLAGS}] + dev-lang/php:8.2[${DB_FLAGS},${AUTHENTICATION_FLAGS},${PHP_FLAGS}] + ) + virtual/httpd-php + virtual/cron" + +pkg_setup() { + webapp_pkg_setup + + # How many dbs were selected? If one and only one, which one is it? + MYDB="" + DB_COUNT=0 + for db in ${DB_TYPES}; do + if use ${db}; then + MYDB=${db} + DB_COUNT=$(($DB_COUNT+1)) + fi + done + + if [[ ${DB_COUNT} -eq 0 ]]; then + eerror + eerror "No database selected in your USE flags," + eerror "You must select at least one." + eerror + die + fi + + if [[ ${DB_COUNT} -gt 1 ]]; then + MYDB="" + ewarn + ewarn "Multiple databases selected in your USE flags," + ewarn "You will have to choose your database manually." + ewarn + fi +} + +src_prepare() { + rm COPYING.txt + cp "${FILESDIR}"/config-r1.php config.php + + # Moodle expect pgsql, not postgres + MYDB=${MYDB/postgres/pgsql} + + if [[ ${DB_COUNT} -eq 1 ]] ; then + sed -i -e "s|mydb|${MYDB}|" config.php + fi + + eapply_user +} + +src_install() { + webapp_src_preinst + + local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle + dodir ${MOODLEDATA} + webapp_serverowned -R "${MOODLEDATA}" + + local MOODLEROOT="${MY_HTDOCSDIR}" + insinto ${MOODLEROOT} + doins -r * + + webapp_configfile "${MOODLEROOT}"/config.php + + if [[ ${DB_COUNT} -eq 1 ]]; then + webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt + else + webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt + fi + + webapp_src_install +} + +pkg_postinst() { + einfo + einfo + einfo "To see the post install instructions, do" + einfo + einfo " webapp-config --show-postinst ${PN} ${PVR}" + einfo + einfo +} |