/[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.4 - (hide annotations) (download)
Sat Nov 10 13:38:01 2012 UTC (21 months, 3 weeks ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Remove older unsupported versions

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

1 blueness 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 blueness 1.4 # $Header: /var/cvsroot/gentoo-x86/www-apps/moodle/moodle-1.9.19.ebuild,v 1.3 2012/08/24 10:22:46 blueness Exp $
4 blueness 1.1
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 blueness 1.2 KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
19 blueness 1.1 #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 blueness 1.3 REQUIRED_USE="|| ( ${DBTYPES} )"
33 blueness 1.1
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     >=dev-lang/php-4.3.0[${DBFLAGS},${AUTHFLAGS},${PHPFLAGS}]
41     virtual/httpd-php
42     virtual/cron"
43    
44     pkg_setup() {
45     webapp_pkg_setup
46    
47     # How many dbs were selected? If one and only one, which one is it?
48     MYDB=""
49     DB_COUNT=0
50     for db in ${DBTYPES}; do
51     if use ${db}; then
52     MYDB=${db}
53     DB_COUNT=$(($DB_COUNT+1))
54     fi
55     done
56    
57 blueness 1.3 # REQUIRED_USE above guarantees that ${DB_COUNT} cannot be zero
58     #if [[ ${DB_COUNT} -eq 0 ]]; then
59     # eerror
60     # eerror "\033[1;31m**************************************************\033[00m"
61     # eerror "No database selected in your USE flags,"
62     # eerror "You must select at least one."
63     # eerror "\033[1;31m**************************************************\033[00m"
64     # eerror
65     # die
66     #fi
67 blueness 1.1
68     if [[ ${DB_COUNT} -gt 1 ]]; then
69     MYDB=""
70     ewarn
71     ewarn "\033[1;33m**************************************************\033[00m"
72     ewarn "Multiple databases selected in your USE flags,"
73     ewarn "You will have to choose your database manually."
74     ewarn "\033[1;33m**************************************************\033[00m"
75     ewarn
76     fi
77     }
78    
79     src_prepare() {
80     rm COPYING.txt
81     cp "${FILESDIR}"/config.php .
82    
83     #
84     # Moodle expect postgres7, not postgres
85     #
86     MYDB=${MYDB/postgres/postgres7}
87     if [[ ${DB_COUNT} -eq 1 ]] ; then
88     sed -i -e "s|mydb|${MYDB}|" config.php
89     fi
90     }
91    
92     src_install() {
93     webapp_src_preinst
94    
95     local MOODLEDATA="${MY_HOSTROOTDIR}"/moodle
96     dodir ${MOODLEDATA}
97     webapp_serverowned -R "${MOODLEDATA}"
98    
99     local MOODLEROOT="${MY_HTDOCSDIR}"
100     insinto ${MOODLEROOT}
101     doins -r *
102    
103     webapp_configfile "${MOODLEROOT}"/config.php
104    
105     if [[ ${DB_COUNT} -eq 1 ]]; then
106     webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
107     else
108     webapp_postinst_txt en "${FILESDIR}"/postinstall-nodb-en.txt
109     fi
110    
111     webapp_src_install
112     }
113    
114     pkg_postinst() {
115     einfo
116     einfo "\033[1;32m**************************************************\033[00m"
117     einfo
118     einfo "To see the post install instructions, do"
119     einfo
120     einfo " webapp-config --show-postinst ${PN} ${PVR}"
121     einfo
122     einfo "\033[1;32m**************************************************\033[00m"
123     einfo
124     }

  ViewVC Help
Powered by ViewVC 1.1.20