drbd-8.3.7.ebuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="2"
  4. inherit 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. }
  22. src_configure() {
  23. econf \
  24. --localstatedir=/var \
  25. --with-utils \
  26. --without-km \
  27. --without-rgmanager \
  28. $(use_with udev) \
  29. $(use_with xen) \
  30. $(use_with pacemaker) \
  31. $(use_with heartbeat) \
  32. $(use_with bash-completion bashcompletion) \
  33. --with-distro=gentoo
  34. }
  35. src_compile() {
  36. # only compile the tools
  37. emake OPTFLAGS="${CFLAGS}" tools || die
  38. }
  39. src_install() {
  40. # only install the tools
  41. emake DESTDIR="${D}" install-tools || die
  42. dodoc README ChangeLog || die
  43. # install our own init script
  44. newinitd "${FILESDIR}"/${PN}-8.0.rc ${PN} || die
  45. # it doesnt make sense to install a default conf in /etc,
  46. # so we put it to the docs
  47. rm -f "${D}"/etc/drbd.conf
  48. dodoc scripts/drbd.conf || die
  49. }
  50. pkg_postinst() {
  51. einfo
  52. einfo "Please copy and gunzip the configuration file"
  53. einfo "from /usr/share/doc/${PF}/drbd.conf.bz2 to /etc"
  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. elog "Or alternatively emerge sys-cluster/drbd-kernel package."
  63. }