1 |
commit: 9fcfba56b3be5d69be37160a3a7437ff45e6c415 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 22 21:27:20 2011 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 22 21:27:20 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/blueness.git;a=commit;h=9fcfba56 |
7 |
|
8 |
www-apps/moodle: moved to tree |
9 |
|
10 |
(Portage version: 2.1.9.25/git/Linux x86_64, unsigned Manifest commit) |
11 |
|
12 |
--- |
13 |
www-apps/moodle/ChangeLog | 5 + |
14 |
www-apps/moodle/Manifest | 9 +- |
15 |
www-apps/moodle/files/config.php | 29 ---- |
16 |
www-apps/moodle/files/postinstall-en.txt | 220 ------------------------- |
17 |
www-apps/moodle/files/postinstall-nodb-en.txt | 6 - |
18 |
www-apps/moodle/moodle-1.9.11.ebuild | 121 -------------- |
19 |
www-apps/moodle/moodle-2.0.2.ebuild | 133 --------------- |
20 |
7 files changed, 6 insertions(+), 517 deletions(-) |
21 |
|
22 |
diff --git a/www-apps/moodle/ChangeLog b/www-apps/moodle/ChangeLog |
23 |
index a8927f8..e2fdf28 100644 |
24 |
--- a/www-apps/moodle/ChangeLog |
25 |
+++ b/www-apps/moodle/ChangeLog |
26 |
@@ -2,6 +2,11 @@ |
27 |
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 |
28 |
# $Header: /var/cvsroot/gentoo-x86/www-apps/moodle/ChangeLog,v 1.1 2010/07/19 14:05:32 blueness Exp $ |
29 |
|
30 |
+ 22 Feb 2011; Anthony G. Basile <blueness@g.o> |
31 |
+ -moodle-1.9.11.ebuild, -moodle-2.0.2.ebuild, -files/config.php, |
32 |
+ -files/postinstall-en.txt, -files/postinstall-nodb-en.txt: |
33 |
+ moved to tree |
34 |
+ |
35 |
*moodle-2.0.2 (22 Feb 2011) |
36 |
*moodle-1.9.11 (22 Feb 2011) |
37 |
|
38 |
|
39 |
diff --git a/www-apps/moodle/Manifest b/www-apps/moodle/Manifest |
40 |
index 59afe81..eb91aee 100644 |
41 |
--- a/www-apps/moodle/Manifest |
42 |
+++ b/www-apps/moodle/Manifest |
43 |
@@ -1,9 +1,2 @@ |
44 |
-AUX config.php 718 RMD160 9e4b97aafca65da8648466d11728c457fff439ab SHA1 d71fc86158e82f706ca2cdfe1efe2e8de62cc607 SHA256 c62a37c0d81043ee4ca7fc4d7610d19dc2df426d556eb3285d7b1fe367a44a8d |
45 |
-AUX postinstall-en.txt 6524 RMD160 d3799bc5cdc283e787c1b5d08935a8d7851d0c8d SHA1 097744447c046848611bfe53d5191518465f1c6d SHA256 dad8831abc23179ebcd2c2431f11d83346c142175c59da47cf5f913c928de667 |
46 |
-AUX postinstall-nodb-en.txt 171 RMD160 88ff71d95c63f1b5d76e398c3566ada75954cdf4 SHA1 26748e5f24207ef5cb145e3668e1f17cdcddf699 SHA256 f39ff660a1cafbbd96ce18c46f056450ace04df5ac401eeccaf16441d54f3b6a |
47 |
-DIST moodle-1.9.11.tgz 14045392 RMD160 d50216d4cf535533aed7ca7dcc9211cbbe2fb52f SHA1 0355999061bff37693e2cf8f55e11abcfc0a7744 SHA256 b21da3a8e73c061b2115242b73e5328d078f979b9ca86523a392857c4fc59531 |
48 |
-DIST moodle-2.0.2.tgz 22270280 RMD160 957100de1ac3123911147ac5b00fe574b0cc0804 SHA1 c720e6dba716d21c6fa87cc88fbf939ab53c8320 SHA256 64c360b787e4bb099c328da09cf3b969d02c8ef57cc9d895598f0ddb4c7a44fe |
49 |
-EBUILD moodle-1.9.11.ebuild 3019 RMD160 e89e36d92c7a66a212b32d0c9e9b17544a001edc SHA1 7f51fd0eeb1821e0c44adc09a75421350f5ec094 SHA256 ca63bb55126abc1ad93d4670c2607440abeaae27ab2a4973a7fcec1730becba2 |
50 |
-EBUILD moodle-2.0.2.ebuild 3582 RMD160 7de28d2289a51b25a6ee06e908f127a1c6751589 SHA1 38dd39644547d2307a6e127803ad3e3c6f266eb4 SHA256 40497a4218c753fdc2d63baa3c321aa164b29ca052550f3b78d04310ee2c7709 |
51 |
-MISC ChangeLog 2583 RMD160 e5d88e582fc351705feb2c2499270db9e74cc226 SHA1 2e56d355290e041d70d34d4ea2241362e111f8ed SHA256 8dc0b2b8507d509d1ab49cb2019a991f4c0dfbe8dbbb071d81a00fc7493c55b1 |
52 |
+MISC ChangeLog 2782 RMD160 0cb75c05055e3e5a8c6b335e001a059f122b08aa SHA1 d623c7365d1dea47c9b521d697c23dd08eff6a98 SHA256 b16656e7fc791e54421e35be44ce6130309e5e599cebe05f775c394456d814d5 |
53 |
MISC metadata.xml 256 RMD160 7cd5a16a6eade95f71d40edbb4729baadfbc7649 SHA1 809eeef12d97ae39db024aea151a70c7363475b7 SHA256 8230894d717ea9f2e42f9c7de54671126820f89bf05ca96ec5f03842b12378e1 |
54 |
|
55 |
diff --git a/www-apps/moodle/files/config.php b/www-apps/moodle/files/config.php |
56 |
deleted file mode 100644 |
57 |
index c959b4a..0000000 |
58 |
--- a/www-apps/moodle/files/config.php |
59 |
+++ /dev/null |
60 |
@@ -1,29 +0,0 @@ |
61 |
-<?PHP |
62 |
-unset($CFG); |
63 |
-$CFG = new stdClass(); |
64 |
- |
65 |
-$CFG->dbtype = 'mydb'; |
66 |
-$CFG->dbhost = 'localhost'; |
67 |
-$CFG->dbname = 'moodle_db'; |
68 |
-$CFG->dbuser = 'moodle_user'; |
69 |
-$CFG->dbpass = 'moodle_pass'; |
70 |
-$CFG->prefix = 'mdl_'; |
71 |
- |
72 |
-$CFG->dbpersist = false; |
73 |
- |
74 |
-$CFG->wwwroot = 'http://localhost/moodle'; |
75 |
-$CFG->dirroot = '/var/www/localhost/htdocs/moodle'; |
76 |
-$CFG->dataroot = '/var/www/localhost/moodle' ; |
77 |
- |
78 |
-$CFG->directorypermissions = 02777; |
79 |
- |
80 |
-$CFG->admin = 'admin'; |
81 |
- |
82 |
-if (file_exists("$CFG->dirroot/lib/setup.php")) { |
83 |
- include_once("$CFG->dirroot/lib/setup.php"); |
84 |
-} else { |
85 |
- echo "<p>Could not find this file: $CFG->dirroot/lib/setup.php</p>"; |
86 |
- echo "<p>Please supply this file or reinstall moodle</p>"; |
87 |
- die; |
88 |
-} |
89 |
-?> |
90 |
|
91 |
diff --git a/www-apps/moodle/files/postinstall-en.txt b/www-apps/moodle/files/postinstall-en.txt |
92 |
deleted file mode 100644 |
93 |
index 6a5b44b..0000000 |
94 |
--- a/www-apps/moodle/files/postinstall-en.txt |
95 |
+++ /dev/null |
96 |
@@ -1,220 +0,0 @@ |
97 |
-NEW INSTALLS |
98 |
- |
99 |
-0 Check to see if webapp-config automatically installed |
100 |
- moodle for you in /var/www/localhost/htdocs. You should |
101 |
- see a directory in there called moodle. If it didn't |
102 |
- install it manually: |
103 |
- |
104 |
- webapp-config -d moodle -I moodle X.Y.Z |
105 |
- |
106 |
- Replace X.Y.Z with whatever version you just emerged. |
107 |
- |
108 |
-1 Edit the config.php file found at |
109 |
- |
110 |
- /var/www/localhost/htdocs/moodle/config.php |
111 |
- |
112 |
- You should probably change the database password, |
113 |
- $CFG->dbpass = 'moodle_pass' to something more |
114 |
- obscure. Also, if your system has a FQDN, change |
115 |
- the $CFG->wwwroot = 'http://localhost/moodle' |
116 |
- to match the URL of your moodle installation. |
117 |
- |
118 |
- |
119 |
- IF YOU ARE USING MYSQL, do step 2a |
120 |
- IF YOU ARE USING POSTGRESQL, do step 2b |
121 |
- |
122 |
- |
123 |
-2a Create a new mysql database and account with the |
124 |
- appropriate privileges. Make sure the username, |
125 |
- password and database match their values in |
126 |
- config.php from step 1. |
127 |
- |
128 |
- Connect to your mysql server using |
129 |
- |
130 |
- mysql -p -u root |
131 |
- |
132 |
- and at the mysql> prompt issue the following commands |
133 |
- |
134 |
- CREATE DATABASE moodle_db; |
135 |
- GRANT ALL ON moodle_db.* |
136 |
- TO moodle_user@localhost |
137 |
- IDENTIFIED BY 'moodle_pass'; |
138 |
- flush privileges; |
139 |
- |
140 |
-2b Issue the following commands at a shell, making sure |
141 |
- the username, password and database match their values |
142 |
- in config.php from step 1. |
143 |
- |
144 |
- su - postgres |
145 |
- psql -c "create user moodle_user createdb;" template1 |
146 |
- psql -c "alter user moodle_user with encrypted password 'moodle_pass';" template1 |
147 |
- psql -c "create database moodle_db with encoding 'unicode';" -U moodle_user template1 |
148 |
- psql -c "alter user moodle_user nocreatedb;" template1 |
149 |
- su - root |
150 |
- /etc/init.d/postgresql-X.Y reload |
151 |
- |
152 |
- Replace X.Y with your version postgresql. |
153 |
- |
154 |
- NOTE: Moodle docs say that moodle only works with |
155 |
- postgresql-7, but I've used it with 8 no problems. |
156 |
- |
157 |
-3 Direct your browser to the URL in step 1. You should see |
158 |
- the license agreement. Click "Yes" to continue. |
159 |
- |
160 |
-4 You are now about to install. Click the checkbox for |
161 |
- "Unattended operation" and "Continue" to start. Follow |
162 |
- the wizard as you "Setup administrator account" and configure |
163 |
- the "Front Page settings". |
164 |
- |
165 |
-5 You now have a working installation. Before putting it |
166 |
- into production, you'll probably want to check that |
167 |
- everything is sane. In the "Site Administration" block, |
168 |
- click on |
169 |
- |
170 |
- Server -> Environment |
171 |
- |
172 |
- Make sure that you've got the green okay on all the |
173 |
- Server Checks. If you don't, click on the ? icons for |
174 |
- popup help. |
175 |
- |
176 |
-6 Add a cron-job to root's crontab. |
177 |
- |
178 |
- su - root |
179 |
- crontab -e # fcrontab -e if you use fcron |
180 |
- |
181 |
- then add the line |
182 |
- |
183 |
- */30 * * * * root php -q /var/www/localhost/htdocs/moodle/admin/cron.php > /dev/null |
184 |
- |
185 |
-7 For more information on installing moodle, see |
186 |
- |
187 |
- http://docs.moodle.org/en/Installing_Moodle |
188 |
- |
189 |
- For information on working with moodle, see |
190 |
- |
191 |
- http://moodle.org/support/ |
192 |
- |
193 |
-================================================================= |
194 |
- |
195 |
-UPGRADES |
196 |
- |
197 |
-0 Before any upgade you should backup your database in case you have |
198 |
- to roll back. The moodle dirroot directory ($CFG->dirroot in the |
199 |
- config.php file) isn't as critical since you can always reinstall |
200 |
- that with web-apps. The moodle data root ($CFG->dataroot in config.php), |
201 |
- where files are uploaded, will not be touched. But the upgrade will |
202 |
- probably change your db schema, and the new format may not be backward |
203 |
- compatible. For mysql use |
204 |
- |
205 |
- mysqldump -u moodle_user -p -C -Q -e --create-options moodle_db > moodle-backup.sql |
206 |
- |
207 |
- or for postgresql use |
208 |
- |
209 |
- su - postgres |
210 |
- pg_dump moodle_db > moodle-backup.sql |
211 |
- |
212 |
- If you have to fall back, you can do so using |
213 |
- |
214 |
- mysql -p -u moodle_user moodle_db < moodle-backup.sql |
215 |
- |
216 |
- or |
217 |
- |
218 |
- su - postgres |
219 |
- psql moodle_db < moodle-backup.sql |
220 |
- |
221 |
- TEST THIS! PRACTICE THIS! Make sure it will work for you if you |
222 |
- have to fall back. |
223 |
- |
224 |
-1 Emerge the new moodle ebuild. Be prepared to add USE flags for |
225 |
- php and re-emerge it since upgrades may require new functionality |
226 |
- from php. Remember to restart apache after re-emerging php! |
227 |
- |
228 |
-2 If the ebuild didn't do it for you, update using |
229 |
- |
230 |
- webapp-config -d moodle -U moodle X.Y.Z |
231 |
- |
232 |
-3 Aim your browser to the URL in the config.php file defined |
233 |
- by $CFG->wwwroot. You will get a message that you are about |
234 |
- to automatically upgrade your server and cannot go back. |
235 |
- This is why you backed up your db in step 1. You can go back |
236 |
- if you use webapp-config to install the older version AND |
237 |
- drop the new db and restart the old one. You did practice |
238 |
- restoring, right? |
239 |
- |
240 |
-4 Click "Continue" and follow through with the upgrade. |
241 |
- |
242 |
- |
243 |
-================================================================= |
244 |
- |
245 |
-UNINSTALL |
246 |
- |
247 |
-1 Make sure you really want to do this. I mean REALLY! |
248 |
- After step 3 you will be past the point of no return. |
249 |
- |
250 |
-2 If you just want to uninstall the webapp, do the following |
251 |
- and no more! |
252 |
- |
253 |
- emerge --unmerge moodle |
254 |
- |
255 |
- Your data is still in the db and in the moodledata dir. |
256 |
- |
257 |
- |
258 |
- !!!!!!!!! POINT OF NO RETURN !!!!!!!!! |
259 |
- |
260 |
-3 Uninstall the uploaded files |
261 |
- |
262 |
- rm -rf /var/lib/moodledata |
263 |
- |
264 |
- |
265 |
- IF YOU ARE USING MYSQL, do step 4a |
266 |
- IF YOU ARE USING POSTGRESQL, do step 4b |
267 |
- |
268 |
- |
269 |
-4a Connect to your mysql server using 'mysql -p -u root' and |
270 |
- at the mysql> prompt issue the following commands: |
271 |
- |
272 |
- DROP DATABASE moodle_db; |
273 |
- DROP USER moodle_user@localhost ; |
274 |
- |
275 |
-4b Issue the following commands |
276 |
- |
277 |
- su - postgres |
278 |
- psql -c "drop database moodle_db;" template1 |
279 |
- psql -c "drop user moodle_user;" template1 |
280 |
- |
281 |
-5 Remove the root cron-job |
282 |
- |
283 |
- su - root |
284 |
- crontab -e # fcrontab -e if you use fcron |
285 |
- |
286 |
- and delete the line added above. |
287 |
- |
288 |
-================================================================= |
289 |
- |
290 |
-ADDITIONAL PHP REQUIREMENTS |
291 |
- |
292 |
- Moodle allows for many method of authentication. To see |
293 |
- what these are, in the "Site Administration" block, click |
294 |
- on |
295 |
- |
296 |
- Users -> Authentication -> Manage Authentication |
297 |
- |
298 |
- Moodle will try to authenticate by each method in order |
299 |
- until it either succeeds or exhausts the list and fails. |
300 |
- |
301 |
- In order to use some of these methods, you need to make |
302 |
- sure PHP was compiled with the correct support. You will |
303 |
- know that you do not have the correct support compiled in |
304 |
- if authentication by all previous methods fails, and you |
305 |
- encounter a method for which PHP does not have support. |
306 |
- An error will be thrown and reported in the web page. |
307 |
- |
308 |
- Currently, the ebuild has support for the following |
309 |
- |
310 |
- Auth Method USE flag |
311 |
- |
312 |
- IMAP(S) or POP3(S) imap |
313 |
- LDAP or CAS ldap |
314 |
- External database odbc |
315 |
- RADIUS radius |
316 |
- |
317 |
|
318 |
diff --git a/www-apps/moodle/files/postinstall-nodb-en.txt b/www-apps/moodle/files/postinstall-nodb-en.txt |
319 |
deleted file mode 100644 |
320 |
index 9126994..0000000 |
321 |
--- a/www-apps/moodle/files/postinstall-nodb-en.txt |
322 |
+++ /dev/null |
323 |
@@ -1,6 +0,0 @@ |
324 |
-You have not specified which database you are going to use. |
325 |
-You are on your own! Go to |
326 |
- |
327 |
- http://docs.moodle.org/en/Installing_Moodle |
328 |
- |
329 |
-and follow the instructions there. |
330 |
|
331 |
diff --git a/www-apps/moodle/moodle-1.9.11.ebuild b/www-apps/moodle/moodle-1.9.11.ebuild |
332 |
deleted file mode 100644 |
333 |
index d37fe0e..0000000 |
334 |
--- a/www-apps/moodle/moodle-1.9.11.ebuild |
335 |
+++ /dev/null |
336 |
@@ -1,121 +0,0 @@ |
337 |
-# Copyright 1999-2011 Gentoo Foundation |
338 |
-# Distributed under the terms of the GNU General Public License v2 |
339 |
-# $Header: /var/cvsroot/gentoo-x86/www-apps/moodle/moodle-1.9.10.ebuild,v 1.1 2010/10/29 15:55:40 blueness Exp $ |
340 |
- |
341 |
-EAPI="2" |
342 |
- |
343 |
-inherit versionator webapp |
344 |
- |
345 |
-AVC=( $(get_version_components) ) |
346 |
-MY_BRANCH="stable${AVC[0]}${AVC[1]}" |
347 |
- |
348 |
-DESCRIPTION="The Moodle Course Management System" |
349 |
-HOMEPAGE="http://moodle.org" |
350 |
-SRC_URI="http://download.moodle.org/${MY_BRANCH}/${P}.tgz" |
351 |
-S="${WORKDIR}/${PN}" |
352 |
- |
353 |
-LICENSE="GPL-2" |
354 |
-KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" |
355 |
-#SLOT empty due to webapp |
356 |
- |
357 |
-DBFLAGS="mysql?,postgres?" |
358 |
-DBTYPES=${DBFLAGS//\?/} |
359 |
-DBTYPES=${DBTYPES//,/ } |
360 |
- |
361 |
-AUTHFLAGS="imap?,ldap?,odbc?" |
362 |
-AUTHMODES=${AUTHFLAGS//\?/} |
363 |
-AUTHMODES=${AUTHMODES//,/ } |
364 |
- |
365 |
-PHPFLAGS="ctype,curl,gd,iconv,ssl,tokenizer,xml,xmlrpc,zlib" |
366 |
- |
367 |
-IUSE="${DBTYPES} ${AUTHMODES} vhosts" |
368 |
- |
369 |
-# No forced dependency on |
370 |
-# mysql? ( virtual/mysql ) |
371 |
-# postgres? ( dev-db/postgresql-server-7* ) |
372 |
-# which may live on another server |
373 |
-DEPEND="" |
374 |
-RDEPEND=">=dev-lang/php-4.3.0[${DBFLAGS},${AUTHFLAGS},${PHPFLAGS}] |
375 |
- virtual/httpd-php |
376 |
- virtual/cron" |
377 |
- |
378 |
-pkg_setup() { |
379 |
- webapp_pkg_setup |
380 |
- |
381 |
- # How many dbs were selected? If one and only one, which one is it? |
382 |
- MYDB="" |
383 |
- DBCOUNT=0 |
384 |
- for db in ${DBTYPES}; do |
385 |
- if use ${db}; then |
386 |
- MYDB=${db} |
387 |
- DBCOUNT=$(($DBCOUNT+1)) |
388 |
- fi |
389 |
- done |
390 |
- |
391 |
- if [[ ${DBCOUNT} -eq 0 ]]; then |
392 |
- eerror |
393 |
- eerror "\033[1;31m**************************************************\033[1;31m" |
394 |
- eerror "No database selected in your USE flags," |
395 |
- eerror "You must select at least one." |
396 |
- eerror "\033[1;31m**************************************************\033[1;31m" |
397 |
- eerror |
398 |
- die |
399 |
- fi |
400 |
- |
401 |
- if [[ ${DBCOUNT} -gt 1 ]]; then |
402 |
- MYDB="" |
403 |
- ewarn |
404 |
- ewarn "\033[1;33m**************************************************\033[1;33m" |
405 |
- ewarn "Multiple databases selected in your USE flags," |
406 |
- ewarn "You will have to choose your database manually." |
407 |
- ewarn "\033[1;33m**************************************************\033[1;33m" |
408 |
- ewarn |
409 |
- fi |
410 |
-} |
411 |
- |
412 |
-src_prepare() { |
413 |
- rm COPYING.txt |
414 |
- cp "${FILESDIR}"/config.php . |
415 |
- |
416 |
- # |
417 |
- # Moodle expect postgres7, not postgres |
418 |
- # |
419 |
- MYDB=${MYDB/postgres/postgres7} |
420 |
- if [[ ${DBCOUNT} -eq 1 ]] ; then |
421 |
- sed -i -e "s|mydb|${MYDB}|" config.php |
422 |
- fi |
423 |
-} |
424 |
- |
425 |
-src_install() { |
426 |
- webapp_src_preinst |
427 |
- |
428 |
- local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle |
429 |
- dodir ${MOODLEDATA} |
430 |
- webapp_serverowned -R "${MOODLEDATA}" |
431 |
- |
432 |
- local MOODLEROOT="${MY_HTDOCSDIR}" |
433 |
- insinto ${MOODLEROOT} || die "Unable to insinto ${MOODLEROOT}" |
434 |
- doins -r * |
435 |
- |
436 |
- webapp_configfile "${MOODLEROOT}"/config.php |
437 |
- |
438 |
- if [[ ${DBCOUNT} -eq 1 ]]; then |
439 |
- webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt |
440 |
- else |
441 |
- webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt |
442 |
- fi |
443 |
- |
444 |
- webapp_src_install |
445 |
-} |
446 |
- |
447 |
-pkg_postinst() { |
448 |
- einfo |
449 |
- einfo "\033[1;32m**************************************************\033[1;32m" |
450 |
- einfo |
451 |
- einfo "To see the post install instructions, do" |
452 |
- einfo |
453 |
- einfo " webapp-config --show-postinst ${PN} ${PVR}" |
454 |
- einfo |
455 |
- einfo "\033[1;32m**************************************************\033[1;32m" |
456 |
- einfo |
457 |
-} |
458 |
|
459 |
diff --git a/www-apps/moodle/moodle-2.0.2.ebuild b/www-apps/moodle/moodle-2.0.2.ebuild |
460 |
deleted file mode 100644 |
461 |
index b3c205d..0000000 |
462 |
--- a/www-apps/moodle/moodle-2.0.2.ebuild |
463 |
+++ /dev/null |
464 |
@@ -1,133 +0,0 @@ |
465 |
-# Copyright 1999-2011 Gentoo Foundation |
466 |
-# Distributed under the terms of the GNU General Public License v2 |
467 |
-# $Header: /var/cvsroot/gentoo-x86/www-apps/moodle/moodle-2.0.1.ebuild,v 1.1 2011/01/08 23:21:15 blueness Exp $ |
468 |
- |
469 |
-EAPI="2" |
470 |
- |
471 |
-inherit versionator webapp |
472 |
- |
473 |
-AVC=( $(get_version_components) ) |
474 |
-MY_BRANCH="stable${AVC[0]}${AVC[1]}" |
475 |
- |
476 |
-DESCRIPTION="The Moodle Course Management System" |
477 |
-HOMEPAGE="http://moodle.org" |
478 |
-SRC_URI="http://download.moodle.org/${MY_BRANCH}/${P}.tgz" |
479 |
-S="${WORKDIR}/${PN}" |
480 |
- |
481 |
-LICENSE="GPL-2" |
482 |
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
483 |
-#SLOT empty due to webapp |
484 |
- |
485 |
-DB_FLAGS="mysqli?,postgres?" |
486 |
-DB_TYPES=${DB_FLAGS//\?/} |
487 |
-DB_TYPES=${DB_TYPES//,/ } |
488 |
- |
489 |
-AUTHENTICATION_FLAGS="imap?,ldap?,odbc?" |
490 |
-AUTHENTICATION_MODES=${AUTHENTICATION_FLAGS//\?/} |
491 |
-AUTHENTICATION_MODES=${AUTHENTICATION_MODES//,/ } |
492 |
- |
493 |
-PHP_REQUIRED_FLAGS_52="ctype,curl,iconv,json,pcre,simplexml,spl,xml,zip" |
494 |
-PHP_OPTIONAL_FLAGS_52="gd,soap,ssl,tokenizer,xmlrpc" |
495 |
-PHP_FLAGS_52="${PHP_REQUIRED_FLAGS_52},${PHP_OPTIONAL_FLAGS_52}" |
496 |
- |
497 |
-PHP_REQUIRED_FLAGS_53="ctype,curl,iconv,json,simplexml,xml,zip" |
498 |
-PHP_OPTIONAL_FLAGS_53="gd,intl,soap,ssl,tokenizer,xmlrpc" |
499 |
-PHP_FLAGS_53="${PHP_REQUIRED_FLAGS_53},${PHP_OPTIONAL_FLAGS_53}" |
500 |
- |
501 |
-IUSE="${DB_TYPES} ${AUTHENTICATION_MODES} vhosts" |
502 |
- |
503 |
-# No forced dependency on |
504 |
-# mysql? ( virtual/mysql ) |
505 |
-# postgres? ( dev-db/postgresql-server-7* ) |
506 |
-# which may live on another server |
507 |
-DEPEND="" |
508 |
-RDEPEND=" |
509 |
- || ( |
510 |
- =dev-lang/php-5.2*[${DB_FLAGS},${AUTHENTICATION_FLAGS},${PHP_FLAGS_52}] |
511 |
- =dev-lang/php-5.3*[${DB_FLAGS},${AUTHENTICATION_FLAGS},${PHP_FLAGS_53}] |
512 |
- ) |
513 |
- virtual/httpd-php |
514 |
- virtual/cron" |
515 |
- |
516 |
-pkg_setup() { |
517 |
- webapp_pkg_setup |
518 |
- |
519 |
- # How many dbs were selected? If one and only one, which one is it? |
520 |
- MYDB="" |
521 |
- DB_COUNT=0 |
522 |
- for db in ${DB_TYPES}; do |
523 |
- if use ${db}; then |
524 |
- MYDB=${db} |
525 |
- DB_COUNT=$(($DB_COUNT+1)) |
526 |
- fi |
527 |
- done |
528 |
- |
529 |
- if [[ ${DB_COUNT} -eq 0 ]]; then |
530 |
- eerror |
531 |
- eerror "\033[1;31m**************************************************\033[1;31m" |
532 |
- eerror "No database selected in your USE flags," |
533 |
- eerror "You must select at least one." |
534 |
- eerror "\033[1;31m**************************************************\033[1;31m" |
535 |
- eerror |
536 |
- die |
537 |
- fi |
538 |
- |
539 |
- if [[ ${DB_COUNT} -gt 1 ]]; then |
540 |
- MYDB="" |
541 |
- ewarn |
542 |
- ewarn "\033[1;33m**************************************************\033[1;33m" |
543 |
- ewarn "Multiple databases selected in your USE flags," |
544 |
- ewarn "You will have to choose your database manually." |
545 |
- ewarn "\033[1;33m**************************************************\033[1;33m" |
546 |
- ewarn |
547 |
- fi |
548 |
-} |
549 |
- |
550 |
-src_prepare() { |
551 |
- rm COPYING.txt |
552 |
- cp "${FILESDIR}"/config.php . |
553 |
- |
554 |
- # Moodle expect postgres7, not postgres |
555 |
- MYDB=${MYDB/postgres/postgres7} |
556 |
- |
557 |
- # Moodle expects mysql, not mysqli |
558 |
- MYDB=${MYDB/mysqli/mysql} |
559 |
- |
560 |
- if [[ ${DB_COUNT} -eq 1 ]] ; then |
561 |
- sed -i -e "s|mydb|${MYDB}|" config.php |
562 |
- fi |
563 |
-} |
564 |
- |
565 |
-src_install() { |
566 |
- webapp_src_preinst |
567 |
- |
568 |
- local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle |
569 |
- dodir ${MOODLEDATA} |
570 |
- webapp_serverowned -R "${MOODLEDATA}" |
571 |
- |
572 |
- local MOODLEROOT="${MY_HTDOCSDIR}" |
573 |
- insinto ${MOODLEROOT} || die "Unable to insinto ${MOODLEROOT}" |
574 |
- doins -r * |
575 |
- |
576 |
- webapp_configfile "${MOODLEROOT}"/config.php |
577 |
- |
578 |
- if [[ ${DB_COUNT} -eq 1 ]]; then |
579 |
- webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt |
580 |
- else |
581 |
- webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt |
582 |
- fi |
583 |
- |
584 |
- webapp_src_install |
585 |
-} |
586 |
- |
587 |
-pkg_postinst() { |
588 |
- einfo |
589 |
- einfo "\033[1;32m**************************************************\033[1;32m" |
590 |
- einfo |
591 |
- einfo "To see the post install instructions, do" |
592 |
- einfo |
593 |
- einfo " webapp-config --show-postinst ${PN} ${PVR}" |
594 |
- einfo |
595 |
- einfo "\033[1;32m**************************************************\033[1;32m" |
596 |
- einfo |
597 |
-} |