Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/moodle/
Date: Mon, 30 Jan 2023 16:33:07
Message-Id: 1675096379.d628dfb1c4e1dc31d20fafd67b10754749928947.blueness@gentoo
1 commit: d628dfb1c4e1dc31d20fafd67b10754749928947
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 30 16:32:19 2023 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 30 16:32:59 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d628dfb1
7
8 www-apps/moodle: add 4.1.1
9
10 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
11
12 www-apps/moodle/Manifest | 1 +
13 www-apps/moodle/moodle-4.1.1.ebuild | 120 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 121 insertions(+)
15
16 diff --git a/www-apps/moodle/Manifest b/www-apps/moodle/Manifest
17 index 5ad57bb323e5..b358ff229a6e 100644
18 --- a/www-apps/moodle/Manifest
19 +++ b/www-apps/moodle/Manifest
20 @@ -1,2 +1,3 @@
21 DIST moodle-3.11.12.tgz 60456820 BLAKE2B 702a3352e64a5f1b1e0713474f8b5297410dbc5e57aa8902471f7d4f8c7fbae0503fc4addc55b89345858fa25492305048c401eec77ab2ebdd773ed3d878496d SHA512 92d299f798956d05cb82f05e930d3ec21685b12a58e0105a8bfb7ac996c10b18870b8dd17ebefb6cc9518d360d02976e1de6f303d15630d886df7aac46d05708
22 DIST moodle-4.0.6.tgz 62119193 BLAKE2B 5ba5d48fc741f9c51cf5621c9143614b5eb50d5f0ae79b36bf320a83d90214779d915485211d00041cc96b92a72d5a133313f087d78c38120c8b948fd5236a58 SHA512 d6454913ac53a7505abed81b1db8389513218065502e3a5625d2b58cdd534e97603a190d58e7c1fc9b11dae833d81025dd8ca12ae483879c9f22e2a01e531447
23 +DIST moodle-4.1.1.tgz 64758192 BLAKE2B 2632c1524208001030f9baa92f2c487d7bf3feb205ee26ce8360ddd9e1b67424f110095eb82441ad6175115d71b80a3147c06abcc2be476236410cc3982896e9 SHA512 a636ac66da040bd90cd7da6d40f76454b78b625b583eec105204e574b54711d7709821abe83d5fc85738737ec21b418e4ba0847b1de1937a7ebf3a990dbf7e17
24
25 diff --git a/www-apps/moodle/moodle-4.1.1.ebuild b/www-apps/moodle/moodle-4.1.1.ebuild
26 new file mode 100644
27 index 000000000000..0557b7cafcb2
28 --- /dev/null
29 +++ b/www-apps/moodle/moodle-4.1.1.ebuild
30 @@ -0,0 +1,120 @@
31 +# Copyright 1999-2023 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI="7"
35 +
36 +inherit webapp
37 +
38 +DESCRIPTION="The Moodle Course Management System"
39 +HOMEPAGE="https://moodle.org"
40 +
41 +MY_BRANCH="stable$(ver_cut 1)0$(ver_cut 2)"
42 +SRC_URI="https://download.moodle.org/download.php/direct/${MY_BRANCH}/${P}.tgz"
43 +S="${WORKDIR}/${PN}"
44 +
45 +LICENSE="GPL-3+"
46 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
47 +#SLOT empty due to webapp
48 +
49 +DB_FLAGS="mysqli?,mssql?,postgres?"
50 +DB_TYPES=${DB_FLAGS//\?/}
51 +DB_TYPES=${DB_TYPES//,/ }
52 +
53 +AUTHENTICATION_FLAGS="imap?,ldap?,odbc?"
54 +AUTHENTICATION_MODES=${AUTHENTICATION_FLAGS//\?/}
55 +AUTHENTICATION_MODES=${AUTHENTICATION_MODES//,/ }
56 +
57 +PHP_REQUIRED_FLAGS="ctype,curl,iconv,json(+),session,simplexml,xml,zip"
58 +PHP_OPTIONAL_FLAGS="gd,intl,soap,ssl,tokenizer,xmlrpc"
59 +PHP_FLAGS="${PHP_REQUIRED_FLAGS},${PHP_OPTIONAL_FLAGS}"
60 +
61 +IUSE="${DB_TYPES} ${AUTHENTICATION_MODES} vhosts"
62 +
63 +# No forced dependency on
64 +# mssql? - lives on a windows server
65 +# mysql? ( virtual/mysql )
66 +# postgres? ( dev-db/postgresql-server-9* )
67 +# which may live on another server. These USE flags affect the configuration
68 +# file and the dependency on php. However other dbs are possible. See config.php
69 +# and the moodle documentation for other possibilities.
70 +DEPEND=""
71 +RDEPEND="
72 + dev-lang/php:7.4[${DB_FLAGS},${AUTHENTICATION_FLAGS},${PHP_FLAGS}]
73 + virtual/httpd-php
74 + virtual/cron"
75 +
76 +pkg_setup() {
77 + webapp_pkg_setup
78 +
79 + # How many dbs were selected? If one and only one, which one is it?
80 + MYDB=""
81 + DB_COUNT=0
82 + for db in ${DB_TYPES}; do
83 + if use ${db}; then
84 + MYDB=${db}
85 + DB_COUNT=$(($DB_COUNT+1))
86 + fi
87 + done
88 +
89 + if [[ ${DB_COUNT} -eq 0 ]]; then
90 + eerror
91 + eerror "No database selected in your USE flags,"
92 + eerror "You must select at least one."
93 + eerror
94 + die
95 + fi
96 +
97 + if [[ ${DB_COUNT} -gt 1 ]]; then
98 + MYDB=""
99 + ewarn
100 + ewarn "Multiple databases selected in your USE flags,"
101 + ewarn "You will have to choose your database manually."
102 + ewarn
103 + fi
104 +}
105 +
106 +src_prepare() {
107 + rm COPYING.txt
108 + cp "${FILESDIR}"/config-r1.php config.php
109 +
110 + # Moodle expect pgsql, not postgres
111 + MYDB=${MYDB/postgres/pgsql}
112 +
113 + if [[ ${DB_COUNT} -eq 1 ]] ; then
114 + sed -i -e "s|mydb|${MYDB}|" config.php
115 + fi
116 +
117 + eapply_user
118 +}
119 +
120 +src_install() {
121 + webapp_src_preinst
122 +
123 + local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle
124 + dodir ${MOODLEDATA}
125 + webapp_serverowned -R "${MOODLEDATA}"
126 +
127 + local MOODLEROOT="${MY_HTDOCSDIR}"
128 + insinto ${MOODLEROOT}
129 + doins -r *
130 +
131 + webapp_configfile "${MOODLEROOT}"/config.php
132 +
133 + if [[ ${DB_COUNT} -eq 1 ]]; then
134 + webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
135 + else
136 + webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt
137 + fi
138 +
139 + webapp_src_install
140 +}
141 +
142 +pkg_postinst() {
143 + einfo
144 + einfo
145 + einfo "To see the post install instructions, do"
146 + einfo
147 + einfo " webapp-config --show-postinst ${PN} ${PVR}"
148 + einfo
149 + einfo
150 +}