www-client/google-chrome-beta: automated update (84.0.4147.30)
[gentoo.git] / sys-cluster / drbd-utils / drbd-utils-8.9.6.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit bash-completion-r1 eutils multilib udev versionator
7
8 LICENSE="GPL-2"
9
10 DESCRIPTION="mirror/replicate block-devices across a network-connection"
11 SRC_URI="http://oss.linbit.com/drbd/${P/_/}.tar.gz"
12 HOMEPAGE="http://www.drbd.org"
13
14 KEYWORDS="~amd64 ~x86"
15 IUSE="heartbeat pacemaker +udev xen"
16 SLOT="0"
17
18 DEPEND="heartbeat? ( sys-cluster/heartbeat )
19         pacemaker? ( sys-cluster/pacemaker )
20         udev? ( virtual/udev )
21         !!sys-cluster/drbd"
22 RDEPEND="${DEPEND}"
23
24 S="${WORKDIR}/${P/_/}"
25
26 src_prepare() {
27         # respect LDFLAGS, #453442
28         sed -e "s/\$(CC) -o/\$(CC) \$(LDFLAGS) -o/" \
29                 -e "/\$(DESTDIR)\$(localstatedir)\/lock/d" \
30                 -i user/*/Makefile.in || die
31
32         # respect multilib
33         sed -i -e "s:/lib/:/$(get_libdir)/:g" \
34                 Makefile.in scripts/{Makefile.in,global_common.conf,drbd.conf.example} || die
35         sed -e "s:@prefix@/lib:@prefix@/$(get_libdir):" \
36                 -e "s:(DESTDIR)/lib:(DESTDIR)/$(get_libdir):" \
37                 -i user/*/Makefile.in || die
38
39         # correct install paths (really correct this time)
40         sed -i -e "s:\$(sysconfdir)/bash_completion.d:$(get_bashcompdir):" \
41                 scripts/Makefile.in || die
42
43         # don't participate in user survey bug 360483
44         sed -i -e '/usage-count/ s/yes/no/' scripts/global_common.conf || die
45         sed -i -e "s:\$(sysconfdir)/udev:$(get_udevdir):" scripts/Makefile.in || die
46
47         epatch "${FILESDIR}"/run-lock.patch
48
49         autoreconf
50 }
51
52 src_configure() {
53         econf \
54                 --localstatedir=/var \
55                 --without-rgmanager \
56                 $(use_with udev) \
57                 $(use_with xen) \
58                 $(use_with pacemaker) \
59                 $(use_with heartbeat) \
60                 --with-bashcompletion \
61                 --with-distro=gentoo
62 }
63
64 src_compile() {
65         # only compile the tools
66         emake OPTFLAGS="${CFLAGS}" tools
67 }
68
69 src_install() {
70         # only install the tools
71         emake DESTDIR="${D}" install-tools install-doc
72         dodoc README ChangeLog
73
74         # install our own init script
75         newinitd "${FILESDIR}"/${PN}-8.0.rc ${PN/-utils/}
76
77         dodoc scripts/drbd.conf.example
78
79         dosym /usr/sbin/drbdadm /sbin/drbdadm
80 }
81
82 pkg_postinst() {
83         einfo
84         einfo "Please copy and gunzip the configuration file:"
85         einfo "from /usr/share/doc/${PF}/${PN/-utils/}.conf.example.bz2 to /etc/${PN/-utils/}.conf"
86         einfo "and edit it to your needs. Helpful commands:"
87         einfo "man 5 drbd.conf"
88         einfo "man 8 drbdsetup"
89         einfo "man 8 drbdadm"
90         einfo "man 8 drbddisk"
91         einfo "man 8 drbdmeta"
92         einfo
93         elog "Remember to enable drbd support in kernel."
94 }