view www-apps/redaxo/redaxo-4.2.1.ebuild @ 352:c417ea2d1eab

ebuild fro gopenvpn
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 07 Feb 2014 08:14:57 +0100
parents 0696f0fa8ee4
children
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="app-arch/unzip"
RDEPEND="virtual/httpd-cgi"

need_php_httpd

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 ${WORKDIR}/${MY_P}
    find . -name .DS_Store -exec rm {} \;
    remove_if_exists _lastchanges.txt
}

src_install() {
    webapp_src_preinst

    einfo "Installing application files."
    cd ${MY_P}
    cp -r . "${D}"${MY_HTDOCSDIR}

    # .htaccess, index.php and the redaxo dir are part of the distro
    local SERVEROWNED="index.php files files/_readme.txt files/addons \
        redaxo redaxo/include/clang.inc.php redaxo/include/plugins.inc.php \
        redaxo/include/addons.inc.php redaxo/include/master.inc.php \
        redaxo/include/generated redaxo/include/generated/* \
        redaxo/include/addons/* redaxo/include/addons/import_export/backup \
        redaxo/include/addons/image_resize/config.inc.php"
    for SFILES in ${SERVEROWNED}; do
        webapp_serverowned ${MY_HTDOCSDIR}/${SFILES}
    done

    webapp_src_install
}

webapp_pkg_postinst() {
    einfo "This ebuild does not perform any autoinstall of the package"
    einfo ""
    einfo "This allows you to install redaxo directly into the top of"
    einfo "your document root using:"
    einfo "webapp-config -I -h localhost -u root redaxo ${PV}"
    einfo ""
}

function remove_if_exists() {
    if [ -f $1 ]; then
        rm $1
    fi
}