vde-2.2.2-r1.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils flag-o-matic user
  5. MY_P="${PN}2-${PV}"
  6. S="${WORKDIR}/${MY_P}"
  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. SLOT="0"
  11. LICENSE="GPL-2"
  12. KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
  13. # The slirpvde-buffer-overflow patch was made by Ludwig Nussel and submitted upstream at
  14. # https://sourceforge.net/tracker/?func=detail&aid=2138410&group_id=95403&atid=611248
  15. PATCHES=(
  16. "${FILESDIR}/${P}-gcc43.patch"
  17. "${FILESDIR}/${P}-slirpvde-buffer-overflow.patch"
  18. "${FILESDIR}/${P}-gcc53.patch"
  19. )
  20. src_prepare() {
  21. epatch "${PATCHES[@]}"
  22. epatch_user
  23. }
  24. src_configure() {
  25. append-cflags $(test-flags-CC -fno-strict-aliasing)
  26. econf
  27. }
  28. src_install() {
  29. emake DESTDIR="${D}" install || die "emake install failed"
  30. newinitd "${FILESDIR}"/vde.init vde
  31. newconfd "${FILESDIR}"/vde.conf vde
  32. dodoc INSTALL README
  33. }
  34. pkg_postinst() {
  35. # default group already used in kqemu
  36. enewgroup qemu
  37. einfo "To start vde automatically add it to the default runlevel:"
  38. einfo "# rc-update add vde default"
  39. einfo "You need to setup tap0 in /etc/conf.d/net"
  40. einfo "To use it as a user be sure to set a group in /etc/conf.d/vde"
  41. einfo "Users of the group can then run: $ vdeq qemu -sock /var/run/vde.ctl ..other opts"
  42. }