/[gentoo-alt]/trunk/prefix/eclass/horde.eclass
Gentoo

Contents of /trunk/prefix/eclass/horde.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 982 - (show annotations) (download)
Thu Feb 2 04:20:17 2006 UTC (13 years, 2 months ago) by kito
File size: 4148 byte(s)
Initial eclass import from gentoo-x86
1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/horde.eclass,v 1.27 2006/01/07 23:46:57 ferringb Exp $
4 #
5 # Help manage the horde project http://www.horde.org/
6 #
7 # Author: Mike Frysinger <vapier@gentoo.org>
8 # CVS additions by Chris Aniszczyk <zx@mea-culpa.net>
9 # SNAP additions by Jonathan Polansky <jpolansky@lsit.ucsb.edu>
10 #
11 # This eclass provides generic functions to make the writing of horde
12 # ebuilds fairly trivial since there are many horde applications and
13 # they all share the same basic install process.
14
15 # EHORDE_SNAP
16 # This variable tracks whether the user is using a snapshot version
17 #
18 # EHORDE_SNAP_BRANCH
19 # You set this via the ebuild to whatever branch you wish to grab a
20 # snapshot of. Typically this is 'HEAD' or 'RELENG'.
21 #
22 # EHORDE_CVS
23 # This variable tracks whether the user is using a cvs version
24
25 inherit webapp eutils
26 [[ ${PN} != ${PN/-cvs} ]] && inherit cvs
27
28 IUSE="vhosts"
29
30 EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst
31
32 [[ -z ${HORDE_PN} ]] && HORDE_PN="${PN/horde-}"
33 [[ -z ${HORDE_MAJ} ]] && HORDE_MAJ=""
34
35 EHORDE_CVS="false"
36 EHORDE_SNAP="false"
37 if [[ ${PN} != ${PN/-cvs} ]] ; then
38 EHORDE_CVS="true"
39 HORDE_PN=${HORDE_PN/-cvs}
40
41 ECVS_SERVER="anoncvs.horde.org:/repository"
42 ECVS_MODULE="${HORDE_PN}"
43 ECVS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src/${PN}"
44 ECVS_USER="cvsread"
45 ECVS_PASS="horde"
46
47 SRC_URI=""
48 S=${WORKDIR}/${HORDE_PN}
49
50 elif [[ ${PN} != ${PN/-snap} ]] ; then
51 EHORDE_SNAP="true"
52 EHORDE_SNAP_BRANCH=${EHORDE_SNAP_BRANCH:-HEAD}
53 SNAP_PV=${PV:0:4}-${PV:4:2}-${PV:6:2}
54
55 HORDE_PN=${HORDE_PN/-snap}
56
57 SRC_URI="http://ftp.horde.org/pub/snaps/${SNAP_PV}/${HORDE_PN}-${EHORDE_SNAP_BRANCH}-${SNAP_PV}.tar.gz"
58 S=${WORKDIR}/${HORDE_PN}
59
60 else
61 SRC_URI="http://ftp.horde.org/pub/${HORDE_PN}/${HORDE_PN}${HORDE_MAJ}-${PV/_/-}.tar.gz"
62 S=${WORKDIR}/${HORDE_PN}${HORDE_MAJ}-${PV/_/-}
63 fi
64 HOMEPAGE="http://www.horde.org/${HORDE_PN}"
65
66 LICENSE="LGPL-2"
67
68 # INSTALL_DIR is used by webapp.eclass when USE=-vhosts
69 INSTALL_DIR="/horde"
70 [[ ${HORDE_PN} != "horde" ]] && INSTALL_DIR="${INSTALL_DIR}/${HORDE_PN}"
71
72 horde_pkg_setup() {
73 webapp_pkg_setup
74
75 if [[ ! -z ${HORDE_PHP_FEATURES} ]] ; then
76 local param
77 if [[ ${HORDE_PHP_FEATURES:0:2} = "-o" ]] ; then
78 param="-o"
79 HORDE_PHP_FEATURES=${HORDE_PHP_FEATURES:2}
80 fi
81 if ! built_with_use ${param} mod_php ${HORDE_PHP_FEATURES} && \
82 ! built_with_use ${param} php ${HORDE_PHP_FEATURES} ; then
83 eerror "You MUST re-emerge php with at least one of"
84 eerror "the following options in your USE:"
85 eerror " ${HORDE_PHP_FEATURES}"
86 die "current php install cannot support ${HORDE_PN}"
87 fi
88 fi
89 }
90
91 horde_src_unpack() {
92 if [[ ${EHORDE_CVS} = "true" ]] ; then
93 cvs_src_unpack
94 else
95 unpack ${A}
96 fi
97 cd "${S}"
98 [[ -f test.php ]] && chmod 000 test.php
99 [[ -n ${EHORDE_PATCHES} ]] && epatch ${EHORDE_PATCHES}
100 }
101
102 horde_src_install() {
103 webapp_src_preinst
104
105 local destdir=${MY_HTDOCSDIR}
106
107 # Work-around when dealing with CVS sources
108 [[ ${EHORDE_CVS} = "true" ]] && cd ${HORDE_PN}
109
110 dodoc README docs/*
111 rm -rf COPYING LICENSE README docs
112
113 dodir ${destdir}
114 cp -r . ${D}/${destdir}/ || die "install files"
115 webapp_serverowned ${MY_HTDOCSDIR}
116
117 webapp_src_install
118 }
119
120 horde_pkg_postinst() {
121 if [[ -e ${ROOT}/usr/share/doc/${PF}/INSTALL.gz ]] ; then
122 einfo "Please read /usr/share/doc/${PF}/INSTALL.gz"
123 fi
124 einfo "Before this package will work, you have to setup"
125 einfo "the configuration files. Please review the"
126 einfo "config/ subdirectory of ${HORDE_PN} in the webroot."
127 if [[ ${HORDE_PN} != "horde" ]] ; then
128 ewarn
129 ewarn "Make sure ${HORDE_PN} is accounted for in horde's root"
130 ewarn " config/registry.php"
131 fi
132 if [[ ${EHORDE_CVS} = "true" ]] ; then
133 ewarn
134 ewarn "Use these CVS versions at your own risk."
135 ewarn "They tend to break things when working with"
136 ewarn "the non CVS versions of horde."
137 fi
138 if use vhosts ; then
139 echo
140 ewarn "When installing horde into a vhost dir, you will"
141 ewarn "need to use the -d option so that it is installed"
142 ewarn "into the proper location."
143 fi
144 webapp_pkg_postinst
145 }

  ViewVC Help
Powered by ViewVC 1.1.20