drbd-8.4.0.ebuild 2.1 KB

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