19
|
1 |
# Copyright 1999-2010 Gentoo Foundation |
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
|
3 |
# $Header: $ |
|
4 |
|
|
5 |
EAPI="2" |
|
6 |
|
|
7 |
inherit webapp depend.php depend.apache |
|
8 |
|
|
9 |
DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX" |
|
10 |
HOMEPAGE="http://tt-rss.org/" |
|
11 |
SRC_URI="http://tt-rss.org/download/${P}.tar.gz" |
|
12 |
|
|
13 |
LICENSE="GPL-2" |
|
14 |
KEYWORDS="~amd64" |
|
15 |
IUSE="mysql postgres" |
|
16 |
|
|
17 |
DEPEND="dev-lang/php[mysql?,postgres?,json]" |
|
18 |
RDEPEND="${DEPEND}" |
|
19 |
|
|
20 |
need_httpd_cgi |
|
21 |
need_php_httpd |
|
22 |
|
|
23 |
pkg_setup() { |
|
24 |
webapp_pkg_setup |
|
25 |
require_php_with_use json |
|
26 |
use mysql && require_php_with_use mysql |
|
27 |
use postgres && require_php_with_use postgres |
|
28 |
} |
|
29 |
|
|
30 |
src_prepare() { |
|
31 |
# Customize config.php so that the right 'DB_TYPE' is already set (according to the USE flag) |
|
32 |
einfo "Customizing config.php..." |
|
33 |
mv config.php{-dist,} || die "Could not rename config.php-dist to config.php." |
|
34 |
if use mysql && ! use postgres; then |
|
35 |
sed -e "/define('DB_TYPE',/{s:pgsql:mysql:}" -i config.php || die "sed failed" |
|
36 |
fi |
|
37 |
sed -e "/define('DB_TYPE',/{s:// \(or mysql\):// pgsql \1:}" -i config.php \ |
|
38 |
|| die "sed failed" |
|
39 |
# fix bug on feeds icons |
|
40 |
mv icons icon |
|
41 |
sed -e "/define('ICONS_\(DIR\|URL\)',/{s:icons:icon:}" -i config.php || die "sed failed" |
|
42 |
|
|
43 |
} |
|
44 |
|
|
45 |
src_install() { |
|
46 |
webapp_src_preinst |
|
47 |
|
|
48 |
insinto "/${MY_HTDOCSDIR}" |
|
49 |
doins -r * || die "Could not copy the files to ${MY_HTDOCSDIR}." |
|
50 |
keepdir "/${MY_HTDOCSDIR}"/icon |
|
51 |
|
|
52 |
webapp_serverowned "${MY_HTDOCSDIR}"/icon |
|
53 |
webapp_serverowned "${MY_HTDOCSDIR}"/cache/* |
|
54 |
webapp_configfile "${MY_HTDOCSDIR}"/config.php |
|
55 |
|
|
56 |
webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt |
|
57 |
webapp_src_install |
|
58 |
} |