aboutsummaryrefslogtreecommitdiffstats
path: root/ftp/vsftpd
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2012-09-28 02:52:58 +0800
committerdinoex <dinoex@FreeBSD.org>2012-09-28 02:52:58 +0800
commitd757180640c73834747268be78f7b0c978d2b9e5 (patch)
treedd695aa0d2f978c845b31b2f01f953beb47994d3 /ftp/vsftpd
parent01f9c1318d5671ee02f507172c6b4593551b6182 (diff)
downloadfreebsd-ports-gnome-d757180640c73834747268be78f7b0c978d2b9e5.tar.gz
freebsd-ports-gnome-d757180640c73834747268be78f7b0c978d2b9e5.tar.zst
freebsd-ports-gnome-d757180640c73834747268be78f7b0c978d2b9e5.zip
- new option STACKPROTECTOR
makes building easier on platforms that does not support this feature
Diffstat (limited to 'ftp/vsftpd')
-rw-r--r--ftp/vsftpd/Makefile25
1 files changed, 16 insertions, 9 deletions
diff --git a/ftp/vsftpd/Makefile b/ftp/vsftpd/Makefile
index 0c3ebce494d2..3beb2ce16a78 100644
--- a/ftp/vsftpd/Makefile
+++ b/ftp/vsftpd/Makefile
@@ -26,10 +26,13 @@ DOCFILES= AUDIT BENCHMARKS BUGS Changelog FAQ INSTALL LICENSE \
README README.security README.ssl REFS REWARD \
SIZE SPEED TODO TUNING
-OPTIONS_DEFINE= VSFTPD_SSL PIDFILE
+OPTIONS_DEFINE= VSFTPD_SSL PIDFILE STACKPROTECTOR
+OPTIONS_DEFAULT?= STACKPROTECTOR
+NO_OPTIONS_SORT=yes
VSFTPD_SSL_DESC=Include support for SSL
PIDFILE_DESC= Unofficial support for pidfile
+STACKPROTECTOR_DESC= Build with stack-protector
.include <bsd.port.pre.mk>
@@ -44,13 +47,17 @@ LDFLAGS+= -L${OPENSSLLIB}
EXTRA_PATCHES+= ${FILESDIR}/pidfile.patch
.endif
-VSFTPD_OPTIMIZED= ${CFLAGS:M-O}
+VSFTPD_OPTIMIZED= ${CFLAGS:M-O*}
.if defined(CFLAGS) && !empty(VSFTPD_OPTIMIZED)
-VSFTPD_NO_OPTIMIZED= -e "s| -O2 ||"
+VSFTPD_NO_OPTIMIZED= -e "s|-O2 ||"
.endif
+.if ${PORT_OPTIONS:MSTACKPROTECTOR}
# BROKEN on FreeBSD with undefined reference to `__stack_chk_fail_local'
-LDFLAGS+= -lssp_nonshared
+VSFTPD_LIBS= -lssp_nonshared
+.else
+VSFTPD_NO_SSP= -e "s|-fstack-protector --param=ssp-buffer-size=4 ||"
+.endif
do-configure:
.if !defined(WITHOUT_SSL) && ${PORT_OPTIONS:MVSFTPD_SSL}
@@ -68,11 +75,11 @@ do-configure:
${WRKSRC}/defs.h ${WRKSRC}/vsftpd.conf
${REINPLACE_CMD} -e "s|/etc/v|${PREFIX}/etc/v|" \
${WRKSRC}/vsftpd.8 ${WRKSRC}/vsftpd.conf.5 ${WRKSRC}/tunables.c
- ${REINPLACE_CMD} ${VSFTPD_NO_OPTIMIZED} \
- -e "s|^CC = gcc|CC = ${CC}|" \
- -e "s|^CFLAGS =|CFLAGS = ${CFLAGS}|" \
- -e "s|$$(INSTALL) -m 755=|$${INSTALL_PROGRAM}|" \
- -e "s| -Wl,-s| ${LDFLAGS:S/-rpath=/-Wl,-rpath,/g}|" \
+ ${REINPLACE_CMD} ${VSFTPD_NO_OPTIMIZED} ${VSFTPD_NO_SSP} \
+ -e "s|^CC = gcc|CC = ${CC}|" \
+ -e "s|^CFLAGS = |CFLAGS = ${CFLAGS} |" \
+ -e "s|^LDFLAGS = |LDFLAGS = ${LDFLAGS} |" \
+ -e "s| -Wl,-s| ${VSFTPD_LIBS}|" \
${WRKSRC}/Makefile
${REINPLACE_CMD} -e '/-lutil/d' ${WRKSRC}/vsf_findlibs.sh
@${ECHO_CMD} "secure_chroot_dir=${PREFIX}/share/vsftpd/empty" >> \