qemu-guest-agent-2.5.0.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Copyright 1999-2015 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 systemd udev python-any-r1
  6. MY_PN="qemu"
  7. MY_P="${MY_PN}-${PV}"
  8. if [[ ${PV} == *9999* ]]; then
  9. EGIT_REPO_URI="git://git.qemu.org/qemu.git"
  10. inherit git-2
  11. else
  12. SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.bz2"
  13. KEYWORDS="amd64 ~ppc ~ppc64 x86 ~x86-fbsd"
  14. fi
  15. DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
  16. HOMEPAGE="http://wiki.qemu.org/Features/QAPI/GuestAgent"
  17. LICENSE="GPL-2 BSD-2"
  18. SLOT="0"
  19. IUSE=""
  20. RDEPEND=">=dev-libs/glib-2.22
  21. !<app-emulation/qemu-1.1.1-r1
  22. !<sys-apps/sysvinit-2.88-r5"
  23. DEPEND="${RDEPEND}
  24. ${PYTHON_DEPS}"
  25. S="${WORKDIR}/${MY_P}"
  26. src_prepare() {
  27. epatch "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch #580924
  28. epatch_user
  29. }
  30. src_configure() {
  31. tc-export AR LD OBJCOPY
  32. local myconf=(
  33. --prefix=/usr
  34. --sysconfdir=/etc
  35. --libdir="/usr/$(get_libdir)"
  36. --localstatedir=/
  37. --disable-bsd-user
  38. --disable-linux-user
  39. --disable-system
  40. --disable-strip
  41. --disable-werror
  42. --enable-guest-agent
  43. --python="${PYTHON}"
  44. --cc="$(tc-getCC)"
  45. --cxx="$(tc-getCXX)"
  46. --host-cc="$(tc-getBUILD_CC)"
  47. )
  48. echo "./configure ${myconf[*]}"
  49. ./configure "${myconf[@]}" || die
  50. }
  51. src_compile() {
  52. emake V=1 qemu-ga
  53. }
  54. src_install() {
  55. dobin qemu-ga
  56. # Normal init stuff
  57. newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
  58. newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
  59. insinto /etc/logrotate.d
  60. newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent
  61. # systemd stuff
  62. udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules
  63. systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \
  64. qemu-guest-agent.service
  65. }
  66. pkg_postinst() {
  67. elog "You should add 'qemu-guest-agent' to the default runlevel."
  68. elog "e.g. rc-update add qemu-guest-agent default"
  69. }