Advertisement
Guest User

ganeti-2.7.0_beta1.ebuild

a guest
Feb 13th, 2013
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.64 KB | None | 0 0
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: /var/cvsroot/gentoo-x86/app-emulation/ganeti/ganeti-2.6.2.ebuild,v 1.3 2012/12/31 12:57:03 mgorny Exp $
  4.  
  5. EAPI="4"
  6. PYTHON_DEPEND="2:2.6"
  7.  
  8. inherit eutils confutils bash-completion-r1 python
  9.  
  10. #MY_PV="${PV/_rc/~rc}"
  11. MY_PV="${PV/_beta/~beta}"
  12. MY_P="${PN}-${MY_PV}"
  13.  
  14. if [[ ${PV} == "9999" ]] ; then
  15.         EGIT_REPO_URI="git://git.ganeti.org/ganeti.git"
  16.         inherit git-2
  17.         KEYWORDS=""
  18.         # you will need to pull in the haskell overlay for pandoc
  19.         GIT_DEPEND="app-text/pandoc
  20.                dev-python/docutils
  21.                dev-python/sphinx
  22.                media-libs/gd[fontconfig,jpeg,png,truetype]
  23.                media-gfx/graphviz
  24.                media-fonts/urw-fonts"
  25. else
  26.         SRC_URI="http://ganeti.googlecode.com/files/${MY_P}.tar.gz"
  27.         KEYWORDS="~amd64 ~x86"
  28. fi
  29.  
  30. DESCRIPTION="Ganeti is a virtual server management software tool"
  31. HOMEPAGE="http://code.google.com/p/ganeti/"
  32.  
  33. LICENSE="GPL-2"
  34. SLOT="0"
  35. IUSE="kvm xen lxc drbd +filestorage sharedstorage htools syslog ipv6
  36.        haskell-daemons rbd test"
  37. REQUIRED_USE="|| ( kvm xen lxc )"
  38.  
  39. S="${WORKDIR}/${MY_P}"
  40.  
  41. DEPEND="xen? ( >=app-emulation/xen-3.0 )
  42.        kvm? ( app-emulation/qemu )
  43.        lxc? ( app-emulation/lxc )
  44.        drbd? ( >=sys-cluster/drbd-8.3 )
  45.        rbd? ( sys-cluster/ceph )
  46.        ipv6? ( net-misc/ndisc6 )
  47.        htools? (
  48.                >=dev-lang/ghc-6.10
  49.                dev-haskell/json
  50.                dev-haskell/curl
  51.                dev-haskell/utf8-string
  52.                dev-haskell/attoparsec
  53.                dev-haskell/network
  54.                dev-haskell/parallel )
  55.        haskell-daemons? (
  56.                dev-haskell/vector
  57.                dev-haskell/regex-pcre
  58.                dev-haskell/hslogger
  59.                dev-haskell/crypto
  60.                dev-haskell/text
  61.                dev-haskell/hinotify )
  62.        dev-libs/openssl
  63.        dev-python/elementtree
  64.        dev-python/paramiko
  65.        dev-python/pyopenssl
  66.        dev-python/bitarray
  67.        dev-python/ipaddr
  68.        virtual/pyparsing
  69.        dev-python/pycurl
  70.        dev-python/pyinotify
  71.        dev-python/simplejson
  72.        net-analyzer/arping
  73.        net-analyzer/fping
  74.        net-misc/bridge-utils
  75.        net-misc/curl[ssl]
  76.        net-misc/openssh
  77.        net-misc/socat
  78.        sys-apps/iproute2
  79.        sys-fs/lvm2
  80.        >=sys-apps/baselayout-2.0
  81.        ${GIT_DEPEND}"
  82. RDEPEND="${DEPEND}
  83.        !app-emulation/ganeti-htools"
  84. DEPEND+=" test? ( || ( dev-lang/python:2.7[ipv6] dev-lang/python:2.6[ipv6] ) )"
  85.  
  86. pkg_setup () {
  87.         confutils_use_depend_all haskell-daemons htools
  88.         python_set_active_version 2
  89.         python_pkg_setup
  90. }
  91.  
  92. src_prepare() {
  93.         if [[ ${PV} == "9999" ]] ; then
  94.                 ./autogen.sh
  95.         fi
  96.         epatch "${FILESDIR}/${PN}-2.6-fix-args.patch"
  97.         epatch "${FILESDIR}/${PN}-2.6-add-pgrep.patch"
  98.  
  99.         if use !test ; then
  100.                 # Force Ganeti to use python2
  101.                 python_convert_shebangs -r 2 tools
  102.                 python_convert_shebangs 2 daemons/import-export lib/ovf.py
  103.         fi
  104. }
  105.  
  106. src_configure () {
  107.         local myconf
  108.         if use filestorage ; then
  109.                 myconf="--with-file-storage-dir=/var/lib/ganeti-storage/file"
  110.         else
  111.                 myconf="--with-file-storage-dir=no"
  112.         fi
  113.         if use sharedstorage ; then
  114.                 myconf="--with-shared-file-storage-dir=/var/lib/ganeti-storage/shared"
  115.         else
  116.                 myconf="--with-shared-file-storage-dir=no"
  117.         fi
  118.         if use kvm && [ -f /usr/bin/qemu-kvm ] ; then
  119.                 myconf="--with-kvm-path=/usr/bin/qemu-kvm"
  120.         fi
  121.         if use haskell-daemons ; then
  122.                 myconf="--enable-confd"
  123.         fi
  124.         econf --localstatedir=/var \
  125.                 --docdir=/usr/share/doc/${P} \
  126.                 --with-ssh-initscript=/etc/init.d/sshd \
  127.                 --with-export-dir=/var/lib/ganeti-storage/export \
  128.                 --with-os-search-path=/usr/share/ganeti/os \
  129.                 $(use_enable syslog) \
  130.                 $(use_enable htools) \
  131.                 $(use_enable htools htools-rapi) \
  132.                 ${myconf}
  133. }
  134.  
  135. src_install () {
  136.         emake V=1 DESTDIR="${D}" install || die "emake install failed"
  137.         newinitd "${FILESDIR}"/ganeti-2.1.initd ganeti
  138.         newconfd "${FILESDIR}"/ganeti.confd ganeti
  139.         use kvm && newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
  140.         use kvm && newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
  141.         newbashcomp doc/examples/bash_completion ganeti
  142.         dodoc INSTALL UPGRADE NEWS README doc/*.rst
  143.         dohtml -r doc/html/*
  144.         rm -rf "${D}"/usr/share/doc/ganeti
  145.         docinto examples
  146.         #dodoc doc/examples/{basic-oob,ganeti.cron,gnt-config-backup}
  147.         dodoc doc/examples/{ganeti.cron,gnt-config-backup}
  148.         docinto examples/hooks
  149.         dodoc doc/examples/hooks/{ipsec,ethers}
  150.         insinto /etc/cron.d
  151.         newins doc/examples/ganeti.cron ganeti
  152.  
  153.         # Force Ganeti to use python2
  154.         python_convert_shebangs -r 2 "${D}"/usr/sbin/
  155.         python_convert_shebangs 2 "${D}"/usr/"$(get_libdir)"/ganeti/ensure-dirs
  156.  
  157.         keepdir /var/{lib,log,run}/ganeti/
  158.         keepdir /usr/share/ganeti/os/
  159.         keepdir /var/lib/ganeti-storage/{export,file,shared}/
  160. }
  161.  
  162. src_test () {
  163.         # work around patches to make tests work
  164.         epatch "${FILESDIR}/${PN}-2.6-fix-tests.patch"
  165.         emake check || die "emake check failed"
  166. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement