aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorswills <swills@FreeBSD.org>2014-03-18 21:24:54 +0800
committerswills <swills@FreeBSD.org>2014-03-18 21:24:54 +0800
commit85bf64624d9322a95878f33ce349726c5e18eef0 (patch)
tree9fce33492991395917b5debef5d41bfb9fe19b54
parent55217cdd585abad84d89aff6873f62809a750677 (diff)
downloadfreebsd-ports-gnome-85bf64624d9322a95878f33ce349726c5e18eef0.tar.gz
freebsd-ports-gnome-85bf64624d9322a95878f33ce349726c5e18eef0.tar.zst
freebsd-ports-gnome-85bf64624d9322a95878f33ce349726c5e18eef0.zip
- Simulate SSP_NEED_NONSHARED for gcc
- Add stack-protector-all to Options - Move CC and LIBDIR from REINPLACE to MAKE_ARGS - Remove duplicate -02 CFLAGS - Change strcpy() to strlcpy(), patch from OpenBSD - Move STRIP_CMD before installing DOCS - Bump PORTREVISION PR: ports/187667 Submitted by: Horia Racoviceanu <horia@racoviceanu.com> (maintainer)
-rw-r--r--security/libscrypt/Makefile31
1 files changed, 25 insertions, 6 deletions
diff --git a/security/libscrypt/Makefile b/security/libscrypt/Makefile
index 025e4adc7a17..3ce0935f1e90 100644
--- a/security/libscrypt/Makefile
+++ b/security/libscrypt/Makefile
@@ -3,6 +3,7 @@
PORTNAME= libscrypt
PORTVERSION= 1.18
+PORTREVISION= 1
CATEGORIES= security
MAINTAINER= horia@racoviceanu.com
@@ -17,30 +18,48 @@ GH_ACCOUNT= technion
GH_TAGNAME= ${GH_COMMIT}
GH_COMMIT= 35b6894
+MAKE_ARGS+= CC=${CC} LIBDIR=${PREFIX}/lib
+
PLIST_FILES= include/libscrypt.h \
lib/libscrypt.so \
lib/libscrypt.so.0
PORTDOCS= README.md
+
OPTIONS_DEFINE= DOCS
+OPTIONS_DEFAULT=STACKPROTECTOR
+
+OPTIONS_SINGLE= BUFFER_OVERFLOW_PROTECTION
+OPTIONS_SINGLE_BUFFER_OVERFLOW_PROTECTION= STACKPROTECTOR STACKPROTECTORALL
+
+STACKPROTECTOR_DESC= Protect functions with vulnerable objects
+STACKPROTECTORALL_DESC= Protect all functions
.include <bsd.port.pre.mk>
post-patch:
- @${REINPLACE_CMD} -e 's|CC?=gcc|CC?=${CC}|; s|CFLAGS?=|CFLAGS+=|; \
- s|LIBDIR ?|LIBDIR |' ${WRKSRC}/Makefile
+ @${REINPLACE_CMD} -e 's|?=-|+=-|; s|-O2 ||' ${WRKSRC}/Makefile
+
+.if ${PORT_OPTIONS:MSTACKPROTECTORALL}
+ @${REINPLACE_CMD} -e 's|stack-protector|&-all|' ${WRKSRC}/Makefile
+.endif
-.if ${ARCH} == i386 && ${COMPILER_TYPE} == gcc
- @${REINPLACE_CMD} -e 's|stack-protector|no-&|' ${WRKSRC}/Makefile
+.if ${ARCH} == i386 && ${COMPILER_TYPE} == gcc && ${OSVERSION} < 1000036
+ @${REINPLACE_CMD} -e 's|-lscrypt|& -lssp_nonshared|; \
+ s|\.version|&,-lssp_nonshared|' ${WRKSRC}/Makefile
.endif
+ @${REINPLACE_CMD} -e \
+ 's|strcpy(mcf2, mcf);|strlcpy(mcf2, mcf, SCRYPT_MCF_LEN);|' \
+ ${WRKSRC}/main.c
+
regression-test: build
(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} check)
post-install:
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}.so.0
+
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
- ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}.so.0
-
.include <bsd.port.post.mk>