]> Pileus Git - ~andy/sunrise/blob - www-apps/davical/davical-1.0.2.ebuild
bdfcd51a89408f0b3e8c9e59b7731cd2b9324ca6
[~andy/sunrise] / www-apps / davical / davical-1.0.2.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=2
6
7 inherit depend.php webapp
8
9 DESCRIPTION="A CalDAV and CardDAV Server"
10 HOMEPAGE="http://davical.org/"
11 SRC_URI="http://debian.mcmillan.net.nz/packages/${PN}/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="doc"
16
17 DEPEND="doc? ( dev-php/PEAR-PhpDocumentor )"
18 RDEPEND="app-admin/pwgen
19         || ( <dev-lang/php-5.3[pcre,pdo,postgres,xml]
20                 >=dev-lang/php-5.3[pdo,postgres,xml] )
21         dev-perl/DBI
22         dev-perl/DBD-Pg
23         dev-perl/yaml
24         >=dev-php/awl-0.51
25         www-servers/apache"
26
27 need_php5
28 need_httpd
29
30 src_prepare() {
31         epatch "${FILESDIR}/awl_location.patch"
32         epatch "${FILESDIR}/inc_path.patch"
33 }
34
35 src_compile() {
36         if use doc ; then
37                 einfo "Generating documentation"
38                 phpdoc -q -c "docs/api/phpdoc.ini"\
39                         || die "Documentation failed to build"
40         fi
41         emake built-po || die "emake failed"
42 }
43
44 src_install() {
45         webapp_src_preinst
46
47         dodoc-php INSTALL README debian/README.Debian \
48                 testing/README.regression_tests TODO debian/changelog \
49                 || die "dodoc failed"
50
51         einfo "Installing web files"
52         insinto "${MY_HTDOCSDIR}"
53         doins -r htdocs/* htdocs/.htaccess || die "doins failed"
54
55         einfo "Installing main files and i18n"
56         insinto "${MY_HOSTROOTDIR}/${PN}"
57         doins -r inc locale || die "doins failed"
58         rm -f "${D}/${MY_HOSTROOTDIR}/${PN}/inc/always.php.in"
59
60         einfo "Installing sql files"
61         insinto "${MY_SQLSCRIPTSDIR}"
62         doins -r dba/* || die "doins failed"
63
64         if use doc ; then
65                 einfo "Installing documentation"
66                 dohtml -r docs/api/ docs/website/ || die "dohtml failed"
67         fi
68
69         insinto /etc/${PN}
70         doins config/* "${FILESDIR}/vhost-example" \
71                 || die "newins failed"
72
73         webapp_postinst_txt en "${FILESDIR}/postinstall-en.txt"
74         webapp_src_install
75
76         fperms +x "${MY_SQLSCRIPTSDIR}/create-database.sh"
77         fperms +x "${MY_SQLSCRIPTSDIR}/update-davical-database"
78 }