# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="Jailkit is a tool for automatic chrooting of daemons and creation of restricted and chrooted user shells" HOMEPAGE="http://olivier.sessink.nl/jailkit/" SRC_URI="http://olivier.sessink.nl/jailkit/${P}.tar.bz2" # License of the package. This must match the name of file(s) in # /usr/portage/licenses/. For complex license combination see the developer # docs on gentoo.org for details. LICENSE="jailkit" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="" RDEPEND="sys-libs/glibc >=dev-lang/python-2.0" src_compile() { # sed -e 's/^PYLIBDIR.\{1,\}/PYLIBDIR=\/usr\/share\/\${PACKAGE}/g' py/Makefile.in > py/Makefile.temp # mv py/Makefile.temp py/Makefile.in patch -i ${FILESDIR}/jailkit-1.1-makefile.diff Makefile.in econf --prefix=${D}/usr || die "econf failed" emake || die "emake failed" } src_install() { make install DESTDIR=${D} iniprefix=${D}/etc/jailkit/ || die # update /etc/shells to include jk_chrootsh cp /etc/shells ${D}/etc/shells if ! grep /usr/sbin/jk_chrootsh ${D}/etc/shells ; then echo /usr/sbin/jk_chrootsh >> ${D}/etc/shells fi # insert run-level script from jailkit-package exeinto /etc/init.d; doexe ${S}/extra/jailkit } pkg_preinst() { # correct faulty paths from sandboxing cd ${D}/usr/sbin sed -e "s?^LIBDIR='.\{1,\}\/\/\(.\{1,\}\)'?LIBDIR='\/\1'?g" < jk_addjailuser > jk_addjailuser.tmp sed -e "s?^LIBDIR='.\{1,\}\/\/\(.\{1,\}\)'?LIBDIR='\/\1'?g" < jk_check > jk_check.tmp sed -e "s?^LIBDIR='.\{1,\}\/\/\(.\{1,\}\)'?LIBDIR='\/\1'?p" < jk_cp > jk_cp.tmp sed -e "s?^LIBDIR='.\{1,\}\/\/\(.\{1,\}\)'?LIBDIR='\/\1'?g" < jk_init > jk_init.tmp mv jk_addjailuser.tmp jk_addjailuser mv jk_check.tmp jk_check mv jk_cp.tmp jk_cp mv jk_init.tmp jk_init chmod 0755 jk_addjailuser jk_check jk_cp jk_init }