diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /www-apps/moodle |
reinit the tree, so we can have metadata
Diffstat (limited to 'www-apps/moodle')
-rw-r--r-- | www-apps/moodle/Manifest | 13 | ||||
-rw-r--r-- | www-apps/moodle/files/config-r1.php | 36 | ||||
-rw-r--r-- | www-apps/moodle/files/config.php | 29 | ||||
-rw-r--r-- | www-apps/moodle/files/postinstall-en.txt | 220 | ||||
-rw-r--r-- | www-apps/moodle/files/postinstall-nodb-en.txt | 6 | ||||
-rw-r--r-- | www-apps/moodle/metadata.xml | 12 | ||||
-rw-r--r-- | www-apps/moodle/moodle-3.1.8.ebuild | 121 | ||||
-rw-r--r-- | www-apps/moodle/moodle-3.2.5.ebuild | 121 | ||||
-rw-r--r-- | www-apps/moodle/moodle-3.3.2.ebuild | 123 |
9 files changed, 681 insertions, 0 deletions
diff --git a/www-apps/moodle/Manifest b/www-apps/moodle/Manifest new file mode 100644 index 000000000000..70df4d868470 --- /dev/null +++ b/www-apps/moodle/Manifest @@ -0,0 +1,13 @@ +AUX config-r1.php 1780 SHA256 b97d05c5701dda71fd8edd62b38c9f0d2c9d8b35fb8700d3b021968fc4c448db SHA512 9929df2b4b0db7ab759f35d919ffd65b06a7063ad0908368aa5bd027f52f1992f0b46ec121d90076f664eb00b8e9386d8ae286acfe95b475ce1e9b2e1c5e1700 WHIRLPOOL d4cfd1d82b5d7cf8413f311495dbb8aca9453ea5d26e9ac92e2ed303cb2f2e9b9ceec3f4658dc1b58e09c1af71d0778d90c51904244a98378016fa0c02284a0a +AUX config.php 718 SHA256 c62a37c0d81043ee4ca7fc4d7610d19dc2df426d556eb3285d7b1fe367a44a8d SHA512 38347d3a275397074abe3cc8cd1521c7fe2deb45f4702d7a8a3e3c30ab6e2c1c51fa2c1f58d7fc99f0b72f2dcd243b8dcfdd7b3641c22c41399705aab6b59479 WHIRLPOOL 51daeca50711e6cda7ef3703be71fd59bd7abeb2bfa4b0c7b42924dea5d0cbb9d4fac478aeb13bc655d097bbed3ddb99e35e43c6b2f800cabcf916142996bbb8 +AUX postinstall-en.txt 6524 SHA256 dad8831abc23179ebcd2c2431f11d83346c142175c59da47cf5f913c928de667 SHA512 bb3e5187db6be49707801cfde15ebced065f2d4b8c1a04fef2f4ced0a67dab2440b8e79d110685056cad84647f8ebb587c697452df8e2b0eab07b015d01b92cf WHIRLPOOL 6ed4f9db76238db6e0a2afd98b8877a1de4e06311d77a6153bb9d8bbc559fd226190c7bf4a8053e35000fcb24babf154021a42d1b58ba92c3ee86bb5dfae1894 +AUX postinstall-nodb-en.txt 171 SHA256 f39ff660a1cafbbd96ce18c46f056450ace04df5ac401eeccaf16441d54f3b6a SHA512 b0cf4787351f904caf06573c5bc50275b6a11361170b4006acc24224f44efde69cfe3a9b6340d6787c5805c605dc89f07072bf992b0ee255c97fba90e5d5617e WHIRLPOOL 3f91b917e8c92866d570c0af2dabbb11eb6bdf7d4cf3e9e8984649b5c147736f267156c490ab51fcd7fda9e7b3ac2ead8259231b20e74e349fb143ed44b08616 +DIST moodle-3.1.8.tgz 38015937 SHA256 5209cdda1eaf3f88eb7e9eb852217ad5918607077251dab7fe29f088c76db35d SHA512 e35912f10fa98bdb0e392f2020fa48c21d077608a6877f4a35c019c34963cc14522664f6bf88a7e98f01e42d0c171c9dbd2f4403d330baab321645fdb1d60fe2 WHIRLPOOL f31973f6845203bad40d6cad6ab560263fa972a38d697d4bd8fae85d10ab63474472055365d90f1566c97cf299efcfeb07d7913af8b5e9660e2e8689c8689d41 +DIST moodle-3.2.5.tgz 39902419 SHA256 53a381988fc0aa0169c4e2af2364406614bc3cf0948631a1f3008df3ccbfa3c4 SHA512 f1773d0c118c4e0952ce2606d6982af2641d13d4a4d6630d8a4cb4d5ccaee6c8ecd8fb9d596e7b0947c3ca893efdd5ea4baf35b52832f71c021703b9cbfe2f4c WHIRLPOOL 7c9d48d6c0a28a47e6dd6f848cf07cf36efcc0b7ca2c5bd5e566213ac7928567afbec4e222ac01e56eb496acb6cd665c235ff84ce551d569f4f5a2114848bfb8 +DIST moodle-3.3.2.tgz 44171663 SHA256 1a34c8e85d05bb693a1f4f5e70b63f527cac655101236ab1e474aa295843fbf1 SHA512 58b97f3e8f9f5c8956acce77be1e75dcc49ca27bb7032bdc70e386d6dc39dfc843b450ade27061a547f766073ec21564767af50140ac18915ab6cf92a0250973 WHIRLPOOL b69714dae5305f140a6beb441414b79ee5040e58fd8e60e2c958314b5758dd352fdbfaf3e3df38dc2e3185494474eaabee83ad7e51e4fb19eda35996b696e9e5 +EBUILD moodle-3.1.8.ebuild 2938 SHA256 8d3c9fb81b567167c73879b281dd7aae053c20d18c349c040373e7cd7f5485bb SHA512 23ecf21df367beff9762d4c5c68b405b80093c39803aeced955a0e8b57e721b1dd130bc61a79e60c684aba03ab0e93c119e1556e91aaeac68a12c48dfe82d1ab WHIRLPOOL 4c58da7fcf33ec298c719865ed1f9c3f6f2c6004440f82a1f1a6347a091954d4b1b2fce2a03228202c913940971c1ed80caf77a684a1aded75e1d0046594d02f +EBUILD moodle-3.2.5.ebuild 2938 SHA256 b56a953c19cba3208774fe3d0fac7ad972022ada1da09bdf7673838ae67090b9 SHA512 3fafaef718e9069a1487643e2ba3f2274755d1463b11b13bcf35fdaebcce0eddad6267d1c097af983dec514845fcb4d924ba35fda6a824745b9c86aa83d0a3d4 WHIRLPOOL 849b3ccab219c56c6dbbcba719a6517aa7507bd33d9b997367efc6fee418f5d2d22dd4d7cac857bc720b18801e53a029c8a41ef80acc5dd5ed62a8a0dca92f1c +EBUILD moodle-3.3.2.ebuild 2952 SHA256 de68154143d4a6f1cbfab0a47424ced8bbf438bb2b03ff82d7661631086d0747 SHA512 21597a42153160cef4a7e5c1ae7cc59ad319a5b61afaf5f2bd372d8ef4848f0d1d57e3f729246f3f03266278c437b757255697dcbc1dad90be35203f0874aa2d WHIRLPOOL 767ddbe80771941052bb4fce8858b17e446b6d2c3e43ab053a6ae81c9220335b7831af574383498c861ed9ef57f22631eb0eadf086b4db557aad90138179becd +MISC ChangeLog 7896 SHA256 6183f3a0804cc92846de2339dd60ff161ca606fa7be90da9313d3fb4c4fddc42 SHA512 222887f0493de055e1c8e49dc03bc69f30b555dfce2045a9f63f1269c11dafbe76482132e69716cf1caef2a9837159b462934dd29c29e5c169782c6a1e97319a WHIRLPOOL 9a85ab66a99824f3f7c03f71ad70bb2deff922f50abf3d4a83d135cd18e556db25f06ade0792e1512ee666632f85bf0c2fd90369d51083c71ab2bc0f1536b330 +MISC ChangeLog-2015 15602 SHA256 45d1f3f87b701e5d375ada783942fc71d9177e4a556529c26023a46ca854f3d4 SHA512 e8015060bac7193532bf3e07838d98343aa4cbc16ac17aaa4ee8ea14ea523e1a13a314de9fbbd8387c6b5efe3e30f61801d88a67fe2c0f32b816bd60bed523d4 WHIRLPOOL be463e538a949e84f839e6914a6a85910cb67238bc05c6f6e591c2bebc1dd967f610c1edec541938a53138d2218588072eae1c4b6829f9e2bae3ccadc38bd88c +MISC metadata.xml 355 SHA256 c08ccdedfceddf97da2e834f710935dd59f46048c9d7fb825dea53fcbe8c7a8d SHA512 f02e5404a714cb20207e494f635fb0e98870576c4b5f6affc4dc27fccfcabdd1af1c7411a83cfd4e01b51ecc24d11944d1e612757ff45ab4405f6099ed9b1278 WHIRLPOOL a641aebe6ebee8f61064622cc7caf8e2d75c2df10426b6c3a49d3a379f7e8ec5fc99a57bd6856ecbb9966e49101b3d55725ae6328871621d6fd4f4dc4ced7135 diff --git a/www-apps/moodle/files/config-r1.php b/www-apps/moodle/files/config-r1.php new file mode 100644 index 000000000000..7eef454b7dfc --- /dev/null +++ b/www-apps/moodle/files/config-r1.php @@ -0,0 +1,36 @@ +<?php +unset($CFG); // Ignore this line +global $CFG; // This is necessary here for PHPUnit execution +$CFG = new stdClass(); + +$CFG->dbtype = 'mydb'; // 'pgsql', 'mariadb', 'mysqli', 'mssql', 'sqlsrv' or 'oci' +$CFG->dblibrary = 'native'; // 'native' only at the moment +$CFG->dbhost = 'localhost'; // eg 'localhost' or 'db.isp.com' or IP +$CFG->dbname = 'moodle'; // database name, eg moodle +$CFG->dbuser = 'username'; // your database username +$CFG->dbpass = 'password'; // your database password +$CFG->prefix = 'mdl_'; // prefix to use for all table names +$CFG->dboptions = array( + 'dbpersist' => false, // should persistent database connections be + // used? set to 'false' for the most stable + // setting, 'true' can improve performance + // sometimes + 'dbsocket' => false, // should connection via UNIX socket be used? + // if you set it to 'true' or custom path + // here set dbhost to 'localhost', + // (please note mysql is always using socket + // if dbhost is 'localhost' - if you need + // local port connection use '127.0.0.1') + 'dbport' => '', // the TCP port number to use when connecting + // to the server. keep empty string for the + // default port +); + +$CFG->wwwroot = 'http://example.com/moodle'; +$CFG->dataroot = '/home/example/moodledata'; +$CFG->directorypermissions = 02777; + +$CFG->admin = 'admin'; + +require_once(dirname(__FILE__) . '/lib/setup.php'); // Do not edit +?> diff --git a/www-apps/moodle/files/config.php b/www-apps/moodle/files/config.php new file mode 100644 index 000000000000..c959b4aa457e --- /dev/null +++ b/www-apps/moodle/files/config.php @@ -0,0 +1,29 @@ +<?PHP +unset($CFG); +$CFG = new stdClass(); + +$CFG->dbtype = 'mydb'; +$CFG->dbhost = 'localhost'; +$CFG->dbname = 'moodle_db'; +$CFG->dbuser = 'moodle_user'; +$CFG->dbpass = 'moodle_pass'; +$CFG->prefix = 'mdl_'; + +$CFG->dbpersist = false; + +$CFG->wwwroot = 'http://localhost/moodle'; +$CFG->dirroot = '/var/www/localhost/htdocs/moodle'; +$CFG->dataroot = '/var/www/localhost/moodle' ; + +$CFG->directorypermissions = 02777; + +$CFG->admin = 'admin'; + +if (file_exists("$CFG->dirroot/lib/setup.php")) { + include_once("$CFG->dirroot/lib/setup.php"); +} else { + echo "<p>Could not find this file: $CFG->dirroot/lib/setup.php</p>"; + echo "<p>Please supply this file or reinstall moodle</p>"; + die; +} +?> diff --git a/www-apps/moodle/files/postinstall-en.txt b/www-apps/moodle/files/postinstall-en.txt new file mode 100644 index 000000000000..6a5b44bac93d --- /dev/null +++ b/www-apps/moodle/files/postinstall-en.txt @@ -0,0 +1,220 @@ +NEW INSTALLS + +0 Check to see if webapp-config automatically installed + moodle for you in /var/www/localhost/htdocs. You should + see a directory in there called moodle. If it didn't + install it manually: + + webapp-config -d moodle -I moodle X.Y.Z + + Replace X.Y.Z with whatever version you just emerged. + +1 Edit the config.php file found at + + /var/www/localhost/htdocs/moodle/config.php + + You should probably change the database password, + $CFG->dbpass = 'moodle_pass' to something more + obscure. Also, if your system has a FQDN, change + the $CFG->wwwroot = 'http://localhost/moodle' + to match the URL of your moodle installation. + + + IF YOU ARE USING MYSQL, do step 2a + IF YOU ARE USING POSTGRESQL, do step 2b + + +2a Create a new mysql database and account with the + appropriate privileges. Make sure the username, + password and database match their values in + config.php from step 1. + + Connect to your mysql server using + + mysql -p -u root + + and at the mysql> prompt issue the following commands + + CREATE DATABASE moodle_db; + GRANT ALL ON moodle_db.* + TO moodle_user@localhost + IDENTIFIED BY 'moodle_pass'; + flush privileges; + +2b Issue the following commands at a shell, making sure + the username, password and database match their values + in config.php from step 1. + + su - postgres + psql -c "create user moodle_user createdb;" template1 + psql -c "alter user moodle_user with encrypted password 'moodle_pass';" template1 + psql -c "create database moodle_db with encoding 'unicode';" -U moodle_user template1 + psql -c "alter user moodle_user nocreatedb;" template1 + su - root + /etc/init.d/postgresql-X.Y reload + + Replace X.Y with your version postgresql. + + NOTE: Moodle docs say that moodle only works with + postgresql-7, but I've used it with 8 no problems. + +3 Direct your browser to the URL in step 1. You should see + the license agreement. Click "Yes" to continue. + +4 You are now about to install. Click the checkbox for + "Unattended operation" and "Continue" to start. Follow + the wizard as you "Setup administrator account" and configure + the "Front Page settings". + +5 You now have a working installation. Before putting it + into production, you'll probably want to check that + everything is sane. In the "Site Administration" block, + click on + + Server -> Environment + + Make sure that you've got the green okay on all the + Server Checks. If you don't, click on the ? icons for + popup help. + +6 Add a cron-job to root's crontab. + + su - root + crontab -e # fcrontab -e if you use fcron + + then add the line + + */30 * * * * root php -q /var/www/localhost/htdocs/moodle/admin/cron.php > /dev/null + +7 For more information on installing moodle, see + + http://docs.moodle.org/en/Installing_Moodle + + For information on working with moodle, see + + http://moodle.org/support/ + +================================================================= + +UPGRADES + +0 Before any upgade you should backup your database in case you have + to roll back. The moodle dirroot directory ($CFG->dirroot in the + config.php file) isn't as critical since you can always reinstall + that with web-apps. The moodle data root ($CFG->dataroot in config.php), + where files are uploaded, will not be touched. But the upgrade will + probably change your db schema, and the new format may not be backward + compatible. For mysql use + + mysqldump -u moodle_user -p -C -Q -e --create-options moodle_db > moodle-backup.sql + + or for postgresql use + + su - postgres + pg_dump moodle_db > moodle-backup.sql + + If you have to fall back, you can do so using + + mysql -p -u moodle_user moodle_db < moodle-backup.sql + + or + + su - postgres + psql moodle_db < moodle-backup.sql + + TEST THIS! PRACTICE THIS! Make sure it will work for you if you + have to fall back. + +1 Emerge the new moodle ebuild. Be prepared to add USE flags for + php and re-emerge it since upgrades may require new functionality + from php. Remember to restart apache after re-emerging php! + +2 If the ebuild didn't do it for you, update using + + webapp-config -d moodle -U moodle X.Y.Z + +3 Aim your browser to the URL in the config.php file defined + by $CFG->wwwroot. You will get a message that you are about + to automatically upgrade your server and cannot go back. + This is why you backed up your db in step 1. You can go back + if you use webapp-config to install the older version AND + drop the new db and restart the old one. You did practice + restoring, right? + +4 Click "Continue" and follow through with the upgrade. + + +================================================================= + +UNINSTALL + +1 Make sure you really want to do this. I mean REALLY! + After step 3 you will be past the point of no return. + +2 If you just want to uninstall the webapp, do the following + and no more! + + emerge --unmerge moodle + + Your data is still in the db and in the moodledata dir. + + + !!!!!!!!! POINT OF NO RETURN !!!!!!!!! + +3 Uninstall the uploaded files + + rm -rf /var/lib/moodledata + + + IF YOU ARE USING MYSQL, do step 4a + IF YOU ARE USING POSTGRESQL, do step 4b + + +4a Connect to your mysql server using 'mysql -p -u root' and + at the mysql> prompt issue the following commands: + + DROP DATABASE moodle_db; + DROP USER moodle_user@localhost ; + +4b Issue the following commands + + su - postgres + psql -c "drop database moodle_db;" template1 + psql -c "drop user moodle_user;" template1 + +5 Remove the root cron-job + + su - root + crontab -e # fcrontab -e if you use fcron + + and delete the line added above. + +================================================================= + +ADDITIONAL PHP REQUIREMENTS + + Moodle allows for many method of authentication. To see + what these are, in the "Site Administration" block, click + on + + Users -> Authentication -> Manage Authentication + + Moodle will try to authenticate by each method in order + until it either succeeds or exhausts the list and fails. + + In order to use some of these methods, you need to make + sure PHP was compiled with the correct support. You will + know that you do not have the correct support compiled in + if authentication by all previous methods fails, and you + encounter a method for which PHP does not have support. + An error will be thrown and reported in the web page. + + Currently, the ebuild has support for the following + + Auth Method USE flag + + IMAP(S) or POP3(S) imap + LDAP or CAS ldap + External database odbc + RADIUS radius + diff --git a/www-apps/moodle/files/postinstall-nodb-en.txt b/www-apps/moodle/files/postinstall-nodb-en.txt new file mode 100644 index 000000000000..91269941d185 --- /dev/null +++ b/www-apps/moodle/files/postinstall-nodb-en.txt @@ -0,0 +1,6 @@ +You have not specified which database you are going to use. +You are on your own! Go to + + http://docs.moodle.org/en/Installing_Moodle + +and follow the instructions there. diff --git a/www-apps/moodle/metadata.xml b/www-apps/moodle/metadata.xml new file mode 100644 index 000000000000..b42479a73f31 --- /dev/null +++ b/www-apps/moodle/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>blueness@gentoo.org</email> + <name>Anthony G. Basile</name> +</maintainer> +<maintainer type="project"> + <email>web-apps@gentoo.org</email> + <name>Gentoo Webapps</name> +</maintainer> +</pkgmetadata> diff --git a/www-apps/moodle/moodle-3.1.8.ebuild b/www-apps/moodle/moodle-3.1.8.ebuild new file mode 100644 index 000000000000..c64ab1ffbc71 --- /dev/null +++ b/www-apps/moodle/moodle-3.1.8.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit versionator webapp + +AVC=( $(get_version_components) ) +MY_BRANCH="stable${AVC[0]}${AVC[1]}" + +DESCRIPTION="The Moodle Course Management System" +HOMEPAGE="http://moodle.org" +SRC_URI="http://download.moodle.org/${MY_BRANCH}/${P}.tgz" +S="${WORKDIR}/${PN}" + +LICENSE="GPL-2" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~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,xml,zip" +PHP_OPTIONAL_FLAGS="gd,intl,soap,ssl,tokenizer,xmlrpc" +PHP_FLAGS="${PHP_REQUIRED_FLAGS},${PHP_OPTIONAL_FLAGS}" + +IUSE="${DB_TYPES} ${AUTHENTICATION_MODES} vhosts" +REQUIRED_USE="|| ( ${DB_TYPES} )" + +# 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-5.4.4[${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 + + # REQUIRED_USE above guarantees that ${DB_COUNT} cannot be zero + #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 +} + +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 +} diff --git a/www-apps/moodle/moodle-3.2.5.ebuild b/www-apps/moodle/moodle-3.2.5.ebuild new file mode 100644 index 000000000000..37b176d93c22 --- /dev/null +++ b/www-apps/moodle/moodle-3.2.5.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit versionator webapp + +AVC=( $(get_version_components) ) +MY_BRANCH="stable${AVC[0]}${AVC[1]}" + +DESCRIPTION="The Moodle Course Management System" +HOMEPAGE="http://moodle.org" +SRC_URI="http://download.moodle.org/${MY_BRANCH}/${P}.tgz" +S="${WORKDIR}/${PN}" + +LICENSE="GPL-2" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~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,xml,zip" +PHP_OPTIONAL_FLAGS="gd,intl,soap,ssl,tokenizer,xmlrpc" +PHP_FLAGS="${PHP_REQUIRED_FLAGS},${PHP_OPTIONAL_FLAGS}" + +IUSE="${DB_TYPES} ${AUTHENTICATION_MODES} vhosts" +REQUIRED_USE="|| ( ${DB_TYPES} )" + +# 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-5.6.5[${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 + + # REQUIRED_USE above guarantees that ${DB_COUNT} cannot be zero + #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 +} + +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 +} diff --git a/www-apps/moodle/moodle-3.3.2.ebuild b/www-apps/moodle/moodle-3.3.2.ebuild new file mode 100644 index 000000000000..4c2d978ef8a6 --- /dev/null +++ b/www-apps/moodle/moodle-3.3.2.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit versionator webapp + +AVC=( $(get_version_components) ) +MY_BRANCH="stable${AVC[0]}${AVC[1]}" + +DESCRIPTION="The Moodle Course Management System" +HOMEPAGE="http://moodle.org" +SRC_URI="http://download.moodle.org/${MY_BRANCH}/${P}.tgz" +S="${WORKDIR}/${PN}" + +LICENSE="GPL-2" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~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,xml,zip" +PHP_OPTIONAL_FLAGS="gd,intl,soap,ssl,tokenizer,xmlrpc" +PHP_FLAGS="${PHP_REQUIRED_FLAGS},${PHP_OPTIONAL_FLAGS}" + +IUSE="${DB_TYPES} ${AUTHENTICATION_MODES} vhosts" +REQUIRED_USE="|| ( ${DB_TYPES} )" + +# 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-5.6.5[${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 + + # REQUIRED_USE above guarantees that ${DB_COUNT} cannot be zero + #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 +} |