# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 90481 2012-03-06 23:03:41Z cal@macports.org $

PortSystem          1.0

name                libvirt
version             0.9.10
revision            1
categories          sysutils
license             LGPL-2.1+
platforms           darwin
maintainers         redhat.com:jclift

description         Libvirt - The Virtualization API

long_description    A toolkit to interact with the virtualization \
                    capabilities of modern hypervisors.

homepage            http://www.libvirt.org/
master_sites        ${homepage}sources/

checksums           rmd160  8f103b176fc7b943a88cf7196709865edc5db5e8 \
                    sha256  5b81d9f054ee4b395b0ab4f59845d082baaa6d6c2a038c966309156dde16e11d

depends_build       port:pkgconfig \
                    port:xhtml1

depends_lib         port:curl \
                    port:gnutls \
                    port:libiconv \
                    port:libpcap \
                    port:libssh2 \
                    port:libxml2 \
                    port:readline \
                    port:yajl \
                    port:zlib

patchfiles          patch-src-util-virfile.h.diff

configure.args      --without-apparmor \
                    --without-audit \
                    --without-avahi \
                    --without-capng \
                    --without-dtrace \
                    --without-hal \
                    --with-init-script=none \
                    --without-lxc \
                    --without-macvtap \
                    --without-netcf \
                    --without-network \
                    --without-numactl \
                    --without-openvz \
                    --without-phyp \
                    --without-polkit \
                    --without-python \
                    --without-qemu \
                    --without-sasl \
                    --without-selinux \
                    --without-udev \
                    --without-uml \
                    --without-virtualport \
                    --without-xen \
                    --without-xenapi \
                    --without-xen-inotify \
                    --with-esx \
                    --with-libpcap \
                    --with-libvirtd \
                    --with-remote \
                    --with-test \
                    --with-vbox=check \
                    --with-vmware \
                    --with-xml-catalog-file=${prefix}/etc/xml/catalog \
                    --with-yajl

variant avahi description {Use Avahi to advertise remote daemon} {
    depends_lib-append      port:avahi
    configure.args-delete   --without-avahi
    configure.args-append   --with-avahi
}

variant python24 conflicts python25 python26 python27 \
                 description {Compile Python 2.4 bindings} {
    depends_lib-append      port:python24
    configure.args-delete   --without-python
    configure.args-append   --with-python
    configure.env-append    PYTHON=${prefix}/bin/python2.4
}

variant python25 conflicts python24 python26 python27 \
                 description {Compile Python 2.5 bindings} {
    depends_lib-append      port:python25
    configure.args-delete   --without-python
    configure.args-append   --with-python
    configure.env-append    PYTHON=${prefix}/bin/python2.5
}

variant python26 conflicts python24 python25 python27 \
                 description {Compile Python 2.6 bindings} {
    depends_lib-append      port:python26
    configure.args-delete   --without-python
    configure.args-append   --with-python
    configure.env-append    PYTHON=${prefix}/bin/python2.6
}

variant python27 conflicts python24 python25 python26 \
                 description {Compile Python 2.7 bindings} {
    depends_lib-append      port:python27
    configure.args-delete   --without-python
    configure.args-append   --with-python
    configure.env-append    PYTHON=${prefix}/bin/python2.7
}

variant sasl description {Use Cyrus SASL for authentication} {
    depends_lib-append      port:cyrus-sasl2
    configure.args-delete   --without-sasl
    configure.args-append   --with-sasl
}
