Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jun 2004 06:10:33 GMT
From:      bugghy <bugghy@phenix.rootshell.be>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/67900: New port: sysutils/jail  Builds a chrooted environment
Message-ID:  <200406140610.i5E6AXJY091030@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/67900; it has been noted by GNATS.

From: bugghy <bugghy@phenix.rootshell.be>
To: FreeBSD-gnats-submit@freebsd.org
Cc: freebsd-ports-bugs@freebsd.org
Subject: Re: ports/67900: New port: sysutils/jail  Builds a chrooted environment
Date: Mon, 14 Jun 2004 08:05:46 +0200 (CEST)

 >Submitter-Id:	current-users
 >Originator:	bugghy
 >Organization:	
 >Confidential:	no 
 >Synopsis:	New port: sysutils/jail  Builds a chrooted environment
 >Severity:	non-critical
 >Priority:	low
 >Category:	ports
 >Class:		change-request
 >Release:	FreeBSD 5.2.1-RELEASE-p8 i386
 >Environment:
 System: FreeBSD illusion.com 5.2.1-RELEASE-p8 FreeBSD 5.2.1-RELEASE-p8 #39: Tue Jun 1 19:55:48 GMT 2004 root@illusion.com:/usr/obj/usr/src/sys/BUGNERIC i386
 
 
 >Description:
         I've made a port for: http://sourceforge.net/projects/jail/
 
         Jail Chroot Project is an attempt of write a tool that builds a chrooted 
         environment. The main goal of Jail is to be as simple as possible, and 
         highly portable. The most difficult step when building a chrooted environment 
         is to set up the right libraries.
 >How-To-Repeat:
 >Fix:
 # This is a shell archive.  Save it in a file, remove anything before
 # this line, and then unpack it by entering "sh file".  Note, it may
 # create directories; files and directories will be owned by you and
 # have default permissions.
 #
 # This archive contains:
 #
 #       jail
 #       jail/files
 #       jail/files/patch-Makefile
 #       jail/files/patch-functions
 #       jail/files/patch-install.sh
 #       jail/Makefile
 #       jail/pkg-descr
 #       jail/pkg-plist
 #       jail/distinfo
 #       jail/pkg-message
 #
 echo c - jail
 mkdir -p jail > /dev/null 2>&1
 echo c - jail/files
 mkdir -p jail/files > /dev/null 2>&1
 echo x - jail/files/patch-Makefile
 sed 's/^X//' >jail/files/patch-Makefile << 'END-of-jail/files/patch-Makefile'
 X--- Makefile.orig      Mon Oct 29 17:40:48 2001
 X+++ Makefile   Mon Jun 14 00:09:09 2004
 X@@ -19,16 +19,16 @@
 X #
 X ##############################################################################
 X 
 X-ARCH=__LINUX__
 X-#ARCH=__FREEBSD__
 X+#ARCH=__LINUX__
 X+ARCH=__FREEBSD__
 X #ARCH=__IRIX__
 X #ARCH=__SOLARIS__
 X 
 X DEBUG = 0
 X-INSTALL_DIR = /usr/local
 X+INSTALL_DIR = ${LOCALBASE}
 X PERL = /usr/bin/perl
 X ROOTUSER = root
 X-ROOTGROUP = root
 X+ROOTGROUP = wheel
 X 
 X # ----------------------------------------------------------------------
 X #
 X@@ -61,7 +61,7 @@
 X 
 X jail: jail.c $(OBJ)
 X       $(CC) $(CFLAGS) $(INCLUDE) jail.c -o jail $(OBJ) $(LIBS) && \
 X-      cp jail ../bin
 X+      cp jail ../bin/jailuser
 X 
 X clean:
 X       @(rm -f jail $(OBJ))
 END-of-jail/files/patch-Makefile
 echo x - jail/files/patch-functions
 sed 's/^X//' >jail/files/patch-functions << 'END-of-jail/files/patch-functions'
 X//                     A little bug patched in jail 1.9 (it didn't set the shell correctly in /etc/shells)
 X//                                                     v1.0a
 X//                                                   by Bugghy (bugghy@rootshell.be)
 X
 X*** ../lib/arch/generic/functions      Fri Oct 26 12:36:09 2001
 X--- ../lib/arch/generic/functions      Sat Jun 14 13:41:22 2003
 X***************
 X*** 823,829 ****
 X    close(F);
 X  
 X    for $k (@elem) {
 X!     if ($k =~ /^$INSTALL_DIR\/jail/) {
 X        $found = 1;
 X        last;
 X      }
 X--- 823,829 ----
 X    close(F);
 X  
 X    for $k (@elem) {
 X!     if ($k =~ /^$INSTALL_DIR\/bin/jail/) {
 X        $found = 1;
 X        last;
 X      }
 X***************
 X*** 831,837 ****
 X  
 X    if (!$found || !-e $SHELLS_FILE) {
 X      open(F,">>".$SHELLS_FILE);
 X!     print F "$INSTALL_DIR/jail\n";
 X      close(F);
 X    } 
 X  }
 X--- 831,837 ----
 X  
 X    if (!$found || !-e $SHELLS_FILE) {
 X      open(F,">>".$SHELLS_FILE);
 X!     print F "$INSTALL_DIR/bin/jail\n";
 X      close(F);
 X    } 
 X  }
 END-of-jail/files/patch-functions
 echo x - jail/files/patch-install.sh
 sed 's/^X//' >jail/files/patch-install.sh << 'END-of-jail/files/patch-install.sh'
 X--- ../install.sh.orig Fri Oct 26 09:37:07 2001
 X+++ ../install.sh      Sun Jun 13 23:00:48 2004
 X@@ -23,7 +23,7 @@
 X #
 X ##############################################################################
 X 
 X-TMPFILE=/tmp/jail.tmp
 X+TMPFILE=jail.tmp
 X 
 X # ----------------------------------------------------------------------------
 X 
 X@@ -63,16 +63,16 @@
 X 
 X gen_jail_conf() {
 X 
 X-cp etc/jail.conf /tmp/jail.conf.tmp
 X+cp etc/jail.conf jail.conf.tmp
 X 
 X-parse_tag /tmp/jail.conf.tmp __VERSION__    $1
 X-parse_tag /tmp/jail.conf.tmp __ARCH__       $2
 X-parse_tag /tmp/jail.conf.tmp __DEBUG__      $3
 X-parse_tag /tmp/jail.conf.tmp __INSTALLDIR__ $4
 X-
 X-mv /tmp/jail.conf.tmp /tmp/jail.conf
 X-install_file /tmp/jail.conf $4/etc $5 $6 $7
 X-rm /tmp/jail.conf
 X+parse_tag jail.conf.tmp __VERSION__    $1
 X+parse_tag jail.conf.tmp __ARCH__       $2
 X+parse_tag jail.conf.tmp __DEBUG__      $3
 X+parse_tag jail.conf.tmp __INSTALLDIR__ $4
 X+
 X+mv jail.conf.tmp jail.conf.sample
 X+install_file jail.conf.sample $4/etc $5 $6 $7
 X+rm jail.conf.sample
 X 
 X }
 X 
 X@@ -80,13 +80,13 @@
 X 
 X gen_libjail() {
 X 
 X-cp lib/libjail.pm /tmp/libjail.pm.tmp
 X+cp lib/libjail.pm libjail.pm.tmp
 X 
 X-parse_tag /tmp/libjail.pm.tmp __INSTALLDIR__ $1
 X+parse_tag libjail.pm.tmp __INSTALLDIR__ $1
 X 
 X-mv /tmp/libjail.pm.tmp /tmp/libjail.pm
 X-install_file /tmp/libjail.pm $1/lib $2 $3 $4
 X-rm /tmp/libjail.pm
 X+mv libjail.pm.tmp libjail.pm
 X+install_file libjail.pm $1/lib $2 $3 $4
 X+rm libjail.pm
 X 
 X }
 X 
 X@@ -94,14 +94,14 @@
 X 
 X gen_mkenv() {
 X 
 X-cp bin/mkjailenv /tmp/mkjailenv.tmp
 X+cp bin/mkjailenv mkjailenv.tmp
 X 
 X-parse_tag /tmp/mkjailenv.tmp __INSTALLDIR__ $1
 X-parse_tag /tmp/mkjailenv.tmp __PERL__ $2
 X+parse_tag mkjailenv.tmp __INSTALLDIR__ $1
 X+parse_tag mkjailenv.tmp __PERL__ $2
 X 
 X-mv /tmp/mkjailenv.tmp /tmp/mkjailenv
 X-install_file /tmp/mkjailenv $1/bin $3 $4 $5
 X-rm /tmp/mkjailenv
 X+mv mkjailenv.tmp mkjailenv
 X+install_file mkjailenv $1/bin $3 $4 $5
 X+rm mkjailenv
 X 
 X }
 X 
 X@@ -109,14 +109,14 @@
 X 
 X gen_addjailsw() {
 X 
 X-cp bin/addjailsw /tmp/addjailsw.tmp
 X+cp bin/addjailsw addjailsw.tmp
 X 
 X-parse_tag /tmp/addjailsw.tmp __INSTALLDIR__ $1
 X-parse_tag /tmp/addjailsw.tmp __PERL__ $2
 X+parse_tag addjailsw.tmp __INSTALLDIR__ $1
 X+parse_tag addjailsw.tmp __PERL__ $2
 X 
 X-mv /tmp/addjailsw.tmp /tmp/addjailsw
 X-install_file /tmp/addjailsw $1/bin $3 $4 $5
 X-rm /tmp/addjailsw
 X+mv addjailsw.tmp addjailsw
 X+install_file addjailsw $1/bin $3 $4 $5
 X+rm addjailsw
 X 
 X }
 X 
 X@@ -125,14 +125,14 @@
 X 
 X gen_addjailuser() {
 X 
 X-cp bin/addjailuser /tmp/addjailuser.tmp
 X+cp bin/addjailuser addjailuser.tmp
 X 
 X-parse_tag /tmp/addjailuser.tmp __INSTALLDIR__ $1
 X-parse_tag /tmp/addjailuser.tmp __PERL__ $2
 X+parse_tag addjailuser.tmp __INSTALLDIR__ $1
 X+parse_tag addjailuser.tmp __PERL__ $2
 X 
 X-mv /tmp/addjailuser.tmp /tmp/addjailuser
 X-install_file /tmp/addjailuser $1/bin $3 $4 $5
 X-rm /tmp/addjailuser
 X+mv addjailuser.tmp addjailuser
 X+install_file addjailuser $1/bin $3 $4 $5
 X+rm addjailuser
 X 
 X }
 X 
 X@@ -165,7 +165,7 @@
 X ROOTID=$6
 X ROOTGID=$7
 X 
 X-install_file ./bin/jail $INSTALLDIR/bin 4755 $ROOTID $ROOTGID
 X+install_file ./bin/jailuser $INSTALLDIR/bin 4755 $ROOTID $ROOTGID
 X gen_jail_conf $VERSION $ARCH $DEBUG $INSTALLDIR 755 $ROOTID $ROOTGID
 X gen_libjail $INSTALLDIR 755 $ROOTID $ROOTGID  
 X 
 END-of-jail/files/patch-install.sh
 echo x - jail/Makefile
 sed 's/^X//' >jail/Makefile << 'END-of-jail/Makefile'
 X# New ports collection makefile for:                   jailuser
 X# Date created:                                        10 Jun 2004
 X# Whom:                                                bugghy <bugghy@SAFe-mail.net>
 X#
 X# $FreeBSD$
 X#
 X
 XPORTNAME=                                              jailuser
 XPORTVERSION=                                           1.9
 XCATEGORIES=                                            sysutils
 XMASTER_SITES=                                  ${MASTER_SITE_SOURCEFORGE}
 XMASTER_SITE_SUBDIR=                            jail
 XDISTNAME=                                      jail_${PORTVERSION}
 XWRKSRC=                                                ${WRKDIR}/jail_1-9_stable/src
 X
 XMAINTAINER=                                            bugghy@SAFe-mail.net
 XCOMMENT=                                               Builds a chrooted environment
 X
 XUSE_PERL5=                                     yes
 X
 Xpost-patch:
 X       @${SED} -e 's!/usr/bin/perl!${PERL}!g' ${WRKSRC}/Makefile > ${WRKSRC}/Makefile.tmp
 X       @${MV} ${WRKSRC}/Makefile.tmp ${WRKSRC}/Makefile
 X
 Xpost-install:
 X.if !defined(NOPORTDOCS)
 X       ${MKDIR} ${DOCSDIR}
 X       ${INSTALL_DATA} ${WRKSRC}/../doc/CHANGELOG ${DOCSDIR}
 X       ${INSTALL_DATA} ${WRKSRC}/../doc/INSTALL ${DOCSDIR}
 X       ${INSTALL_DATA} ${WRKSRC}/../doc/README ${DOCSDIR}
 X       ${INSTALL_DATA} ${WRKSRC}/../doc/SECURITY ${DOCSDIR}
 X       ${INSTALL_DATA} ${WRKSRC}/../doc/VERSION ${DOCSDIR}
 X       ${INSTALL_DATA} ${WRKSRC}/../doc/download ${DOCSDIR}
 X       ${INSTALL_DATA} ${WRKSRC}/../doc/features ${DOCSDIR}
 X       ${INSTALL_DATA} ${WRKSRC}/../doc/intro ${DOCSDIR}
 X.endif
 X
 X       @${SED} -e 's!PREFIX!${PREFIX}!g' ${.CURDIR}/pkg-message
 X
 X.include <bsd.port.mk>
 END-of-jail/Makefile
 echo x - jail/pkg-descr
 sed 's/^X//' >jail/pkg-descr << 'END-of-jail/pkg-descr'
 XJail Chroot Project is an attempt of write a tool that builds a chrooted 
 Xenvironment. The main goal of Jail is to be as simple as possible, and 
 Xhighly portable. The most difficult step when building a chrooted environment 
 Xis to set up the right libraries.
 X
 X WWW: http://sourceforge.net/projects/jail/
 X
 X- bugghy
 Xbugghy@SAFe-mail.net
 END-of-jail/pkg-descr
 echo x - jail/pkg-plist
 sed 's/^X//' >jail/pkg-plist << 'END-of-jail/pkg-plist'
 Xbin/jailuser
 Xbin/mkjailenv
 Xbin/addjailsw
 Xbin/addjailuser
 Xetc/jail.conf.sample
 Xlib/libjail.pm
 Xlib/arch/generic/definitions
 Xlib/arch/generic/functions
 Xlib/arch/linux/definitions
 Xlib/arch/linux/functions
 Xlib/arch/freebsd/definitions
 Xlib/arch/freebsd/functions
 Xlib/arch/irix/definitions
 Xlib/arch/irix/functions
 Xlib/arch/solaris/definitions
 Xlib/arch/solaris/functions
 X%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
 X%%PORTDOCS%%%%DOCSDIR%%/INSTALL
 X%%PORTDOCS%%%%DOCSDIR%%/README
 X%%PORTDOCS%%%%DOCSDIR%%/SECURITY 
 X%%PORTDOCS%%%%DOCSDIR%%/VERSION
 X%%PORTDOCS%%%%DOCSDIR%%/download
 X%%PORTDOCS%%%%DOCSDIR%%/features
 X%%PORTDOCS%%%%DOCSDIR%%/intro
 X%%PORTDOCS%%@dirrm %%DOCSDIR%%
 END-of-jail/pkg-plist
 echo x - jail/distinfo
 sed 's/^X//' >jail/distinfo << 'END-of-jail/distinfo'
 XMD5 (jail_1.9.tar.gz) = d9c4ae58e658e8b13809399c69726154
 XSIZE (jail_1.9.tar.gz) = 32994
 END-of-jail/distinfo
 echo x - jail/pkg-message
 sed 's/^X//' >jail/pkg-message << 'END-of-jail/pkg-message'
 X
 X#############################################################################
 X  Installed additional documentation in: PREFIX/share/doc/jail
 X  Copy PREFIX/etc/jail.conf.sample to PREFIX/etc/jail.conf
 X#############################################################################
 X
 END-of-jail/pkg-message
 exit
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406140610.i5E6AXJY091030>