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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Nov 15 01:26:11 2012 UTC (21 months, 1 week ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove vulnerable versions, bug #443102

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

1 # Copyright 1999-2012 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.1.8.ebuild,v 1.1 2012/09/12 23:33:50 blueness Exp $
4
5 EAPI="4"
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?,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_53="ctype,curl,iconv,json,session,simplexml,xml,zip"
30 PHP_OPTIONAL_FLAGS_53="gd,intl,soap,ssl,tokenizer,xmlrpc"
31 PHP_FLAGS_53="${PHP_REQUIRED_FLAGS_53},${PHP_OPTIONAL_FLAGS_53}"
32
33 IUSE="${DB_TYPES} ${AUTHENTICATION_MODES} vhosts"
34 REQUIRED_USE="|| ( ${DB_TYPES} )"
35
36 # No forced dependency on
37 # mysql? ( virtual/mysql )
38 # postgres? ( dev-db/postgresql-server-7* )
39 # which may live on another server
40 DEPEND=""
41 RDEPEND="
42 =dev-lang/php-5.3*[${DB_FLAGS},${AUTHENTICATION_FLAGS},${PHP_FLAGS_53}]
43 virtual/httpd-php
44 virtual/cron"
45
46 pkg_setup() {
47 webapp_pkg_setup
48
49 # How many dbs were selected? If one and only one, which one is it?
50 MYDB=""
51 DB_COUNT=0
52 for db in ${DB_TYPES}; do
53 if use ${db}; then
54 MYDB=${db}
55 DB_COUNT=$(($DB_COUNT+1))
56 fi
57 done
58
59 # REQUIRED_USE above guarantees that ${DB_COUNT} cannot be zero
60 #if [[ ${DB_COUNT} -eq 0 ]]; then
61 # eerror
62 # eerror "\033[1;31m**************************************************\033[00m"
63 # eerror "No database selected in your USE flags,"
64 # eerror "You must select at least one."
65 # eerror "\033[1;31m**************************************************\033[00m"
66 # eerror
67 # die
68 #fi
69
70 if [[ ${DB_COUNT} -gt 1 ]]; then
71 MYDB=""
72 ewarn
73 ewarn "\033[1;33m**************************************************\033[00m"
74 ewarn "Multiple databases selected in your USE flags,"
75 ewarn "You will have to choose your database manually."
76 ewarn "\033[1;33m**************************************************\033[00m"
77 ewarn
78 fi
79 }
80
81 src_prepare() {
82 rm COPYING.txt
83 cp "${FILESDIR}"/config.php .
84
85 # Moodle expect postgres7, not postgres
86 MYDB=${MYDB/postgres/postgres7}
87
88 # Moodle expects mysql, not mysqli
89 MYDB=${MYDB/mysqli/mysql}
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