# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="This ebuild will install jailkit, which will allow to easily put programs and users in a chrooted environment" HOMEPAGE="http://olivier.sessink.nl/jailkit/" SRC_URI="http://olivier.sessink.nl/jailkit/${P}.tar.bz2" LICENSE="BSD" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="sys-apps/grep sys-apps/sed" RDEPEND="sys-libs/glibc >=dev-lang/python-2.0" src_compile() { # fix some paths to fit sandbox conditions. sed 's:${iniprefix}:${iniprefix}/jailkit:' < ${S}/Makefile.in > ${S}/Makefile.in_tmp sed 's:if ! grep ${prefix}/sbin/jk_chrootsh /etc/shells ; then:if ! grep /usr/sbin/jk_chrootsh ${iniprefix}/shells ; then:' < ${S}/Makefile.in_tmp > ${S}/Makefile.in sed 's:echo ${prefix}/sbin/jk_chrootsh >> /etc/shells ;:echo /usr/sbin/jk_chrootsh >> ${iniprefix}/shells ;:' < ${S}/Makefile.in > ${S}/Makefile.in_tmp cp ${S}/Makefile.in_tmp ${S}/Makefile.in && rm ${S}/Makefile.in_tmp # fix issues with wrong python path of the sandbox sed 's;sed -e "s!LIBDIR='\''\[a-z/]\*'\''!LIBDIR='\''\${PYLIBDIR}'\''!" -e "s:#!/usr/bin/python:#!$(PYTHONPATH):" <;cp;' < ${S}/py/Makefile.in > ${S}/py/Makefile.in_tmp sed 's;>;;' < ${S}/py/Makefile.in_tmp > ${S}/py/Makefile.in && rm ${S}/py/Makefile.in_tmp # compile econf --prefix=${D}/usr || die "econf failed" emake || die "make failed" } src_install() { # copy /etc/shells from real filesystem dodir /etc; cp /etc/shells ${D}/etc/shells make install prefix=${D}/usr iniprefix=${D}/etc || die "install failed" # install gentoo-init-script. required since baselayout 1.11.x exeinto /etc/init.d; doexe ${FILESDIR}/jailkit }