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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Mar 10 15:04:58 2011 UTC (3 years, 5 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Removed decprecated versions, bug #353431

(Portage version: 2.1.9.42/cvs/Linux x86_64)

1 # Copyright 1999-2010 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.9.ebuild,v 1.2 2010/07/19 15:42:16 mr_bones_ Exp $
4
5 EAPI="2"
6
7 inherit versionator webapp depend.php
8
9 AVC=( $(get_version_components) )
10 MY_BRANCH="stable${AVC[0]}${AVC[1]}"
11 DBTYPES="mysql postgres"
12 AUTHMODES="imap ldap odbc radius"
13 PHPFLAGS="${DBTYPES} ${AUTHMODES}"
14
15 DESCRIPTION="The Moodle Course Management System"
16 HOMEPAGE="http://moodle.org"
17 SRC_URI="http://download.moodle.org/${MY_BRANCH}/${P}.tgz"
18 S="${WORKDIR}/${PN}"
19
20 LICENSE="GPL-2"
21 KEYWORDS="~amd64 ~x86"
22 #SLOT empty due to webapp
23 IUSE="${PHPFLAGS} vhosts"
24
25 # No forced dependency on
26 # mysql? ( virtual/mysql )
27 # postgres? ( dev-db/postgresql-server-7* )
28 # which may live on another server
29 DEPEND=""
30 RDEPEND="virtual/cron"
31
32 need_php5_httpd
33
34 pkg_setup() {
35 webapp_pkg_setup
36
37 # How many dbs were selected? If one and only one, which one is it?
38 MYDB=""
39 DBCOUNT=0
40 for db in ${DBTYPES}; do
41 if use ${db}; then
42 MYDB=${db}
43 DBCOUNT=$(($DBCOUNT+1))
44 fi
45 done
46
47 if [[ ${DBCOUNT} -ne 1 ]]; then
48 MYDB=""
49 ewarn
50 ewarn "\033[1;33m**************************************************\033[1;33m"
51 ewarn "No db, or multiple dbs, selected in your USE flags,"
52 ewarn "You will have to choose your database manually."
53 ewarn "\033[1;33m**************************************************\033[1;33m"
54 ewarn
55 fi
56
57 local flags="ctype curl gd iconv ssl tokenizer xml xmlrpc zlib"
58
59 for flg in ${PHPFLAGS}; do
60 if use ${flg}; then
61 flags="${flags} ${flg}"
62 fi
63 done
64
65 if ! PHPCHECKNODIE="yes" require_php_with_use ${flags} ; then
66 eerror
67 eerror "\033[1;31m************************************************************\033[1;31m"
68 eerror "Re-install ${PHP_PKG} with the following flags:"
69 eerror " ${flags}"
70 eerror "\033[1;31m************************************************************\033[1;31m"
71 eerror
72 die
73 fi
74 }
75
76 src_prepare() {
77 rm COPYING.txt
78 cp "${FILESDIR}"/config.php .
79
80 #
81 # Moodle expect postgres7, not postgres
82 #
83 MYDB=${MYDB/postgres/postgres7}
84 if [[ ${DBCOUNT} -eq 1 ]] ; then
85 sed -i -e "s|mydb|${MYDB}|" config.php
86 fi
87 }
88
89 src_install() {
90 webapp_src_preinst
91
92 local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle
93 dodir ${MOODLEDATA}
94 webapp_serverowned -R "${MOODLEDATA}"
95
96 local MOODLEROOT="${MY_HTDOCSDIR}"
97 insinto ${MOODLEROOT} || die "Unable to insinto ${MOODLEROOT}"
98 doins -r *
99
100 webapp_configfile "${MOODLEROOT}"/config.php
101
102 if [[ ${DBCOUNT} -eq 1 ]]; then
103 webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
104 else
105 webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt
106 fi
107
108 webapp_src_install
109 }
110
111 pkg_postinst() {
112 einfo
113 einfo "\033[1;32m**************************************************\033[1;32m"
114 einfo
115 einfo "To see the post install instructions, do"
116 einfo
117 einfo " webapp-config --show-postinst ${PN} ${PV}"
118 einfo
119 einfo "\033[1;32m**************************************************\033[1;32m"
120 einfo
121 }

  ViewVC Help
Powered by ViewVC 1.1.20