summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Scherbaum <dertobi123@gentoo.org>2008-07-11 18:56:49 +0000
committerTobias Scherbaum <dertobi123@gentoo.org>2008-07-11 18:56:49 +0000
commit3b8f511bd9eb3bced0f5a6b18a0f5fd0358a5ef6 (patch)
treeff3a2dd4126cc290a67596e011e64f34812ba1b3 /mail-mta
parentamd64 stable (diff)
downloadgentoo-2-3b8f511bd9eb3bced0f5a6b18a0f5fd0358a5ef6.tar.gz
gentoo-2-3b8f511bd9eb3bced0f5a6b18a0f5fd0358a5ef6.tar.bz2
gentoo-2-3b8f511bd9eb3bced0f5a6b18a0f5fd0358a5ef6.zip
strndup workaround for gfbsd, #227799
(Portage version: 2.2_rc1/cvs/Linux 2.6.25-gentoo-r6 x86_64)
Diffstat (limited to 'mail-mta')
-rw-r--r--mail-mta/ssmtp/ChangeLog6
-rw-r--r--mail-mta/ssmtp/files/ssmtp-2.62-strndup.patch32
-rw-r--r--mail-mta/ssmtp/ssmtp-2.62.ebuild8
3 files changed, 43 insertions, 3 deletions
diff --git a/mail-mta/ssmtp/ChangeLog b/mail-mta/ssmtp/ChangeLog
index f09ed2dbb31e..e282cd63db33 100644
--- a/mail-mta/ssmtp/ChangeLog
+++ b/mail-mta/ssmtp/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for mail-mta/ssmtp
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/ssmtp/ChangeLog,v 1.50 2008/06/11 18:00:53 dertobi123 Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/ssmtp/ChangeLog,v 1.51 2008/07/11 18:56:48 dertobi123 Exp $
+
+ 11 Jul 2008; Tobias Scherbaum <dertobi123@gentoo.org>
+ +files/ssmtp-2.62-strndup.patch, ssmtp-2.62.ebuild:
+ strndup workaround for gfbsd, #227799
11 Jun 2008; Tobias Scherbaum <dertobi123@gentoo.org> ssmtp-2.62.ebuild:
Fix virtual/mta blocker
diff --git a/mail-mta/ssmtp/files/ssmtp-2.62-strndup.patch b/mail-mta/ssmtp/files/ssmtp-2.62-strndup.patch
new file mode 100644
index 000000000000..a4434ebf08bb
--- /dev/null
+++ b/mail-mta/ssmtp/files/ssmtp-2.62-strndup.patch
@@ -0,0 +1,32 @@
+Compensate for platforms that don't have strndup, like Solaris
+
+--- configure.in
++++ configure.in
+@@ -30,7 +30,7 @@
+ dnl Checks for library functions.
+ AC_TYPE_SIGNAL
+ AC_FUNC_VPRINTF
+-AC_CHECK_FUNCS(gethostname socket strdup strstr)
++AC_CHECK_FUNCS(gethostname socket strdup strndup strstr)
+
+ dnl Check for optional features
+ AC_ARG_ENABLE(logfile,
+--- ssmtp.c
++++ ssmtp.c
+@@ -842,7 +842,16 @@
+ if (!rest) {
+ return NULL;
+ }
++#ifdef HAVE_STRNDUP
+ tok=strndup(*s,rest-(*s));
++#else
++ {
++ size_t len = rest - (*s);
++ tok = malloc(sizeof(char) * (len + 1));
++ memcpy(tok, *s, len);
++ tok[len] = '\0';
++ }
++#endif
+ if (!tok) {
+ die("firsttok() -- strndup() failed");
+ }
diff --git a/mail-mta/ssmtp/ssmtp-2.62.ebuild b/mail-mta/ssmtp/ssmtp-2.62.ebuild
index 878182af966e..0ead83f2a1ca 100644
--- a/mail-mta/ssmtp/ssmtp-2.62.ebuild
+++ b/mail-mta/ssmtp/ssmtp-2.62.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/ssmtp/ssmtp-2.62.ebuild,v 1.4 2008/06/11 18:00:53 dertobi123 Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/ssmtp/ssmtp-2.62.ebuild,v 1.5 2008/07/11 18:56:48 dertobi123 Exp $
inherit eutils toolchain-funcs
@@ -11,7 +11,7 @@ SRC_URI="mirror://debian/pool/main/s/ssmtp/${P/-/_}.orig.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
-IUSE="ssl ipv6 md5sum"
+IUSE="ssl ipv6 md5sum elibc_FreeBSD"
DEPEND="ssl? ( dev-libs/openssl )"
RDEPEND="${DEPEND}
@@ -29,6 +29,10 @@ src_unpack() {
unpack ${A}
cd "${S}"
+ if use elibc_FreeBSD ; then
+ epatch "${FILESDIR}/${P}-strndup.patch"
+ fi
+
# Respect LDFLAGS (bug #152197)
sed -i -e 's:$(CC) -o:$(CC) @LDFLAGS@ -o:' Makefile.in
}