drbd-8.4.3.ebuild 2.2 KB

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