vde-2.3.2-r2.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit eutils python-single-r1 user
  6. MY_P="${PN}2-${PV}"
  7. DESCRIPTION="Virtual distributed ethernet emulator for emulators like qemu, bochs, and uml"
  8. SRC_URI="mirror://sourceforge/vde/${MY_P}.tar.bz2"
  9. HOMEPAGE="http://vde.sourceforge.net/"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="amd64 ppc ~ppc64 x86"
  13. IUSE="pcap python selinux ssl static-libs"
  14. COMMON_DEPS="pcap? ( net-libs/libpcap )
  15. python? ( ${PYTHON_DEPS} )
  16. ssl? ( dev-libs/openssl )"
  17. DEPEND="${COMMON_DEPS}"
  18. RDEPEND="${COMMON_DEPS}
  19. selinux? ( sec-policy/selinux-vde )"
  20. S="${WORKDIR}/${MY_P}"
  21. pkg_setup() {
  22. # default group already used in kqemu
  23. enewgroup qemu
  24. python-single-r1_pkg_setup
  25. }
  26. src_prepare() {
  27. epatch_user
  28. }
  29. src_configure() {
  30. econf \
  31. $(use_enable pcap) \
  32. $(use_enable python) \
  33. $(use_enable ssl cryptcab) \
  34. $(use_enable static-libs static)
  35. }
  36. src_compile() {
  37. emake -j1
  38. }
  39. src_install() {
  40. default
  41. prune_libtool_files
  42. newinitd "${FILESDIR}"/vde.init vde
  43. newconfd "${FILESDIR}"/vde.conf vde
  44. }
  45. pkg_postinst() {
  46. einfo "To start vde automatically add it to the default runlevel:"
  47. einfo "# rc-update add vde default"
  48. einfo "You need to setup tap0 in /etc/conf.d/net"
  49. einfo "To use it as an user be sure to set a group in /etc/conf.d/vde"
  50. einfo "Users of the group can then run: $ vdeq qemu -sock /var/run/vde.ctl ..other opts"
  51. }