drbd-8.3.10.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="2"
  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. # respect LDFLAGS
  14. sed -i -e "s/\$(CC) -o/\$(CC) \$(LDFLAGS) -o/" user/Makefile.in || die
  15. # respect multilib
  16. sed -i -e "s:/lib/:/$(get_libdir)/:g" \
  17. scripts/{Makefile.in,global_common.conf,drbd.conf.example} || die
  18. # correct install paths
  19. sed -i -e "s:\$(sysconfdir)/bash_completion.d:/usr/share/bash-completion:" \
  20. scripts/Makefile.in || die
  21. # don't participate in user survey bug 360483
  22. sed -i -e '/usage-count/ s/yes/no/' scripts/drbd.conf.example || die
  23. }
  24. src_configure() {
  25. econf \
  26. --localstatedir=/var \
  27. --with-utils \
  28. --without-km \
  29. --without-rgmanager \
  30. $(use_with udev) \
  31. $(use_with xen) \
  32. $(use_with pacemaker) \
  33. $(use_with heartbeat) \
  34. $(use_with bash-completion bashcompletion) \
  35. --with-distro=gentoo
  36. }
  37. src_compile() {
  38. # only compile the tools
  39. emake OPTFLAGS="${CFLAGS}" tools || die
  40. }
  41. src_install() {
  42. # only install the tools
  43. emake DESTDIR="${D}" install-tools || die
  44. dodoc README ChangeLog || die
  45. # install our own init script
  46. newinitd "${FILESDIR}"/${PN}-8.0.rc ${PN} || die
  47. dodoc scripts/drbd.conf.example || die
  48. }
  49. pkg_postinst() {
  50. einfo
  51. einfo "Please copy and gunzip the configuration file:"
  52. einfo "from /usr/share/doc/${PF}/${PN}.conf.example.bz2 to /etc/${PN}.conf"
  53. einfo "and edit it to your needs. Helpful commands:"
  54. einfo "man 5 drbd.conf"
  55. einfo "man 8 drbdsetup"
  56. einfo "man 8 drbdadm"
  57. einfo "man 8 drbddisk"
  58. einfo "man 8 drbdmeta"
  59. einfo
  60. elog "Remember to enable drbd support in kernel."
  61. }