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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Mar 10 15:04:58 2011 UTC (3 years, 8 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +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-r1.ebuild,v 1.1 2010/08/13 19:04:30 blueness Exp $
4
5 EAPI="2"
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="~amd64 ~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="ctype,curl,gd,iconv,ssl,tokenizer,xml,xmlrpc,zlib"
30
31 IUSE="${DBTYPES} ${AUTHMODES} vhosts"
32
33 # No forced dependency on
34 # mysql? ( virtual/mysql )
35 # postgres? ( dev-db/postgresql-server-7* )
36 # which may live on another server
37 DEPEND=""
38 RDEPEND=">=dev-lang/php-4.3.0[${DBFLAGS},${AUTHFLAGS},${PHPFLAGS}]
39 virtual/httpd-php
40 virtual/cron"
41
42 pkg_setup() {
43 webapp_pkg_setup
44
45 # How many dbs were selected? If one and only one, which one is it?
46 MYDB=""
47 DBCOUNT=0
48 for db in ${DBTYPES}; do
49 if use ${db}; then
50 MYDB=${db}
51 DBCOUNT=$(($DBCOUNT+1))
52 fi
53 done
54
55 if [[ ${DBCOUNT} -eq 0 ]]; then
56 eerror
57 eerror "\033[1;31m**************************************************\033[1;31m"
58 eerror "No database selected in your USE flags,"
59 eerror "You must select at least one."
60 eerror "\033[1;31m**************************************************\033[1;31m"
61 eerror
62 die
63 fi
64
65 if [[ ${DBCOUNT} -gt 1 ]]; then
66 MYDB=""
67 ewarn
68 ewarn "\033[1;33m**************************************************\033[1;33m"
69 ewarn "Multiple databases selected in your USE flags,"
70 ewarn "You will have to choose your database manually."
71 ewarn "\033[1;33m**************************************************\033[1;33m"
72 ewarn
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} ${PVR}"
118 einfo
119 einfo "\033[1;32m**************************************************\033[1;32m"
120 einfo
121 }

  ViewVC Help
Powered by ViewVC 1.1.20