aboutsummaryrefslogtreecommitdiffstats
path: root/irc
diff options
context:
space:
mode:
authorfeld <feld@FreeBSD.org>2015-05-01 08:03:27 +0800
committerfeld <feld@FreeBSD.org>2015-05-01 08:03:27 +0800
commit1aea85788a948171db32352244c8bee623f8f808 (patch)
tree4e42bc01c7b35a80e61ae884be2b607fd50c39a2 /irc
parentd60839f52080c2db536bffb84faabff7f0bffdec (diff)
downloadfreebsd-ports-gnome-1aea85788a948171db32352244c8bee623f8f808.tar.gz
freebsd-ports-gnome-1aea85788a948171db32352244c8bee623f8f808.tar.zst
freebsd-ports-gnome-1aea85788a948171db32352244c8bee623f8f808.zip
Support building with LibreSSL
Fully strip binaries unless DEBUG enabled Create /var dirs in rc script start_precmd instead of in package Make rc script pass rclint Upstream has accepted the LibreSSL patches but their releases are far apart, so patching in ports tree for now. PR: 198506
Diffstat (limited to 'irc')
-rw-r--r--irc/ircd-ratbox/Makefile14
-rw-r--r--irc/ircd-ratbox/files/ircd-ratbox.in15
-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-libratbox_src_openssl.c15
5 files changed, 97 insertions, 13 deletions
diff --git a/irc/ircd-ratbox/Makefile b/irc/ircd-ratbox/Makefile
index 3aff1824f891..c74257fd66b8 100644
--- a/irc/ircd-ratbox/Makefile
+++ b/irc/ircd-ratbox/Makefile
@@ -3,7 +3,7 @@
PORTNAME= ircd-ratbox
PORTVERSION= 3.0.8
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= irc ipv6
MASTER_SITES= http://www.ratbox.org/download/ \
http://www.ratbox.org/download/old/
@@ -125,6 +125,11 @@ CONFIGURE_ARGS+= --with-nicklen=${NICKLEN}
#-----------------------------------------------------------------------
+post-patch:
+.if !defined(WITH_DEBUG)
+ ${REINPLACE_CMD} 's|@INSTALL@|@INSTALL@ -s|' ${WRKSRC}/install-mod.sh.in
+.endif
+
pre-configure:
@${ECHO_MSG} ""
@${ECHO_MSG} "This port has additional options:"
@@ -220,9 +225,6 @@ pre-install:
${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/modules
post-install:
- ${MKDIR} ${STAGEDIR}${DBDIR}
- ${MKDIR} ${STAGEDIR}${RUNDIR}
- ${MKDIR} ${STAGEDIR}${LOGDIR}
${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC}/doc && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
cd ${INSTALL_WRKSRC}/contrib && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
@@ -231,6 +233,10 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/doc/example.conf ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/ircd.conf.sample
${INSTALL_DATA} ${WRKSRC}/doc/example.efnet.conf ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/ircd-efnet.conf.sample
${INSTALL_DATA} ${WRKSRC}/doc/genssl.sh ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/genssl.sh
+.if !defined(WITH_DEBUG)
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/ircd-ratbox/libcore.so
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/ircd-ratbox/libratbox.so
+.endif
# ----- We need to install the shortcut.pl module ----
.if ${PORT_OPTIONS:MSHORTCUTS}
diff --git a/irc/ircd-ratbox/files/ircd-ratbox.in b/irc/ircd-ratbox/files/ircd-ratbox.in
index f2e1e1609a9d..d33826e8bf8f 100644
--- a/irc/ircd-ratbox/files/ircd-ratbox.in
+++ b/irc/ircd-ratbox/files/ircd-ratbox.in
@@ -5,10 +5,11 @@
# PROVIDE: ircd-ratbox
# REQUIRE: DAEMON
# BEFORE: LOGIN
+# KEYWORD: shutdown
. /etc/rc.subr
-name="ircd_ratbox"
+name=ircd_ratbox
rcvar=ircd_ratbox_enable
load_rc_config $name
@@ -21,17 +22,13 @@ pidfile=%%RUNDIR%%/ircd.pid
required_files="%%PREFIX%%/etc/ircd-ratbox/ircd.conf"
start_precmd=prestart
-stop_precmd=prestop
+stop_precmd="rm -f ${pidfile}"
prestart()
{
- touch $pidfile
- chown $ircd_ratbox_user:$ircd_ratbox_group $pidfile
-}
-
-prestop()
-{
- rm -f $pidfile
+ for i in %%LOGDIR%% %%DBDIR%% %%RUNDIR%%; do
+ install -d -o ${ircd_ratbox_user} -g ${ircd_ratbox_group} ${i}
+ done
}
run_rc_command "$1"
diff --git a/irc/ircd-ratbox/files/patch-configure b/irc/ircd-ratbox/files/patch-configure
new file mode 100644
index 000000000000..dfd2688288bf
--- /dev/null
+++ b/irc/ircd-ratbox/files/patch-configure
@@ -0,0 +1,53 @@
+--- 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
new file mode 100644
index 000000000000..d3355664fb6e
--- /dev/null
+++ b/irc/ircd-ratbox/files/patch-configure.ac
@@ -0,0 +1,13 @@
+--- 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-libratbox_src_openssl.c b/irc/ircd-ratbox/files/patch-libratbox_src_openssl.c
new file mode 100644
index 000000000000..9fda3569f240
--- /dev/null
+++ b/irc/ircd-ratbox/files/patch-libratbox_src_openssl.c
@@ -0,0 +1,15 @@
+--- libratbox/src/openssl.c.orig 2012-03-16 07:29:42.000000000 +0100
++++ libratbox/src/openssl.c 2015-03-10 21:01:33.572383130 +0100
+@@ -556,10 +556,12 @@
+
+ switch (seed_type)
+ {
++#ifdef HAVE_RAND_EGD
+ case RB_PRNG_EGD:
+ if(RAND_egd(path) == -1)
+ return -1;
+ break;
++#endif
+ case RB_PRNG_FILE:
+ if(RAND_load_file(path, -1) == -1)
+ return -1;