From owner-svn-ports-head@FreeBSD.ORG Thu Mar 6 17:56:20 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4D62DFF; Thu, 6 Mar 2014 17:56:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A65D137E; Thu, 6 Mar 2014 17:56:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26HuKVk021736; Thu, 6 Mar 2014 17:56:20 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26HuK2d021734; Thu, 6 Mar 2014 17:56:20 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201403061756.s26HuK2d021734@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 6 Mar 2014 17:56:20 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r347288 - head/shells/scponly X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 17:56:20 -0000 Author: bapt Date: Thu Mar 6 17:56:19 2014 New Revision: 347288 URL: http://svnweb.freebsd.org/changeset/ports/347288 QAT: https://qat.redports.org/buildarchive/r347288/ Log: Support stage Use options helpers Modified: head/shells/scponly/Makefile head/shells/scponly/pkg-plist Modified: head/shells/scponly/Makefile ============================================================================== --- head/shells/scponly/Makefile Thu Mar 6 17:53:27 2014 (r347287) +++ head/shells/scponly/Makefile Thu Mar 6 17:56:19 2014 (r347288) @@ -11,9 +11,7 @@ DISTNAME= ${PORTNAME}-20110526 EXTRACT_SUFX= .tgz MAINTAINER= gjb@FreeBSD.org -COMMENT= A tiny shell that only permits scp and sftp - -MAN8= scponly.8 +COMMENT= Tiny shell that only permits scp and sftp PORTDOCS= BUILDING-JAILS.TXT INSTALL README SECURITY @@ -32,120 +30,40 @@ SVNSERVE_DESC= Suversion support for svn UNISON_DESC= Unisson support WINSCP_DESC= WinSCP support -NO_STAGE= yes -.include +OPTIONS_SUB= yes -.if(!exists(/usr/bin/sftp)) -RUN_DEPENDS+= sftp:${PORTSDIR}/security/openssh-portable -BUILD_DEPENDS+= sftp:${PORTSDIR}/security/openssh-portable -.endif - -.if ${PORT_OPTIONS:MDEFAULT_CHDIR} -CONFIGURE_ARGS+=--with-default-chdir=${SCPONLY_DEFAULT_CHDIR} -.endif - -.if ${PORT_OPTIONS:MWILDCARDS} -CONFIGURE_ARGS+=--enable-wildcards -.else -CONFIGURE_ARGS+=--disable-wildcards -.endif - -.if ${PORT_OPTIONS:MGFTP} -CONFIGURE_ARGS+=--enable-gftp-compat -.else -CONFIGURE_ARGS+=--disable-gftp-compat -.endif - -.if ${PORT_OPTIONS:MCHROOT} -PLIST_SUB+= SCPONLY_CHROOT="" -CONFIGURE_ARGS+=--enable-chrooted-binary -USE_RC_SUBR+= scponlyc -.else -PLIST_SUB+= SCPONLY_CHROOT="@comment " -.endif - -.if ${PORT_OPTIONS:MRSYNC} -BUILD_DEPENDS+= rsync:${PORTSDIR}/net/rsync -CONFIGURE_ARGS+=--enable-rsync-compat -.else -CONFIGURE_ARGS+=--disable-rsync-compat -.endif - -.if ${PORT_OPTIONS:MSCP} -CONFIGURE_ARGS+=--enable-scp-compat -.else -CONFIGURE_ARGS+=--disable-scp-compat -.endif - -.if ${PORT_OPTIONS:MSVN} -CONFIGURE_ARGS+=--enable-svn-compat -.else -CONFIGURE_ARGS+=--disable-svn-compat -.endif - -.if ${PORT_OPTIONS:MSVNSERVE} -CONFIGURE_ARGS+=--enable-svnserv-compat -.else -CONFIGURE_ARGS+=--disable-svnserv-compat -.endif - -.if ${PORT_OPTIONS:MUNISON} -BUILD_DEPENDS+= unison:${PORTSDIR}/net/unison -CONFIGURE_ARGS+=--enable-unison-compat -.else -CONFIGURE_ARGS+=--disable-unison-compat -.endif - -.if ${PORT_OPTIONS:MWINSCP} -CONFIGURE_ARGS+=--enable-winscp-compat -.else -CONFIGURE_ARGS+=--disable-winscp-compat -.endif - -# svn, svnlook ... are per default in subversion -# only check for one of them! -.if ${PORT_OPTIONS:MSVN} || ${PORT_OPTIONS:MSVNSERVE} -BUILD_DEPENDS+= svn:${PORTSDIR}/devel/subversion -.endif +BUILD_DEPENDS= sftp:${PORTSDIR}/security/openssh-portable +DEFAULT_CHDIR_CONFIGURE_ON= --with-default-chdir=${SCPONLY_DEFAULT_CHDIR} +WILDCARDS_CONFIGURE_ENABLE= --enable-wildcards +GFTP_CONFIGURE_ENABLE= --enable-gftp-compat +CHROOT_CONFIGURE_ENABLE= --enable-chrooted-binary +CHROOT_USE= RC_SUBR=scponlyc +RSYNC_BUILD_DEPENDS= rsync:${PORTSDIR}/net/rsync +RSYNC_CONFIGURE_ENABLE= --enable-rsync-compat +SCP_CONFIGURE_ENABLE= --enable-scp-compat +SVN_CONFIGURE_ENABLE= --enable-svn-compat +SVN_BUILD_DEPENDS= svn:${PORTSDIR}/devel/subversion +SVNSERVE_BUILD_DEPENDS= svn:${PORTSDIR}/devel/subversion +SVNSERVE_CONFIGURE_ENABLE= --enable-svnserv-compat +UNISON_BUILD_DEPENDS= unison:${PORTSDIR}/net/unison +UNISON_CONFIGURE_ENABLE= --enable-unison-compat +WINSCP_CONFIGURE_ENABLE= --enable-winscp-compat -RUN_DEPENDS:= ${BUILD_DEPENDS} +RUN_DEPENDS= ${BUILD_DEPENDS} post-patch: @${ECHO_MSG} "In addition to knobs available from the OPTIONS dialog," @${ECHO_MSG} "you may set SCPONLY_DEFAULT_CHDIR to make users 'cd' to" @${ECHO_MSG} "this directory after authentication." + @${REINPLACE_CMD} -e "s/-o 0 -g 0//g" ${WRKSRC}/Makefile.in post-install: - @${ECHO_MSG} "Updating /etc/shells" - @${CP} /etc/shells /etc/shells.bak - @(${GREP} -v ${PREFIX}/bin/scponly /etc/shells.bak; \ - ${ECHO_CMD} ${PREFIX}/bin/scponly) > /etc/shells - @${RM} /etc/shells.bak -.if ${PORT_OPTIONS:MCHROOT} - @${CP} /etc/shells /etc/shells.bak - @(${GREP} -v ${PREFIX}/sbin/scponlyc /etc/shells.bak; \ - ${ECHO_CMD} ${PREFIX}/sbin/scponlyc) > /etc/shells - @${RM} /etc/shells.bak - @${MKDIR} ${EXAMPLESDIR} - @${INSTALL_SCRIPT} ${WRKSRC}/setup_chroot.sh ${EXAMPLESDIR} - @${INSTALL_DATA} ${WRKSRC}/config.h ${EXAMPLESDIR} - @${ECHO_MSG} "" - @${ECHO_MSG} "To setup chroot cage, run the following commands:" - @${ECHO_MSG} " 1) cd ${EXAMPLESDIR}/ && ${SH} setup_chroot.sh" - @${ECHO_MSG} " 2) Set scponlyc_enable=\"YES\" in /etc/rc.conf" - @${ECHO_MSG} " 3) Run ${PREFIX}/etc/rc.d/scponly start" - @${ECHO_MSG} "" -.endif -.if ${PORT_OPTIONS:MDOCS} - @${MKDIR} ${DOCSDIR} + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_SCRIPT} ${WRKSRC}/setup_chroot.sh ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/config.h ${STAGEDIR}${EXAMPLESDIR} + @${MKDIR} ${STAGEDIR}${DOCSDIR} .for i in ${PORTDOCS} - @${INSTALL_DATA} ${WRKSRC}/$i ${DOCSDIR} + @${INSTALL_DATA} ${WRKSRC}/$i ${STAGEDIR}${DOCSDIR} .endfor - @${ECHO_MSG} "" - @${ECHO_MSG} "For information on several potential security concerns," - @${ECHO_MSG} "please read:" - @${ECHO_MSG} "${DOCSDIR}/SECURITY" - @${ECHO_MSG} "" -.endif .include Modified: head/shells/scponly/pkg-plist ============================================================================== --- head/shells/scponly/pkg-plist Thu Mar 6 17:53:27 2014 (r347287) +++ head/shells/scponly/pkg-plist Thu Mar 6 17:56:19 2014 (r347288) @@ -1,20 +1,21 @@ bin/scponly @exec echo "Updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak @unexec echo "Updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak -%%SCPONLY_CHROOT%%@exec echo "" -%%SCPONLY_CHROOT%%@exec echo "To setup chroot cage, run the following commands:" -%%SCPONLY_CHROOT%%@exec echo " 1) cd %%PREFIX%%/%%EXAMPLESDIR%%/ && /bin/sh setup_chroot.sh" -%%SCPONLY_CHROOT%%@exec echo " 2) Set scponlyc_enable=\"YES\" in /etc/rc.conf" -%%SCPONLY_CHROOT%%@exec echo " 3) Run %%PREFIX%%/etc/rc.d/scponly start" +%%CHROOT%%@exec echo "" +%%CHROOT%%@exec echo "To setup chroot cage, run the following commands:" +%%CHROOT%%@exec echo " 1) cd %%PREFIX%%/%%EXAMPLESDIR%%/ && /bin/sh setup_chroot.sh" +%%CHROOT%%@exec echo " 2) Set scponlyc_enable=\"YES\" in /etc/rc.conf" +%%CHROOT%%@exec echo " 3) Run %%PREFIX%%/etc/rc.d/scponly start" %%PORTDOCS%%@exec echo "" %%PORTDOCS%%@exec echo "For information on several potential security concerns," %%PORTDOCS%%@exec echo "please read:" %%PORTDOCS%%@exec echo "%%PREFIX%%/%%DOCSDIR%%/SECURITY" -%%SCPONLY_CHROOT%%sbin/scponlyc -%%SCPONLY_CHROOT%%@exec cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak -%%SCPONLY_CHROOT%%@unexec cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak -%%SCPONLY_CHROOT%%%%EXAMPLESDIR%%/setup_chroot.sh -%%SCPONLY_CHROOT%%%%EXAMPLESDIR%%/config.h +%%CHROOT%%sbin/scponlyc +%%CHROOT%%@exec cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak +%%CHROOT%%@unexec cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak +%%CHROOT%%%%EXAMPLESDIR%%/setup_chroot.sh +%%CHROOT%%%%EXAMPLESDIR%%/config.h etc/scponly/debuglevel +man/man8/scponly.8.gz @dirrm etc/scponly -%%SCPONLY_CHROOT%%@dirrm %%EXAMPLESDIR%% +%%CHROOT%%@dirrm %%EXAMPLESDIR%%