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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Jul 6 09:27:48 2012 UTC (2 years, 1 month ago) by blueness
Branch: MAIN
Version bump

(Portage version: 2.1.10.65/cvs/Linux x86_64)

1 blueness 1.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-1.9.18.ebuild,v 1.1 2012/05/16 02:11:08 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="ctype,curl,gd,iconv,session,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="
39     >=dev-lang/php-4.3.0[${DBFLAGS},${AUTHFLAGS},${PHPFLAGS}]
40     virtual/httpd-php
41     virtual/cron"
42    
43     pkg_setup() {
44     webapp_pkg_setup
45    
46     # How many dbs were selected? If one and only one, which one is it?
47     MYDB=""
48     DB_COUNT=0
49     for db in ${DBTYPES}; do
50     if use ${db}; then
51     MYDB=${db}
52     DB_COUNT=$(($DB_COUNT+1))
53     fi
54     done
55    
56     if [[ ${DB_COUNT} -eq 0 ]]; then
57     eerror
58     eerror "\033[1;31m**************************************************\033[00m"
59     eerror "No database selected in your USE flags,"
60     eerror "You must select at least one."
61     eerror "\033[1;31m**************************************************\033[00m"
62     eerror
63     die
64     fi
65    
66     if [[ ${DB_COUNT} -gt 1 ]]; then
67     MYDB=""
68     ewarn
69     ewarn "\033[1;33m**************************************************\033[00m"
70     ewarn "Multiple databases selected in your USE flags,"
71     ewarn "You will have to choose your database manually."
72     ewarn "\033[1;33m**************************************************\033[00m"
73     ewarn
74     fi
75     }
76    
77     src_prepare() {
78     rm COPYING.txt
79     cp "${FILESDIR}"/config.php .
80    
81     #
82     # Moodle expect postgres7, not postgres
83     #
84     MYDB=${MYDB/postgres/postgres7}
85     if [[ ${DB_COUNT} -eq 1 ]] ; then
86     sed -i -e "s|mydb|${MYDB}|" config.php
87     fi
88     }
89    
90     src_install() {
91     webapp_src_preinst
92    
93     local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle
94     dodir ${MOODLEDATA}
95     webapp_serverowned -R "${MOODLEDATA}"
96    
97     local MOODLEROOT="${MY_HTDOCSDIR}"
98     insinto ${MOODLEROOT}
99     doins -r *
100    
101     webapp_configfile "${MOODLEROOT}"/config.php
102    
103     if [[ ${DB_COUNT} -eq 1 ]]; then
104     webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
105     else
106     webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt
107     fi
108    
109     webapp_src_install
110     }
111    
112     pkg_postinst() {
113     einfo
114     einfo "\033[1;32m**************************************************\033[00m"
115     einfo
116     einfo "To see the post install instructions, do"
117     einfo
118     einfo " webapp-config --show-postinst ${PN} ${PVR}"
119     einfo
120     einfo "\033[1;32m**************************************************\033[00m"
121     einfo
122     }

  ViewVC Help
Powered by ViewVC 1.1.20