www-apps/tt-rss/tt-rss-1.5.1.ebuild
changeset 75 70eb8924b719
parent 61 47675f6649b5
child 77 f278e8e12211
equal deleted inserted replaced
61:47675f6649b5 75:70eb8924b719
     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 }
       
    40 
       
    41 src_install() {
       
    42 	webapp_src_preinst
       
    43 
       
    44 	insinto "/${MY_HTDOCSDIR}"
       
    45 	doins -r * || die "Could not copy the files to ${MY_HTDOCSDIR}."
       
    46 	keepdir "/${MY_HTDOCSDIR}"/icons
       
    47 
       
    48 	webapp_serverowned "${MY_HTDOCSDIR}"/icons
       
    49 	webapp_configfile "${MY_HTDOCSDIR}"/config.php
       
    50 
       
    51 	webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
       
    52 	webapp_src_install
       
    53 }