aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authoradamw <adamw@FreeBSD.org>2014-05-01 07:17:32 +0800
committeradamw <adamw@FreeBSD.org>2014-05-01 07:17:32 +0800
commitf283955457b5bce18447cf40eaf5044b0cebe40b (patch)
treee5c049ba161ec35b301b4862ff38d68de3debd40 /security
parent81d8f204261dd7abd6be6b663eef2f63ee5b9cd1 (diff)
downloadfreebsd-ports-gnome-f283955457b5bce18447cf40eaf5044b0cebe40b.tar.gz
freebsd-ports-gnome-f283955457b5bce18447cf40eaf5044b0cebe40b.tar.zst
freebsd-ports-gnome-f283955457b5bce18447cf40eaf5044b0cebe40b.zip
STAGE. Use OPTIONS helpers and a .for loop to shorten
Makefile by 33%. Use DO_MAKE_BUILD instead of custom and inconsistent gmake invocations.
Diffstat (limited to 'security')
-rw-r--r--security/axTLS/Makefile173
1 files changed, 53 insertions, 120 deletions
diff --git a/security/axTLS/Makefile b/security/axTLS/Makefile
index 065a0694a623..3a07cb3dc637 100644
--- a/security/axTLS/Makefile
+++ b/security/axTLS/Makefile
@@ -16,8 +16,8 @@ OPTIONS_DEFINE= COMPAT_OPENSSL HTTPD TLSWRAP X509 PERL DOCS DEBUG TEST
OPTIONS_SINGLE= MODE PROT
OPTIONS_SINGLE_MODE= SERVER_ONLY CERT_VERIFICATION ENABLE_CLIENT \
FULL_MODE SKELETON_MODE
-OPTIONS_SINGLE_PROT= LOW MEDIUM HIGH
-OPTIONS_DEFAULT= FULL_MODE MEDIUM
+OPTIONS_SINGLE_PROT= PROT_LOW PROT_MEDIUM PROT_HIGH
+OPTIONS_DEFAULT= FULL_MODE PROT_MEDIUM
COMPAT_OPENSSL_DESC= OpenSSL compatible API
TLSWRAP_DESC= Build TLS wrapper like sslwrap
X509_DESC= Generate X.509 Certificate
@@ -31,9 +31,9 @@ CERT_VERIFICATION_DESC= Server only (with verification)
ENABLE_CLIENT_DESC= Client/Server enabled
FULL_MODE_DESC= Client/Server enabled with diagnostics
SKELETON_MODE_DESC= The smallest library with least performance (experimental)
-LOW_DESC= Use the fastest cipher(s) but at the expense of security
-MEDIUM_DESC= Balance between speed and security
-HIGH_DESC= Use the strongest cipher(s) at the cost of speed
+PROT_LOW_DESC= Use the fastest cipher(s) but at the expense of security
+PROT_MEDIUM_DESC= Balance between speed and security
+PROT_HIGH_DESC= Use the strongest cipher(s) at the cost of speed
CONFIG_SUB= PREFIX=\"${PREFIX}\" WWWDIR=\"${WWWDIR}\" \
HTTP_PORT=${WITH_HTTP_PORT} SSL_PORT=${WITH_SSL_PORT}
@@ -46,99 +46,24 @@ STAGE= ${WRKSRC}/_stage
WITH_HTTP_PORT?= 80
WITH_SSL_PORT?= 443
-NO_STAGE= yes
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MSERVER_ONLY}
-CONFIG_SUB+= SERVER_ONLY=""
-.else
-CONFIG_SUB+= SERVER_ONLY="\# "
-.endif
-.if ${PORT_OPTIONS:MCERT_VERIFICATION}
-CONFIG_SUB+= CERT_VERIFICATION=""
-.else
-CONFIG_SUB+= CERT_VERIFICATION="\# "
-.endif
-.if ${PORT_OPTIONS:MENABLE_CLIENT}
-CONFIG_SUB+= ENABLE_CLIENT=""
-.else
-CONFIG_SUB+= ENABLE_CLIENT="\# "
-.endif
-.if ${PORT_OPTIONS:MFULL_MODE}
-CONFIG_SUB+= FULL_MODE=""
-.else
-CONFIG_SUB+= FULL_MODE="\# "
-.endif
-.if ${PORT_OPTIONS:MSKELETON_MODE}
-CONFIG_SUB+= SKELETON_MODE=""
-.else
-CONFIG_SUB+= SKELETON_MODE="\# "
-.endif
-
-.if ${PORT_OPTIONS:MHIGH}
-CONFIG_SUB+= PROT_HIGH=""
-.else
-CONFIG_SUB+= PROT_HIGH="\# "
-.endif
-.if ${PORT_OPTIONS:MMEDIUM}
-CONFIG_SUB+= PROT_MEDIUM=""
-.else
-CONFIG_SUB+= PROT_MEDIUM="\# "
-.endif
-.if ${PORT_OPTIONS:MLOW}
-CONFIG_SUB+= PROT_LOW=""
-.else
-CONFIG_SUB+= PROT_LOW="\# "
-.endif
-
-.if ${PORT_OPTIONS:MCOMPAT_OPENSSL}
-CONFIG_SUB+= COMPAT_OPENSSL=""
-.else
-CONFIG_SUB+= COMPAT_OPENSSL="\# "
-.endif
-
-.if ${PORT_OPTIONS:MHTTPD}
-CONFIG_SUB+= HTTPD=""
-PLIST_SUB+= HTTPD=""
-.else
-CONFIG_SUB+= HTTPD="\# "
-PLIST_SUB+= HTTPD="@comment "
-.endif
-
-.if ${PORT_OPTIONS:MTLSWRAP}
-CONFIG_SUB+= TLSWRAP=""
-PLIST_SUB+= TLSWRAP=""
-.else
-CONFIG_SUB+= TLSWRAP="\# "
-PLIST_SUB+= TLSWRAP="@comment "
-.endif
-
-.if ${PORT_OPTIONS:MX509}
-CONFIG_SUB+= X509=""
-.else
-CONFIG_SUB+= X509="\# "
-.endif
-
-.if ${PORT_OPTIONS:MPERL}
-BUILD_DEPENDS+= swig:${PORTSDIR}/devel/swig13
-CONFIG_SUB+= PERL=""
-PLIST_SUB+= PERL=""
-USES+= perl5
-.else
-CONFIG_SUB+= PERL="\# "
-PLIST_SUB+= PERL="@comment "
-.endif
+PERL_BUILD_DEPENDS= swig:${PORTSDIR}/devel/swig13
+PERL_USES= perl5
+DOCS_BUILD_DEPENDS= doxygen:${PORTSDIR}/devel/doxygen
-.if ${PORT_OPTIONS:MDOCS}
-BUILD_DEPENDS+= doxygen:${PORTSDIR}/devel/doxygen
+OPTIONS_SUB= yes
PORTDOCS= *
-.endif
-.if ${PORT_OPTIONS:MDEBUG}
-CONFIG_SUB+= DEBUG=""
-.else
-CONFIG_SUB+= DEBUG="\# "
-.endif
+.include <bsd.port.options.mk>
+
+.for i in SERVER_ONLY CERT_VERIFICATION ENABLE_CLIENT FULL_MODE \
+ SKELETON_MODE PROT_HIGH PROT_MEDIUM PROT_LOW COMPAT_OPENSSL \
+ HTTPD TLSWRAP X509 PERL DEBUG
+. if ${PORT_OPTIONS:M${i}}
+CONFIG_SUB+= ${i}=""
+. else
+CONFIG_SUB+= ${i}="\# "
+. endif
+.endfor
.if ${PORT_OPTIONS:MTEST}
. if ${PORT_OPTIONS:MCERT_VERIFICATION} || \
@@ -160,46 +85,54 @@ CONFIG_SUB+= TEST_PERF="\# " \
_CONFIG_SUB_TEMP= ${CONFIG_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
+post-patch:
+ ${REINPLACE_CMD} -e '/^CC/s/gcc/${CC}/; /^HOSTCC/s/gcc/${CC}/' \
+ ${WRKSRC}/config/Rules.mak
+
do-configure:
@${SED} ${_CONFIG_SUB_TEMP} \
-e '/^\([^#]*\) is not set$$/s//\1=y/' \
${FILESDIR}/data-.config.in > ${WRKSRC}/config/.config
- cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} \
- ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} oldconfig
+ ${DO_MAKE_BUILD} -C ${WRKSRC} oldconfig
+
+post-build:
+.if ${PORT_OPTIONS:MDOCS}
+ ${DO_MAKE_BUILD} -C ${WRKSRC} docs
+.endif
do-install:
- ${INSTALL_LIB} ${STAGE}/libaxtls.a ${PREFIX}/lib/
- ${INSTALL_LIB} ${STAGE}/libaxtls.so.1.2 ${PREFIX}/lib/
- ${LN} -fs ${PREFIX}/lib/libaxtls.so.1.2 ${PREFIX}/lib/libaxtls.so.1
- ${LN} -fs ${PREFIX}/lib/libaxtls.so.1 ${PREFIX}/lib/libaxtls.so
- ${INSTALL_PROGRAM} ${STAGE}/axssl ${PREFIX}/bin/
+ ${INSTALL_LIB} ${STAGE}/libaxtls.a ${STAGEDIR}${PREFIX}/lib
+ ${INSTALL_LIB} ${STAGE}/libaxtls.so.1.2 ${STAGEDIR}${PREFIX}/lib
+ ${LN} -s libaxtls.so.1.2 ${STAGEDIR}${PREFIX}/lib/libaxtls.so.1
+ ${LN} -fs libaxtls.so.1 ${STAGEDIR}${PREFIX}/lib/libaxtls.so
+ ${INSTALL_PROGRAM} ${STAGE}/axssl ${STAGEDIR}${PREFIX}/bin
.if ${PORT_OPTIONS:MHTTPD}
- ${INSTALL_PROGRAM} ${STAGE}/htpasswd ${PREFIX}/bin/axhtpasswd
- ${INSTALL_PROGRAM} ${STAGE}/axhttpd ${PREFIX}/bin/
+ ${INSTALL_PROGRAM} ${STAGE}/htpasswd ${STAGEDIR}${PREFIX}/bin/axhtpasswd
+ ${INSTALL_PROGRAM} ${STAGE}/axhttpd ${STAGEDIR}${PREFIX}/bin
.endif
.if ${PORT_OPTIONS:MTLSWRAP}
- ${INSTALL_PROGRAM} ${STAGE}/axtlswrap ${PREFIX}/bin/
+ ${INSTALL_PROGRAM} ${STAGE}/axtlswrap ${STAGEDIR}${PREFIX}/bin
.endif
.if ${PORT_OPTIONS:MPERL}
- @${MKDIR} ${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto
- ${INSTALL_SCRIPT} ${STAGE}/axssl.pl ${PREFIX}/bin/
- ${INSTALL_SCRIPT} ${STAGE}/axtlsp.pm ${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/
- ${INSTALL_LIB} ${STAGE}/libaxtlsp.so ${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto/
-.endif
- @${MKDIR} ${PREFIX}/include/axTLS
- ${INSTALL_DATA} ${WRKSRC}/crypto/*.h ${PREFIX}/include/axTLS/
- ${INSTALL_DATA} ${WRKSRC}/ssl/*.h ${PREFIX}/include/axTLS/
- ${RM} ${PREFIX}/include/axTLS/cert.h
- ${RM} ${PREFIX}/include/axTLS/private_key.h
- ${RM} ${PREFIX}/include/axTLS/os_port.h
- ${INSTALL_DATA} ${WRKSRC}/config/config.h ${PREFIX}/include/axTLS/
+ @${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto
+ ${INSTALL_SCRIPT} ${STAGE}/axssl.pl ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${STAGE}/axtlsp.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}
+ ${INSTALL_LIB} ${STAGE}/libaxtlsp.so ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto
+.endif
+ @${MKDIR} ${STAGEDIR}${PREFIX}/include/axTLS
+ ${INSTALL_DATA} ${WRKSRC}/crypto/*.h ${STAGEDIR}${PREFIX}/include/axTLS
+ ${INSTALL_DATA} ${WRKSRC}/ssl/*.h ${STAGEDIR}${PREFIX}/include/axTLS
+ ${RM} ${STAGEDIR}${PREFIX}/include/axTLS/cert.h
+ ${RM} ${STAGEDIR}${PREFIX}/include/axTLS/private_key.h
+ ${RM} ${STAGEDIR}${PREFIX}/include/axTLS/os_port.h
+ ${INSTALL_DATA} ${WRKSRC}/config/config.h ${STAGEDIR}${PREFIX}/include/axTLS
.if ${PORT_OPTIONS:MDOCS}
- cd ${WRKSRC} && ${GMAKE} docs
- @${MKDIR} ${DOCSDIR}
- cd ${WRKSRC}/docsrc/html && ${COPYTREE_SHARE} . ${DOCSDIR}
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ cd ${WRKSRC}/docsrc/html && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
.endif
regression-test: build
+ ${DO_MAKE_BUILD} -C ${WRKSRC} test
cd ${WRKSRC} && ${GMAKE} test
.include <bsd.port.mk>