# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs KEYWORDS="~x86" DESCRIPTION="ExecWrap is a super-user exec wrapper for the lighttpd web-server" HOMEPAGE="http://cyanite.org/execwrap/" SRC_URI="http://cyanite.org/execwrap/ExecWrap-0.4.tgz" LICENSE="BSD" SLOT="0" IUSE="" DEPEND="" RDEPEND="www-servers/lighttpd" pkg_setup() { einfo "You can manipulate several configure options of this" einfo "ebuild through environment variables:" einfo einfo "PARENT_UID: UID of your lighttpd user (default: 104)" einfo "TARGET_MIN_UID: Minimum UID, which is allowed to run scripts (default: 1000)" einfo "TARGET_MIN_GID: Minimum GID, which is allowed to run scripts (default: 100)" einfo "TARGET_PATH_PREFIX: Your lighttpd site web-roots" : ${PARENT_UID:=101} : ${TARGET_MIN_UID:=1000} : ${TARGET_MIN_GID:=100} : ${TARGET_PATH_PREFIX:="/var/www/"} } src_unpack() { unpack ${A} cd ${WORKDIR} sed -i -e "s:104:${PARENT_UID}:g" execwrap_config.h sed -i -e "s:1000:${TARGET_MIN_UID}:g" execwrap_config.h sed -i -e "s:100:${TARGET_MIN_GID}:g" execwrap_config.h sed -i -e "s:/var/www/light/:${TARGET_PATH_PREFIX}:g" execwrap_config.h CC="$(tc-getCC)" } src_compile() { ${CC} ${CFLAGS} -o ${PN} ${PN}.c || die "gcc compilation failed" } src_install() { dobin ${PN} dodoc README } pkg_postinst() { fperms 0710 "${ROOT}"usr/bin/${PN} fowners root:lighttpd "${ROOT}"usr/bin/${PN} }