You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.1 KiB
90 lines
2.1 KiB
9 years ago
|
# Copyright 1999-2015 Gentoo Foundation
|
||
10 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
9 years ago
|
# $Id$
|
||
10 years ago
|
|
||
|
EAPI=5
|
||
|
|
||
9 years ago
|
inherit user eutils webapp vcs-snapshot
|
||
10 years ago
|
|
||
|
DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
|
||
|
HOMEPAGE="http://tt-rss.org/"
|
||
9 years ago
|
SRC_URI="https://dev.gentoo.org/~tomka/files/${P}.tar.bz2"
|
||
10 years ago
|
|
||
|
LICENSE="GPL-3"
|
||
|
KEYWORDS="~amd64 ~mips ~x86"
|
||
|
IUSE="daemon +mysql postgres"
|
||
|
|
||
|
DEPEND="
|
||
9 years ago
|
daemon? ( dev-lang/php:*[mysql?,postgres?,pcntl,curl] )
|
||
|
!daemon? ( dev-lang/php:*[mysql?,postgres?,curl] )
|
||
|
virtual/httpd-php:*
|
||
10 years ago
|
"
|
||
|
RDEPEND="${DEPEND}"
|
||
|
|
||
|
REQUIRED_USE="|| ( mysql postgres )"
|
||
|
|
||
9 years ago
|
need_httpd_cgi # From webapp.eclass
|
||
10 years ago
|
|
||
|
pkg_setup() {
|
||
|
webapp_pkg_setup
|
||
|
|
||
|
if use daemon; then
|
||
|
enewgroup ttrssd
|
||
|
enewuser ttrssd -1 /bin/sh /dev/null ttrssd
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
src_prepare() {
|
||
|
# Customize config.php-dist so that the right 'DB_TYPE' is already set (according to the USE flag)
|
||
|
einfo "Customizing config.php-dist..."
|
||
|
|
||
|
if use mysql && ! use postgres; then
|
||
|
sed -i \
|
||
|
-e "/define('DB_TYPE',/{s:pgsql:mysql:}" \
|
||
|
config.php-dist || die
|
||
|
fi
|
||
|
|
||
|
sed -i \
|
||
|
-e "/define('DB_TYPE',/{s:// \(or mysql\):// pgsql \1:}" \
|
||
|
config.php-dist || die
|
||
|
|
||
|
# per 462578
|
||
|
epatch_user
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
|
webapp_src_preinst
|
||
|
|
||
|
insinto "/${MY_HTDOCSDIR}"
|
||
|
doins -r *
|
||
|
keepdir "/${MY_HTDOCSDIR}"/feed-icons
|
||
|
|
||
|
for DIR in cache lock feed-icons; do
|
||
|
webapp_serverowned -R "${MY_HTDOCSDIR}/${DIR}"
|
||
|
done
|
||
|
|
||
10 years ago
|
# In the old days we put a config.php directly and tried to
|
||
10 years ago
|
# protect it with the following which did not work reliably.
|
||
|
# These days we only install the config.php-dist file.
|
||
|
# webapp_configfile "${MY_HTDOCSDIR}"/config.php
|
||
10 years ago
|
|
||
10 years ago
|
if use daemon; then
|
||
|
webapp_postinst_txt en "${FILESDIR}"/postinstall-en-with-daemon.txt
|
||
|
newinitd "${FILESDIR}"/ttrssd.initd-r2 ttrssd
|
||
|
newconfd "${FILESDIR}"/ttrssd.confd-r1 ttrssd
|
||
|
insinto /etc/logrotate.d/
|
||
|
newins "${FILESDIR}"/ttrssd.logrotated ttrssd
|
||
10 years ago
|
|
||
|
elog "After upgrading, please restart ttrssd"
|
||
10 years ago
|
else
|
||
|
webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
|
||
|
fi
|
||
10 years ago
|
|
||
10 years ago
|
webapp_src_install
|
||
|
}
|
||
9 years ago
|
|
||
|
pkg_postinst() {
|
||
|
elog "You need to merge config.php and config.php-dist manually now."
|
||
9 years ago
|
webapp_pkg_postinst
|
||
9 years ago
|
}
|