1PORTNAME=	scponly
2PORTVERSION=	4.8.20110526
3PORTREVISION=	2
4CATEGORIES=	shells security
5MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-snapshots
6DISTNAME=	${PORTNAME}-20110526
7
8MAINTAINER=	ports@MidnightBSD.org
9COMMENT=	Tiny shell that only permits scp and sftp
10WWW=		https://github.com/scponly/scponly/wiki
11
12LICENSE=	bsd2
13
14USES=		cpe tar:tgz
15
16PORTDOCS=	BUILDING-JAILS.TXT INSTALL README SECURITY
17GNU_CONFIGURE=	yes
18GNU_CONFIGURE_MANPREFIX=	${PREFIX}/share
19
20OPTIONS_DEFINE=	CHROOT DEFAULT_CHDIR DOCS GFTP RSYNC SCP SUBVERSION SVNSERVE \
21		UNISON WILDCARDS WINSCP
22OPTIONS_DEFAULT=	WILDCARDS
23DEFAULT_CHDIR_DESC=	Chdir(2) by default
24WILDCARDS_DESC=		Wildcards processing
25GFTP_DESC=	gftp support
26RSYNC_DESC=	rsync support
27CHROOT_DESC=	chroot(8) functionality
28SCP_DESC=	vanilla scp support
29SVNSERVE_DESC=	Subversion support for svn+ssh://
30UNISON_DESC=	Unisson support
31WINSCP_DESC=	WinSCP support
32
33OPTIONS_SUB=	yes
34
35.if !exists(/usr/bin/sftp)
36BUILD_DEPENDS+=	openssh-portable>0:security/openssh-portable
37RUN_DEPENDS+=	openssh-portable>0:security/openssh-portable
38.endif
39DEFAULT_CHDIR_CONFIGURE_ON=	--with-default-chdir=${SCPONLY_DEFAULT_CHDIR}
40WILDCARDS_CONFIGURE_ENABLE=	wildcards
41GFTP_CONFIGURE_ENABLE=		gftp-compat
42CHROOT_CONFIGURE_ENABLE=	chrooted-binary
43CHROOT_USE=			RC_SUBR=scponlyc
44RSYNC_BUILD_DEPENDS=		rsync:net/rsync
45RSYNC_RUN_DEPENDS=		rsync:net/rsync
46RSYNC_CONFIGURE_ENABLE=		rsync-compat
47SCP_CONFIGURE_ENABLE=		scp-compat
48SUBVERSION_CONFIGURE_ENABLE=	svn-compat
49.if ${WITH_SUBVERSION_VER:U} == LTS
50SUBVERSION_BUILD_DEPENDS=	svn:devel/subversion-lts
51SUBVERSION_RUN_DEPENDS=		svn:devel/subversion-lts
52SVNSERVE_BUILD_DEPENDS=		svn:devel/subversion-lts
53SVNSERVE_RUN_DEPENDS=		svn:devel/subversion-lts
54.else
55SUBVERSION_BUILD_DEPENDS=	svn:devel/subversion
56SUBVERSION_RUN_DEPENDS=		svn:devel/subversion
57SVNSERVE_BUILD_DEPENDS=		svn:devel/subversion
58SVNSERVE_RUN_DEPENDS=		svn:devel/subversion
59.endif
60SVNSERVE_CONFIGURE_ENABLE=	svnserv-compat
61UNISON_BUILD_DEPENDS=		unison:net/unison
62UNISON_RUN_DEPENDS=		unison:net/unison
63UNISON_CONFIGURE_ENABLE=	unison-compat
64WINSCP_CONFIGURE_ENABLE=	winscp-compat
65
66post-patch:
67	@${ECHO_MSG} "In addition to knobs available from the OPTIONS dialog,"
68	@${ECHO_MSG} "you may set SCPONLY_DEFAULT_CHDIR to make users 'cd' to"
69	@${ECHO_MSG} "this directory after authentication."
70	@${REINPLACE_CMD} -e "s/-o 0 -g 0//g" ${WRKSRC}/Makefile.in
71
72post-install:
73	@${MKDIR} ${EXAMPLESDIR}
74	${INSTALL_SCRIPT} ${WRKSRC}/setup_chroot.sh ${EXAMPLESDIR}
75	${INSTALL_DATA} ${WRKSRC}/config.h ${EXAMPLESDIR}
76	@${MKDIR} ${DOCSDIR}
77.for i in ${PORTDOCS}
78	${INSTALL_DATA} ${WRKSRC}/$i ${DOCSDIR}
79.endfor
80
81.include <bsd.port.mk>
82