1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit bash-completion-r1 versionator udev
7 DESCRIPTION="mirror/replicate block-devices across a network-connection"
8 SRC_URI="http://oss.linbit.com/drbd/$(get_version_component_range 1-2 ${PV})/${P}.tar.gz"
9 HOMEPAGE="http://www.drbd.org"
13 IUSE="heartbeat pacemaker +udev xen"
17 # https://bugs.gentoo.org/show_bug.cgi?id=518774
18 "${FILESDIR}"/${P}-block-drbd.patch
24 # respect LDFLAGS, #453442
25 sed -e "s/\$(CC) -o/\$(CC) \$(LDFLAGS) -o/" \
26 -e "/\$(DESTDIR)\$(localstatedir)\/lock/d" \
27 -i user{,/legacy}/Makefile.in || die
29 sed -i -e "s:/lib/:/$(get_libdir)/:g" \
30 Makefile.in scripts/{Makefile.in,global_common.conf,drbd.conf.example} || die
31 sed -e "s:@prefix@/lib:@prefix@/$(get_libdir):" \
32 -e "s:(DESTDIR)/lib:(DESTDIR)/$(get_libdir):" \
33 -i user/{,legacy/}Makefile.in || die
34 # correct install paths (really correct this time)
35 sed -i -e "s:\$(sysconfdir)/bash_completion.d:$(get_bashcompdir):" \
36 scripts/Makefile.in || die
37 # don't participate in user survey bug 360483
38 sed -i -e '/usage-count/ s/yes/no/' scripts/drbd.conf.example || die
39 sed -i -e "s:\$(sysconfdir)/udev:$(get_udevdir):" scripts/Makefile.in || die
44 --localstatedir=/var \
50 $(use_with pacemaker) \
51 $(use_with heartbeat) \
52 --with-bashcompletion \
57 # only compile the tools
58 emake OPTFLAGS="${CFLAGS}" tools
62 # only install the tools
63 emake DESTDIR="${D}" install-tools
66 # install our own init script
67 newinitd "${FILESDIR}"/${PN}-8.0.rc ${PN}
69 dodoc scripts/drbd.conf.example
74 einfo "Please copy and gunzip the configuration file:"
75 einfo "from /usr/share/doc/${PF}/${PN}.conf.example.bz2 to /etc/${PN}.conf"
76 einfo "and edit it to your needs. Helpful commands:"
77 einfo "man 5 drbd.conf"
78 einfo "man 8 drbdsetup"
80 einfo "man 8 drbddisk"
81 einfo "man 8 drbdmeta"
84 einfo "Remember to enable drbd support in kernel."