vde-2.3.2-r3.ebuild 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2016 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 libressl static-libs"
  14. COMMON_DEPS="pcap? ( net-libs/libpcap )
  15. python? ( ${PYTHON_DEPS} )
  16. ssl? (
  17. !libressl? ( dev-libs/openssl:0= )
  18. libressl? ( dev-libs/libressl:0= )
  19. )"
  20. DEPEND="${COMMON_DEPS}"
  21. RDEPEND="${COMMON_DEPS}
  22. selinux? ( sec-policy/selinux-vde )"
  23. S="${WORKDIR}/${MY_P}"
  24. pkg_setup() {
  25. # default group already used in kqemu
  26. enewgroup qemu
  27. python-single-r1_pkg_setup
  28. }
  29. src_prepare() {
  30. epatch_user
  31. }
  32. src_configure() {
  33. econf \
  34. $(use_enable pcap) \
  35. $(use_enable python) \
  36. $(use_enable ssl cryptcab) \
  37. $(use_enable static-libs static)
  38. }
  39. src_compile() {
  40. emake -j1
  41. }
  42. src_install() {
  43. default
  44. prune_libtool_files
  45. newinitd "${FILESDIR}"/vde.init vde
  46. newconfd "${FILESDIR}"/vde.conf vde
  47. }
  48. pkg_postinst() {
  49. einfo "To start vde automatically add it to the default runlevel:"
  50. einfo "# rc-update add vde default"
  51. einfo "You need to setup tap0 in /etc/conf.d/net"
  52. einfo "To use it as an user be sure to set a group in /etc/conf.d/vde"
  53. einfo "Users of the group can then run: $ vdeq qemu -sock /var/run/vde.ctl ..other opts"
  54. }