www-apps/ampache: amd64 stable wrt bug #603766
[gentoo.git] / www-apps / baikal / baikal-0.2.7.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit webapp
7
8 DESCRIPTION="Lightweight CalDAV+CardDAV server"
9 HOMEPAGE="http://baikal-server.com/"
10 SRC_URI="http://baikal-server.com/get/${PN}-regular-${PV}.tgz"
11
12 LICENSE="GPL-3"
13 KEYWORDS="~amd64"
14 IUSE="+mysql sqlite"
15 REQUIRED_USE="|| ( mysql sqlite )"
16
17 RDEPEND=">=dev-lang/php-5.3[ctype,filter,pdo,session,xml,mysql?,sqlite?]
18         mysql? ( virtual/mysql )
19         sqlite? ( dev-db/sqlite )
20         virtual/httpd-php"
21
22 S=${WORKDIR}/${PN}-regular
23
24 src_install() {
25         webapp_src_preinst
26
27         dodoc *.md  || die "dodoc failed"
28
29         einfo "Installing web files"
30         insinto "${MY_HTDOCSDIR}"
31         doins -r html/* html/.htaccess Core vendor || die "doins failed"
32
33         einfo "Setting up container for configuration"
34         insinto /etc/${PN}
35         doins Specific/.htaccess || die "doins failed"
36
37         einfo "Fixing symlinks"
38         local link target
39         find "${D}${MY_HTDOCSDIR}" -type l | while read link ; do
40                 target=$(readlink "${link}")
41                 target=${target/..\/Core/Core}
42                 rm "${link}" && ln -s "${target}" "${link}"
43         done
44         dosym /etc/${PN} "${MY_HTDOCSDIR}"/Specific
45         dosym . "${MY_HTDOCSDIR}"/html
46
47         webapp_postinst_txt en "${FILESDIR}/postinstall-en.txt"
48         webapp_src_install
49
50         if has_version www-servers/apache ; then
51                 fowners -R apache:apache /etc/${PN}
52         else
53                 einfo "/etc/${PN} must be owned by the webserver user for baikal"
54         fi
55 }