Files @ 188f6ead5aac
Branch filter:

Location: portage-overlay.git/www-apps/limesurvey/limesurvey-1.91.ebuild

188f6ead5aac 1.7 KiB application/vnd.gentoo.ebuild Show Annotation Show as Raw Download as Raw
chain
added ebuilds from server branch
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: Exp $

inherit webapp depend.php

LS_BUILD="plus-build10089-20110517"
MY_PV=${PV//./}

DESCRIPTION="LimeSurvey is a open source survey tool"
HOMEPAGE="http://www.limesurvey.org/"
SRC_URI="mirror://sourceforge/${PN}/${PN}${MY_PV}${LS_BUILD}.tar.gz"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
IUSE="mysql postgres"

need_httpd_cgi
need_php_httpd

S="${WORKDIR}"

pkg_setup () {
	if ! use mysql && ! use postgres; then
		ewarn
		ewarn "You You need at least to enable one database backend. Please stop"
		ewarn "this build and enable one of the following USE flag:"
		ewarn "  - mysql"
		ewarn "  - postgres"
		ewarn
		ebeep 5
		epause 10
		die "PHP needs MySQL or PostgreSQL support"
	fi

	webapp_pkg_setup
}

src_install () {
	cd "${S}"/${PN}

	webapp_src_preinst

        # copy the app's main files
        #
        einfo "Installing main files"
	insinto "${MY_HTDOCSDIR}"
        doins -r .

	# set read/write access to certain directories
	einfo "Setting read/write permission(s)"
	for foo in tmp templates upload; do
		webapp_serverowned "${MY_HTDOCSDIR}"/${foo}
		cd "${S}"/${PN}/${foo}
		for bar in $(find .) ; do
			webapp_serverowned "${MY_HTDOCSDIR}"/${foo}/${bar}
		done
	done

	# set read only access to admin files
	einfo "Setting read-only permission(s)"
	for foo in admin; do
		cd "${S}"/${PN}/${foo}
		for bar in $(find . -type f) ; do
			fperms u=r,g=r,o=r "${MY_HTDOCSDIR}"/${foo}/${bar}
		done
		cd "${S}"/${PN}
	done

	webapp_configfile "${MY_HTDOCSDIR}"/config.php
	webapp_serverowned "${MY_HTDOCSDIR}"/config.php

	webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
	webapp_src_install
}