/[gentoo-x86]/www-apps/moodle/moodle-2.8.2.ebuild
Gentoo

Contents of /www-apps/moodle/moodle-2.8.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Feb 1 22:09:43 2015 UTC (3 years, 10 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bumps

(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-apps/moodle/moodle-2.8.2.ebuild,v 1.1 2015/01/11 14:05:43 blueness Exp $
4
5 EAPI="5"
6
7 inherit versionator webapp
8
9 AVC=( $(get_version_components) )
10 MY_BRANCH="stable${AVC[0]}${AVC[1]}"
11
12 DESCRIPTION="The Moodle Course Management System"
13 HOMEPAGE="http://moodle.org"
14 SRC_URI="http://download.moodle.org/${MY_BRANCH}/${P}.tgz"
15 S="${WORKDIR}/${PN}"
16
17 LICENSE="GPL-2"
18 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
19 #SLOT empty due to webapp
20
21 DB_FLAGS="mysqli?,mssql?,postgres?"
22 DB_TYPES=${DB_FLAGS//\?/}
23 DB_TYPES=${DB_TYPES//,/ }
24
25 AUTHENTICATION_FLAGS="imap?,ldap?,odbc?"
26 AUTHENTICATION_MODES=${AUTHENTICATION_FLAGS//\?/}
27 AUTHENTICATION_MODES=${AUTHENTICATION_MODES//,/ }
28
29 PHP_REQUIRED_FLAGS="ctype,curl,iconv,json,session,simplexml,xml,zip"
30 PHP_OPTIONAL_FLAGS="gd,intl,soap,ssl,tokenizer,xmlrpc"
31 PHP_FLAGS="${PHP_REQUIRED_FLAGS},${PHP_OPTIONAL_FLAGS}"
32
33 IUSE="${DB_TYPES} ${AUTHENTICATION_MODES} vhosts"
34 REQUIRED_USE="|| ( ${DB_TYPES} )"
35
36 # No forced dependency on
37 # mssql? - lives on a windows server
38 # mysql? ( virtual/mysql )
39 # postgres? ( dev-db/postgresql-server-9* )
40 # which may live on another server. These USE flags affect the configuration
41 # file and the dependency on php. However other dbs are possible. See config.php
42 # and the moodle documentation for other possibilities.
43 DEPEND=""
44 RDEPEND="
45 >=dev-lang/php-5.4.4[${DB_FLAGS},${AUTHENTICATION_FLAGS},${PHP_FLAGS}]
46 virtual/httpd-php
47 virtual/cron"
48
49 pkg_setup() {
50 webapp_pkg_setup
51
52 # How many dbs were selected? If one and only one, which one is it?
53 MYDB=""
54 DB_COUNT=0
55 for db in ${DB_TYPES}; do
56 if use ${db}; then
57 MYDB=${db}
58 DB_COUNT=$(($DB_COUNT+1))
59 fi
60 done
61
62 # REQUIRED_USE above guarantees that ${DB_COUNT} cannot be zero
63 #if [[ ${DB_COUNT} -eq 0 ]]; then
64 # eerror
65 # eerror "\033[1;31m**************************************************\033[00m"
66 # eerror "No database selected in your USE flags,"
67 # eerror "You must select at least one."
68 # eerror "\033[1;31m**************************************************\033[00m"
69 # eerror
70 # die
71 #fi
72
73 if [[ ${DB_COUNT} -gt 1 ]]; then
74 MYDB=""
75 ewarn
76 ewarn "\033[1;33m**************************************************\033[00m"
77 ewarn "Multiple databases selected in your USE flags,"
78 ewarn "You will have to choose your database manually."
79 ewarn "\033[1;33m**************************************************\033[00m"
80 ewarn
81 fi
82 }
83
84 src_prepare() {
85 rm COPYING.txt
86 cp "${FILESDIR}"/config-r1.php config.php
87
88 # Moodle expect pgsql, not postgres
89 MYDB=${MYDB/postgres/pgsql}
90
91 if [[ ${DB_COUNT} -eq 1 ]] ; then
92 sed -i -e "s|mydb|${MYDB}|" config.php
93 fi
94 }
95
96 src_install() {
97 webapp_src_preinst
98
99 local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle
100 dodir ${MOODLEDATA}
101 webapp_serverowned -R "${MOODLEDATA}"
102
103 local MOODLEROOT="${MY_HTDOCSDIR}"
104 insinto ${MOODLEROOT}
105 doins -r *
106
107 webapp_configfile "${MOODLEROOT}"/config.php
108
109 if [[ ${DB_COUNT} -eq 1 ]]; then
110 webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
111 else
112 webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt
113 fi
114
115 webapp_src_install
116 }
117
118 pkg_postinst() {
119 einfo
120 einfo "\033[1;32m**************************************************\033[00m"
121 einfo
122 einfo "To see the post install instructions, do"
123 einfo
124 einfo " webapp-config --show-postinst ${PN} ${PVR}"
125 einfo
126 einfo "\033[1;32m**************************************************\033[00m"
127 einfo
128 }

  ViewVC Help
Powered by ViewVC 1.1.20