drbd-8.3.11-r1.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils multilib versionator
  5. LICENSE="GPL-2"
  6. DESCRIPTION="mirror/replicate block-devices across a network-connection"
  7. SRC_URI="http://oss.linbit.com/drbd/$(get_version_component_range 1-2 ${PV})/${P}.tar.gz"
  8. HOMEPAGE="http://www.drbd.org"
  9. KEYWORDS="amd64 x86"
  10. IUSE="bash-completion heartbeat pacemaker +udev xen"
  11. SLOT="0"
  12. src_prepare() {
  13. epatch "${FILESDIR}/drbd-8.3.11-kernel3.patch"
  14. # respect LDFLAGS
  15. sed -i -e "s/\$(CC) -o/\$(CC) \$(LDFLAGS) -o/" user/Makefile.in || die
  16. # respect multilib
  17. sed -i -e "s:/lib/:/$(get_libdir)/:g" \
  18. scripts/{Makefile.in,global_common.conf,drbd.conf.example} || die
  19. # correct install paths
  20. sed -i -e "s:\$(sysconfdir)/bash_completion.d:/usr/share/bash-completion:" \
  21. scripts/Makefile.in || die
  22. # don't participate in user survey bug 360483
  23. sed -i -e '/usage-count/ s/yes/no/' scripts/drbd.conf.example || die
  24. }
  25. src_configure() {
  26. econf \
  27. --localstatedir=/var \
  28. --with-utils \
  29. --without-km \
  30. --without-rgmanager \
  31. $(use_with udev) \
  32. $(use_with xen) \
  33. $(use_with pacemaker) \
  34. $(use_with heartbeat) \
  35. $(use_with bash-completion bashcompletion) \
  36. --with-distro=gentoo
  37. }
  38. src_compile() {
  39. # only compile the tools
  40. emake OPTFLAGS="${CFLAGS}" tools
  41. }
  42. src_install() {
  43. # only install the tools
  44. emake DESTDIR="${D}" install-tools
  45. dodoc README ChangeLog
  46. # install our own init script
  47. newinitd "${FILESDIR}"/${PN}-8.0.rc ${PN}
  48. dodoc scripts/drbd.conf.example
  49. }
  50. pkg_postinst() {
  51. einfo
  52. einfo "Please copy and gunzip the configuration file:"
  53. einfo "from /usr/share/doc/${PF}/${PN}.conf.example.bz2 to /etc/${PN}.conf"
  54. einfo "and edit it to your needs. Helpful commands:"
  55. einfo "man 5 drbd.conf"
  56. einfo "man 8 drbdsetup"
  57. einfo "man 8 drbdadm"
  58. einfo "man 8 drbddisk"
  59. einfo "man 8 drbdmeta"
  60. einfo
  61. elog "Remember to enable drbd support in kernel."
  62. }