75
|
1 |
# Copyright 1999-2013 Gentoo Foundation |
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
|
3 |
# $Header: /var/cvsroot/gentoo-x86/www-apps/tt-rss/tt-rss-1.7.5.ebuild,v 1.2 2013/03/24 10:23:19 scarabeus Exp $ |
|
4 |
|
|
5 |
EAPI=5 |
|
6 |
|
|
7 |
inherit user eutils webapp depend.php depend.apache vcs-snapshot |
|
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="https://github.com/gothfox/Tiny-Tiny-RSS/archive/${PV}.tar.gz -> ${P}.tar.gz" |
|
12 |
|
|
13 |
LICENSE="GPL-2" |
|
14 |
KEYWORDS="~amd64 ~x86" |
|
15 |
IUSE="daemon +mysql postgres" |
|
16 |
|
|
17 |
DEPEND=" |
|
18 |
daemon? ( dev-lang/php[mysql?,postgres?,pcntl,curl] ) |
|
19 |
!daemon? ( dev-lang/php[mysql?,postgres?,curl] ) |
|
20 |
" |
|
21 |
RDEPEND="${DEPEND}" |
|
22 |
|
|
23 |
REQUIRED_USE="|| ( mysql postgres )" |
|
24 |
|
|
25 |
need_httpd_cgi |
|
26 |
need_php_httpd |
|
27 |
|
|
28 |
pkg_setup() { |
|
29 |
webapp_pkg_setup |
|
30 |
|
|
31 |
if use daemon; then |
|
32 |
enewgroup ttrssd |
|
33 |
enewuser ttrssd -1 /bin/sh /dev/null ttrssd |
|
34 |
fi |
|
35 |
} |
|
36 |
|
|
37 |
src_prepare() { |
|
38 |
# Customize config.php so that the right 'DB_TYPE' is already set (according to the USE flag) |
|
39 |
einfo "Customizing config.php..." |
|
40 |
mv config.php{-dist,} || die "Could not rename config.php-dist to config.php." |
|
41 |
|
|
42 |
if use mysql && ! use postgres; then |
|
43 |
sed -i \ |
|
44 |
-e "/define('DB_TYPE',/{s:pgsql:mysql:}" \ |
|
45 |
config.php || die |
|
46 |
fi |
|
47 |
|
|
48 |
sed -i \ |
|
49 |
-e "/define('DB_TYPE',/{s:// \(or mysql\):// pgsql \1:}" \ |
|
50 |
config.php || die |
|
51 |
|
|
52 |
# per 462578 |
|
53 |
epatch_user |
|
54 |
} |
|
55 |
|
|
56 |
src_install() { |
|
57 |
webapp_src_preinst |
|
58 |
|
|
59 |
insinto "/${MY_HTDOCSDIR}" |
|
60 |
doins -r * || die "Could not copy the files to ${MY_HTDOCSDIR}." |
|
61 |
keepdir "/${MY_HTDOCSDIR}"/feed-icons |
|
62 |
|
|
63 |
for DIR in cache cache/simplepie cache/images cache/export lock feed-icons; do |
|
64 |
webapp_serverowned -R "${MY_HTDOCSDIR}/${DIR}" |
|
65 |
done |
|
66 |
|
|
67 |
webapp_configfile "${MY_HTDOCSDIR}"/config.php |
|
68 |
if use daemon; then |
|
69 |
webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon.txt |
|
70 |
newinitd "${FILESDIR}"/ttrssd.initd-r1 ttrssd |
|
71 |
newconfd "${FILESDIR}"/ttrssd.confd-r1 ttrssd |
|
72 |
insinto /etc/logrotate.d/ |
|
73 |
newins "${FILESDIR}"/ttrssd.logrotated ttrssd |
|
74 |
else |
|
75 |
webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt |
|
76 |
fi |
|
77 |
|
|
78 |
webapp_src_install |
|
79 |
} |