summaryrefslogtreecommitdiff
path: root/irc
diff options
context:
space:
mode:
authorBernard Spil <brnrd@FreeBSD.org>2016-02-15 19:19:24 +0000
committerBernard Spil <brnrd@FreeBSD.org>2016-02-15 19:19:24 +0000
commitcba5094fe420e850087bc787c713435d003c0e90 (patch)
treee09965415128a37878ca008590a3a0d55146b77a /irc
parentUpgrade to v. 1.6.9. (diff)
irc/ircd-ratbox: Fix OpenSSL linking and simplify
- Fix linking with ports' ssl libs - Fix `contrib` build (used base openssl headers) - Re-work EGD detection - Use options helpers - Simplify REINPLACE with :U defaults PR: 195796 Reviewed by: feld (mentor) Approved by: feld (mentor) Differential Revision: D5286
Notes
Notes: svn path=/head/; revision=408952
Diffstat (limited to 'irc')
-rw-r--r--irc/ircd-ratbox/Makefile116
-rw-r--r--irc/ircd-ratbox/files/patch-configure53
-rw-r--r--irc/ircd-ratbox/files/patch-configure.ac13
-rw-r--r--irc/ircd-ratbox/files/patch-contrib_Makefile.in18
-rw-r--r--irc/ircd-ratbox/files/patch-libratbox_src_openssl.c2
5 files changed, 39 insertions, 163 deletions
diff --git a/irc/ircd-ratbox/Makefile b/irc/ircd-ratbox/Makefile
index 74e35328eac2..6fdbdf56571b 100644
--- a/irc/ircd-ratbox/Makefile
+++ b/irc/ircd-ratbox/Makefile
@@ -3,7 +3,7 @@
PORTNAME= ircd-ratbox
PORTVERSION= 3.0.8
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= irc ipv6
MASTER_SITES= http://www.ratbox.org/download/ \
http://www.ratbox.org/download/old/
@@ -61,59 +61,20 @@ SHORTCUTS_DESC= Build with ircd-shortcut commands
OPTIONS_DEFAULT= OPENSSL IPV6 ZIPLINKS SHARED_MODS
OPTIONS_EXCLUDE= NLS EXAMPLES
-#----------------------------------------------------------------------
-
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MOPENSSL}
-USE_OPENSSL= yes
-CONFIGURE_ARGS+= --enable-openssl
-.else
-CONFIGURE_ARGS+= --disable-openssl
-.endif
-
-.if ${PORT_OPTIONS:MIPV6}
-CONFIGURE_ARGS+= --enable-ipv6
-.else
-CONFIGURE_ARGS+= --disable-ipv6
-.endif
-
-.if ${PORT_OPTIONS:MZIPLINKS}
-CONFIGURE_ARGS+= --enable-zlib
-.else
-CONFIGURE_ARGS+= --disable-zlib
-.endif
-
-.if ${PORT_OPTIONS:MSHARED_MODS}
-CONFIGURE_ARGS+= --disable-static
-.else
-CONFIGURE_ARGS+= --enable-static
-.endif
-
-.if ${PORT_OPTIONS:MASSERT}
-CONFIGURE_ARGS+= --enable-assert
-.else
-CONFIGURE_ARGS+= --disable-assert
-.endif
-
-.if ${PORT_OPTIONS:MSMALL_NET}
-CONFIGURE_ARGS+= --enable-small-net
-.endif
-
-.if ${PORT_OPTIONS:MSERVICES}
-CONFIGURE_ARGS+= --enable-services
-PLIST_SUB+= SERVICES=""
-.else
-PLIST_SUB+= SERVICES="@comment "
-.endif
-
-.if ${PORT_OPTIONS:MSHORTCUTS}
-USES+= perl5
-USE_PERL5= build
-PLIST_SUB+= SHORTCUTS=""
-.else
-PLIST_SUB+= SHORTCUTS="@comment "
-.endif
+OPTIONS_SUB= yes
+
+ASSERT_CONFIGURE_ENABLE= assert
+IPV6_CONFIGURE_ENABLE= ipv6
+OPENSSL_USE= openssl=yes
+OPENSSL_CONFIGURE_ON= --enable-openssl=${OPENSSLBASE}
+OPENSSL_CONFIGURE_OFF= --disable-openssl
+SERVICES_CONFIGURE_ENABLE= services
+SHARED_MODS_CONFIGURE_ON= --disable-static
+SHARED_MODS_CONFIGURE_OFF= --enable-static
+SHORTCUTS_USES= perl5
+SHORTCUTS_USE= perl5=build
+SMALL_NET_CONFIGURE_ENABLE= small-net
+ZIPLINKS_CONFIGURE_ENABLE= zlib
#-- User Configuration -------------------------------------------------
@@ -159,48 +120,17 @@ pre-build:
${WRKSRC}/doc/example.efnet.conf
@${REINPLACE_CMD} -e "s#%%RUNDIR%%#${RUNDIR}#g" ${WRKSRC}/include/config.h
@${REINPLACE_CMD} -e "s#%%DBDIR%%#${DBDIR}#g" ${WRKSRC}/include/config.h
- @${REINPLACE_CMD} -e "s#%%WRKSRC%%#${WRKSRC}#g" ${WRKSRC}/contrib/ircd-shortcut.pl
-
#-- ircd-shortcut.pl ratbox-services commands --------------------------------------
-
-.if !empty(SERVER_NAME)
- @${REINPLACE_CMD} -e "s#services.ircd-ratbox.org#${SERVER_NAME}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
-.if !empty(USER_SERV)
- @${REINPLACE_CMD} -e "s#USERSERV#${USER_SERV}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
-.if !empty(CHAN_SERV)
- @${REINPLACE_CMD} -e "s#CHANSERV#${CHAN_SERV}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
-.if !empty(NICK_SERV)
- @${REINPLACE_CMD} -e "s#NICKSERV#${NICK_SERV}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
-.if !empty(ALIS_SERV)
- @${REINPLACE_CMD} -e "s#ALIS#${ALIS_SERV}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
-.if !empty(OPER_BOT)
- @${REINPLACE_CMD} -e "s#OPERBOT#${OPER_BOT}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
-.if !empty(OPER_SERV)
- @${REINPLACE_CMD} -e "s#OPERSERV#${OPER_SERV}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
-.if !empty(JUPE_SERV)
- @${REINPLACE_CMD} -e "s#JUPESERV#${JUPE_SERV}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
-.if !empty(GLOBAL_SERV)
- @${REINPLACE_CMD} -e "s#GLOBAL#${GLOBAL_SERV}#" \
- ${WRKSRC}/contrib/ircd-shortcut.pl
-.endif
+ @${REINPLACE_CMD} -e "s#ALIS#${ALIS_SERV:UALIS}#" \
+ -e "s#CHANSERV#${CHAN_SERV:UCHANSERV}#" -e "s#GLOBAL#${GLOBAL_SERV:UGLOBAL}#" \
+ -e "s#JUPESERV#${JUPE_SERV:UJUPESERV}#" -e "s#NICKSERV#${NICK_SERV:UNICKSERV}#" \
+ -e "s#OPERBOT#${OPER_BOT:UOPERBOT}#" -e "s#USERSERV#${USER_SERV:UUSERSERV}#" \
+ -e "s#services.ircd-ratbox.org#${SERVER_NAME:Uservices.ircd-ratbox.org}#" \
+ -e "s#%%WRKSRC%%#${WRKSRC}#g" ${WRKSRC}/contrib/ircd-shortcut.pl
# ----- Execute ircd-shortcut perl script to generate the .c file. -----
+.include <bsd.port.options.mk>
+
.if ${PORT_OPTIONS:MSHORTCUTS}
@${ECHO_MSG} "Executing ircd-shortcut.pl for ircd-shortcuts generation."
${PERL} ${WRKSRC}/contrib/ircd-shortcut.pl
diff --git a/irc/ircd-ratbox/files/patch-configure b/irc/ircd-ratbox/files/patch-configure
deleted file mode 100644
index dfd2688288bf..000000000000
--- a/irc/ircd-ratbox/files/patch-configure
+++ /dev/null
@@ -1,53 +0,0 @@
---- configure.orig 2012-03-11 00:34:21 UTC
-+++ configure
-@@ -13659,6 +13659,50 @@ else
-
- fi
-
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAND_egd in -lcrypto" >&5
-+$as_echo_n "checking for RAND_egd in -lcrypto... " >&6; }
-+if ${ac_cv_lib_crypto_RAND_egd+:} false; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lcrypto $LIBS"
-+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+ Use char because int might match the return type of a GCC
-+ builtin and then its argument prototype would still apply. */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char RAND_egd ();
-+int
-+main ()
-+{
-+return RAND_egd ();
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_link "$LINENO"; then :
-+ ac_cv_lib_crypto_RAND_egd=yes
-+else
-+ ac_cv_lib_crypto_RAND_egd=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext \
-+ conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_egd" >&5
-+$as_echo "$ac_cv_lib_crypto_RAND_egd" >&6; }
-+if test "x$ac_cv_lib_crypto_RAND_egd" = xyes; then :
-+
-+$as_echo "#define HAVE_RAND_EGD 1" >>confdefs.h
-+
-+
-+fi
-+
-+
-
- if test "$cf_enable_openssl" != no; then
-
diff --git a/irc/ircd-ratbox/files/patch-configure.ac b/irc/ircd-ratbox/files/patch-configure.ac
deleted file mode 100644
index d3355664fb6e..000000000000
--- a/irc/ircd-ratbox/files/patch-configure.ac
+++ /dev/null
@@ -1,13 +0,0 @@
---- configure.ac.orig 2012-03-11 01:34:21.000000000 +0100
-+++ configure.ac 2015-03-10 20:48:02.040440133 +0100
-@@ -244,6 +244,10 @@
- cf_enable_openssl="no"
- fi
- unset cf_openssl_basedir
-+
-+ AC_CHECK_LIB(crypto, RAND_egd, AC_DEFINE(HAVE_RAND_EGD, 1,
-+ [Define if the libcrypto has RAND_egd]))
-+
- else
- dnl If --disable-openssl was specified
- AC_MSG_RESULT(disabled)
diff --git a/irc/ircd-ratbox/files/patch-contrib_Makefile.in b/irc/ircd-ratbox/files/patch-contrib_Makefile.in
index 065b00023cfb..5976f7d54165 100644
--- a/irc/ircd-ratbox/files/patch-contrib_Makefile.in
+++ b/irc/ircd-ratbox/files/patch-contrib_Makefile.in
@@ -1,6 +1,18 @@
---- contrib/Makefile.in.orig 2012-03-11 01:12:06.000000000 +0100
-+++ contrib/Makefile.in 2014-07-02 01:22:20.963771475 +0200
-@@ -429,8 +429,8 @@
+Fix linking ssl, used /usr/include/openssl even when --enable-openssl=%LOCALBASE%
+was used
+
+--- contrib/Makefile.in.orig 2012-03-11 00:12:06 UTC
++++ contrib/Makefile.in
+@@ -202,7 +202,7 @@ coredir = @moduledir@
+ servicesdir = @moduledir@/autoload
+ libmodulesdir = @moduledir@
+ contribdir = @moduledir@/contrib
+-INCLUDES = -I../include -I../libratbox/include $(INCLTDL)
++INCLUDES = -I../include -I../libratbox/include $(INCLTDL) $(SSL_INCLUDES)
+ AM_CFLAGS = $(WARNFLAGS)
+ SRCS = \
+ example_module.c \
+@@ -429,8 +429,8 @@ clean-generic:
$(LIBTOOL) --mode=clean $(RB_RM) -f $(S_OBJS) $(S_CORE_OBJS) $(ST_OBJS)
install_modules: $(S_OBJS)
diff --git a/irc/ircd-ratbox/files/patch-libratbox_src_openssl.c b/irc/ircd-ratbox/files/patch-libratbox_src_openssl.c
index 9fda3569f240..dca47e6bed91 100644
--- a/irc/ircd-ratbox/files/patch-libratbox_src_openssl.c
+++ b/irc/ircd-ratbox/files/patch-libratbox_src_openssl.c
@@ -4,7 +4,7 @@
switch (seed_type)
{
-+#ifdef HAVE_RAND_EGD
++#ifndef OPENSSL_NO_EGD
case RB_PRNG_EGD:
if(RAND_egd(path) == -1)
return -1;