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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Dec 7 13:50:14 2011 UTC (2 years, 9 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Removed vulnerable versions, bug #393475

(Portage version: 2.1.10.11/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-apps/moodle/moodle-1.9.14.ebuild,v 1.1 2011/10/09 14:57:46 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 ~ppc ~ppc64 ~sparc ~x86"
19 #SLOT empty due to webapp
20
21 DBFLAGS="mysql?,postgres?"
22 DBTYPES=${DBFLAGS//\?/}
23 DBTYPES=${DBTYPES//,/ }
24
25 AUTHFLAGS="imap?,ldap?,odbc?"
26 AUTHMODES=${AUTHFLAGS//\?/}
27 AUTHMODES=${AUTHMODES//,/ }
28
29 PHPFLAGS_A="ctype,curl,gd,iconv,ssl,tokenizer,xml,xmlrpc,zlib"
30 PHPFLAGS_B="ctype,curl,gd-external,iconv,ssl,tokenizer,xml,xmlrpc,zlib"
31
32 IUSE="${DBTYPES} ${AUTHMODES} vhosts"
33
34 # No forced dependency on
35 # mysql? ( virtual/mysql )
36 # postgres? ( dev-db/postgresql-server-7* )
37 # which may live on another server
38 DEPEND=""
39 RDEPEND="
40 || (
41 >=dev-lang/php-4.3.0[${DBFLAGS},${AUTHFLAGS},${PHPFLAGS_A}]
42 >=dev-lang/php-4.3.0[${DBFLAGS},${AUTHFLAGS},${PHPFLAGS_B}]
43 )
44 virtual/httpd-php
45 virtual/cron"
46
47 pkg_setup() {
48 webapp_pkg_setup
49
50 # How many dbs were selected? If one and only one, which one is it?
51 MYDB=""
52 DB_COUNT=0
53 for db in ${DBTYPES}; do
54 if use ${db}; then
55 MYDB=${db}
56 DB_COUNT=$(($DB_COUNT+1))
57 fi
58 done
59
60 if [[ ${DB_COUNT} -eq 0 ]]; then
61 eerror
62 eerror "\033[1;31m**************************************************\033[1;31m"
63 eerror "No database selected in your USE flags,"
64 eerror "You must select at least one."
65 eerror "\033[1;31m**************************************************\033[1;31m"
66 eerror
67 die
68 fi
69
70 if [[ ${DB_COUNT} -gt 1 ]]; then
71 MYDB=""
72 ewarn
73 ewarn "\033[1;33m**************************************************\033[1;33m"
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[1;33m"
77 ewarn
78 fi
79 }
80
81 src_prepare() {
82 rm COPYING.txt
83 cp "${FILESDIR}"/config.php .
84
85 #
86 # Moodle expect postgres7, not postgres
87 #
88 MYDB=${MYDB/postgres/postgres7}
89 if [[ ${DB_COUNT} -eq 1 ]] ; then
90 sed -i -e "s|mydb|${MYDB}|" config.php
91 fi
92 }
93
94 src_install() {
95 webapp_src_preinst
96
97 local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle
98 dodir ${MOODLEDATA}
99 webapp_serverowned -R "${MOODLEDATA}"
100
101 local MOODLEROOT="${MY_HTDOCSDIR}"
102 insinto ${MOODLEROOT}
103 doins -r *
104
105 webapp_configfile "${MOODLEROOT}"/config.php
106
107 if [[ ${DB_COUNT} -eq 1 ]]; then
108 webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
109 else
110 webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt
111 fi
112
113 webapp_src_install
114 }
115
116 pkg_postinst() {
117 einfo
118 einfo "\033[1;32m**************************************************\033[1;32m"
119 einfo
120 einfo "To see the post install instructions, do"
121 einfo
122 einfo " webapp-config --show-postinst ${PN} ${PVR}"
123 einfo
124 einfo "\033[1;32m**************************************************\033[1;32m"
125 einfo
126 }

  ViewVC Help
Powered by ViewVC 1.1.20