view www-apps/redaxo/redaxo-4.2.1.ebuild @ 183:3cdcf4f4578c

replace the version number using portage functions, fetch the source, unpack and clean up works
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 17 Feb 2010 09:53:35 +0100
parents 75231bb27b1c
children 54b73709801b
line wrap: on
line source


EAPI=2
inherit webapp depend.php versionator

DESCRIPTION="PHP-powered CMS application."
HOMEPAGE="http://www.redaxo.de/"

# translate redaxo-0.0.0 to redaxo0_0_0
MY_PV=$(replace_all_version_separators '_')
MY_P=${PN}${MY_PV}
SRC_URI="http://www.redaxo.de/files/${MY_P}.zip"

LICENSE="GPL"
KEYWORDS="~amd64 ~x86"
DEPEND=""
RDEPEND="virtual/httpd-cgi"

need_php_httpd

S="${WORKDIR}/${MY_P}"

pkg_setup() {
     webapp_pkg_setup

    if  ! PHPCHECKNODIE="yes" require_php_with_any_use mysql ; then
            eerror
            eerror "${PHP_PKG} needs to be reinstalled with the mysql USE flag enabled."
            die "Reinstall ${PHP_PKG} with the above-stated USE flags."
    fi
}

src_unpack() {
    unpack ${A}

    # clean up some cruft that comes as part of the install package
    cd ${S}
    find . -name .DS_Store -exec rm {} \;
}

src_install() {
    webapp_src_preinst

#    rm docs/INSTALL*
#    local docs="docs/*"
#    dodoc ${docs}
#    rm -rf docs/

    einfo "Installing application files."
    cp -r . "${D}"${MY_HTDOCSDIR}
    touch "${D}"${MY_HTDOCSDIR}/.htaccess
#    touch "${D}"${MY_HTDOCSDIR}/serendipity_config_local.inc.php

    # the files directory will be populated by the user
    keepdir ${MY_HTDOCSDIR}/files/
#    webapp_configfile ${MY_HTDOCSDIR}/serendipity_config_local.inc.php

    # .htaccess, index.php and the redaxo dir are part of the distro
    local SERVEROWNED=".htaccess index.php redaxo"
    for SFILES in ${SERVEROWNED}; do
        webapp_serverowned ${MY_HTDOCSDIR}/${SFILES}
    done

    webapp_src_install
}