On 7/19/06, John E Hein <[EMAIL PROTECTED]> wrote:
Let's say there are two ports A & B.
They both provide libfoo.so.1 (and so register CONFLICTS with each other).

Now port C wants to use libfoo (and doesn't care if it gets it
from A or B).

What does port C list in it's LIB_DEPENDS?

What if it lists A and someone installs B... does A get registered as
the dependency when C is installed even though A is not installed?


In the port Cs Makefile, you add:

.if exists(${PREFIX}/bin/file found only in Port B)
PORTA_STAT= OFF
PORTB_STAT= ON
.else
PORTA_STAT= ON
PORTB_STAT= OFF
.endif

OPTIONS = PORTA "Depends on libfoo from port A" ${PORTA_STAT} \
                 PORTB "Depends on libfoo from port B" ${PORTB_STAT}

.if defined(WITH_PORTA) || !defined(WITHOUT_PORTA)
LIB_DEPENDS+= foo.1:${PORTSDIR}/dependancy on Port A
.elif defined(WITH_PORTB)
LIB_DEPENDS+= foo.1:${PORTSDIR}/dependancy on Port B
.else
IGNORE= Must choose either port A or B
.endif

This allows the admin to install either port A or B, and port C will
automatically detect which port is installed, as well as allowing the
admin to choose which to install.

Scot
--
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.
_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to