So I opened Bug #506046 last week to enable support of DTLS over SCTP
(Stream Control Transmission Protocol) in OpenSSL via a configure flag.  But
this means in the ebuild, I have to check for the right userland SCTP
library to depend against:

 # Have the sub-libs in RDEPEND with [static-libs] since, logically,
 # our libssl.a depends on libz.a/etc... at runtime.
 LIB_DEPEND="gmp? ( dev-libs/gmp[static-libs(+)] )
+       sctp? (
+               kernel_linux? ( net-misc/lksctp-tools[static-libs(+)] )
+               kernel_FreeBSD? ( sys-freebsd/freebsd-lib )
+       )

Right now, this check is rather limited, but down the road, if SCTP usage
increases, we'd have to duplicate this specific check more often.  Doubly so
if Gentoo/OpenBSD or NetBSD support gets off the ground and a package exists
that supports SCTP, but needs the appropriate userland-lib to link against.

I think the best way to future proof against this is to add a virtual/sctp
package that picks between the appropriate userland library for SCTP
support, depending on the kernel_* USE flags.  kernel_linux pulls in
net-misc/lksctp-tools and kernel_FreeBSD will simply depend on
sys-freebsd/freebsd-lib (FBSD is actually the reference implementation of SCTP).

I've attached a first draft of virtual/sctp/sctp-0.ebuild, which passes
repoman checks, but I think it needs to be made multilib-aware.
Additionally, that means lksctp-tools probably needs some multilib-magic
applied.  I am not finding a solid guide on properly upgrading an ebuild to
become multilib-aware.  Can one of the multilib experts check things and let
me know what is needed if people agree this is a good way to go down?

Otherwise, I'll commit the change to OpenSSL above and resolve that bug.

Thanks!,

-- 
Joshua Kinard
Gentoo/MIPS
ku...@gentoo.org
4096R/D25D95E3 2011-03-28

"The past tempts us, the present confuses us, the future frightens us.  And
our lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

DESCRIPTION="Virtual to select net-misc/lksctp-tools or sys-freebsd/freebsd-lib 
for userland SCTP lib support"
HOMEPAGE=""
SRC_URI=""

LICENSE=""
SLOT="0"
KEYWORDS="~alpha ~amd64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd 
~x86-fbsd"
# These default enabled IUSE flags should follow defaults of sys-fs/udev.
IUSE="kernel_linux kernel_FreeBSD static-libs"

DEPEND=""
RDEPEND="|| (
                kernel_linux? ( net-misc/lksctp-tools[static-libs(+)] )
                kernel_FreeBSD? ( sys-freebsd/freebsd-lib )
        )"

Reply via email to