really add tt-rss-1.5.0 ebuild
authorDa Risk <da_risk@elyzion.net>
Tue, 21 Dec 2010 15:50:30 +0100
changeset 13 abe49380f137
parent 12 1af22ef1327a
child 15 650751320a90
really add tt-rss-1.5.0 ebuild
www-apps/tt-rss/tt-rss-1.5.0.ebuild
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www-apps/tt-rss/tt-rss-1.5.0.ebuild	Tue Dec 21 15:50:30 2010 +0100
@@ -0,0 +1,53 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit webapp depend.php depend.apache
+
+DESCRIPTION="Tiny Tiny RSS - A web-based news feed (RSS/Atom) aggregator using AJAX"
+HOMEPAGE="http://tt-rss.org/"
+SRC_URI="http://tt-rss.org/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64"
+IUSE="mysql postgres"
+
+DEPEND="dev-lang/php[mysql?,postgres?,json]"
+RDEPEND="${DEPEND}"
+
+need_httpd_cgi
+need_php_httpd
+
+pkg_setup() {
+	webapp_pkg_setup
+	require_php_with_use json
+	use mysql && require_php_with_use mysql
+	use postgres && require_php_with_use postgres
+}
+
+src_prepare() {
+	# Customize config.php so that the right 'DB_TYPE' is already set (according to the USE flag)
+	einfo "Customizing config.php..."
+	mv config.php{-dist,} || die "Could not rename config.php-dist to config.php."
+	if use mysql && ! use postgres; then
+		sed -e "/define('DB_TYPE',/{s:pgsql:mysql:}" -i config.php || die "sed failed"
+	fi
+	sed -e "/define('DB_TYPE',/{s:// \(or mysql\):// pgsql \1:}" -i config.php \
+		|| die "sed failed"
+}
+
+src_install() {
+	webapp_src_preinst
+
+	insinto "/${MY_HTDOCSDIR}"
+	doins -r * || die "Could not copy the files to ${MY_HTDOCSDIR}."
+	keepdir "/${MY_HTDOCSDIR}"/icons
+
+	webapp_serverowned "${MY_HTDOCSDIR}"/icons
+	webapp_configfile "${MY_HTDOCSDIR}"/config.php
+
+	webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
+	webapp_src_install
+}