mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
Support stage
Use options helpers
This commit is contained in:
parent
baec7d593a
commit
50d7789ce9
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=347288
2 changed files with 37 additions and 118 deletions
|
@ -11,9 +11,7 @@ DISTNAME= ${PORTNAME}-20110526
|
||||||
EXTRACT_SUFX= .tgz
|
EXTRACT_SUFX= .tgz
|
||||||
|
|
||||||
MAINTAINER= gjb@FreeBSD.org
|
MAINTAINER= gjb@FreeBSD.org
|
||||||
COMMENT= A tiny shell that only permits scp and sftp
|
COMMENT= Tiny shell that only permits scp and sftp
|
||||||
|
|
||||||
MAN8= scponly.8
|
|
||||||
|
|
||||||
PORTDOCS= BUILDING-JAILS.TXT INSTALL README SECURITY
|
PORTDOCS= BUILDING-JAILS.TXT INSTALL README SECURITY
|
||||||
|
|
||||||
|
@ -32,120 +30,40 @@ SVNSERVE_DESC= Suversion support for svn+ssh://
|
||||||
UNISON_DESC= Unisson support
|
UNISON_DESC= Unisson support
|
||||||
WINSCP_DESC= WinSCP support
|
WINSCP_DESC= WinSCP support
|
||||||
|
|
||||||
NO_STAGE= yes
|
OPTIONS_SUB= yes
|
||||||
.include <bsd.port.options.mk>
|
|
||||||
|
|
||||||
.if(!exists(/usr/bin/sftp))
|
BUILD_DEPENDS= sftp:${PORTSDIR}/security/openssh-portable
|
||||||
RUN_DEPENDS+= sftp:${PORTSDIR}/security/openssh-portable
|
DEFAULT_CHDIR_CONFIGURE_ON= --with-default-chdir=${SCPONLY_DEFAULT_CHDIR}
|
||||||
BUILD_DEPENDS+= sftp:${PORTSDIR}/security/openssh-portable
|
WILDCARDS_CONFIGURE_ENABLE= --enable-wildcards
|
||||||
.endif
|
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
|
||||||
|
|
||||||
.if ${PORT_OPTIONS:MDEFAULT_CHDIR}
|
RUN_DEPENDS= ${BUILD_DEPENDS}
|
||||||
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
|
|
||||||
|
|
||||||
RUN_DEPENDS:= ${BUILD_DEPENDS}
|
|
||||||
|
|
||||||
post-patch:
|
post-patch:
|
||||||
@${ECHO_MSG} "In addition to knobs available from the OPTIONS dialog,"
|
@${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} "you may set SCPONLY_DEFAULT_CHDIR to make users 'cd' to"
|
||||||
@${ECHO_MSG} "this directory after authentication."
|
@${ECHO_MSG} "this directory after authentication."
|
||||||
|
@${REINPLACE_CMD} -e "s/-o 0 -g 0//g" ${WRKSRC}/Makefile.in
|
||||||
|
|
||||||
post-install:
|
post-install:
|
||||||
@${ECHO_MSG} "Updating /etc/shells"
|
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
|
||||||
@${CP} /etc/shells /etc/shells.bak
|
${INSTALL_SCRIPT} ${WRKSRC}/setup_chroot.sh ${STAGEDIR}${EXAMPLESDIR}
|
||||||
@(${GREP} -v ${PREFIX}/bin/scponly /etc/shells.bak; \
|
${INSTALL_DATA} ${WRKSRC}/config.h ${STAGEDIR}${EXAMPLESDIR}
|
||||||
${ECHO_CMD} ${PREFIX}/bin/scponly) > /etc/shells
|
@${MKDIR} ${STAGEDIR}${DOCSDIR}
|
||||||
@${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}
|
|
||||||
.for i in ${PORTDOCS}
|
.for i in ${PORTDOCS}
|
||||||
@${INSTALL_DATA} ${WRKSRC}/$i ${DOCSDIR}
|
@${INSTALL_DATA} ${WRKSRC}/$i ${STAGEDIR}${DOCSDIR}
|
||||||
.endfor
|
.endfor
|
||||||
@${ECHO_MSG} ""
|
|
||||||
@${ECHO_MSG} "For information on several potential security concerns,"
|
|
||||||
@${ECHO_MSG} "please read:"
|
|
||||||
@${ECHO_MSG} "${DOCSDIR}/SECURITY"
|
|
||||||
@${ECHO_MSG} ""
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
.include <bsd.port.mk>
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
bin/scponly
|
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
|
@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
|
@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 ""
|
%%CHROOT%%@exec echo ""
|
||||||
%%SCPONLY_CHROOT%%@exec echo "To setup chroot cage, run the following commands:"
|
%%CHROOT%%@exec echo "To setup chroot cage, run the following commands:"
|
||||||
%%SCPONLY_CHROOT%%@exec echo " 1) cd %%PREFIX%%/%%EXAMPLESDIR%%/ && /bin/sh setup_chroot.sh"
|
%%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"
|
%%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 " 3) Run %%PREFIX%%/etc/rc.d/scponly start"
|
||||||
%%PORTDOCS%%@exec echo ""
|
%%PORTDOCS%%@exec echo ""
|
||||||
%%PORTDOCS%%@exec echo "For information on several potential security concerns,"
|
%%PORTDOCS%%@exec echo "For information on several potential security concerns,"
|
||||||
%%PORTDOCS%%@exec echo "please read:"
|
%%PORTDOCS%%@exec echo "please read:"
|
||||||
%%PORTDOCS%%@exec echo "%%PREFIX%%/%%DOCSDIR%%/SECURITY"
|
%%PORTDOCS%%@exec echo "%%PREFIX%%/%%DOCSDIR%%/SECURITY"
|
||||||
%%SCPONLY_CHROOT%%sbin/scponlyc
|
%%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
|
%%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
|
%%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
|
%%CHROOT%%%%EXAMPLESDIR%%/setup_chroot.sh
|
||||||
%%SCPONLY_CHROOT%%%%EXAMPLESDIR%%/config.h
|
%%CHROOT%%%%EXAMPLESDIR%%/config.h
|
||||||
etc/scponly/debuglevel
|
etc/scponly/debuglevel
|
||||||
|
man/man8/scponly.8.gz
|
||||||
@dirrm etc/scponly
|
@dirrm etc/scponly
|
||||||
%%SCPONLY_CHROOT%%@dirrm %%EXAMPLESDIR%%
|
%%CHROOT%%@dirrm %%EXAMPLESDIR%%
|
||||||
|
|
Loading…
Add table
Reference in a new issue