Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/drbd/files/, sys-cluster/drbd/
Date: Sat, 08 Oct 2016 13:33:32
Message-Id: 1475933570.773afbea7f7ba364d1a2c7ea6b279192952223f9.pacho@gentoo
1 commit: 773afbea7f7ba364d1a2c7ea6b279192952223f9
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 8 13:21:04 2016 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 8 13:32:50 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=773afbea
7
8 sys-cluster/drbd: Fix block-drbd failing to start, bug #518774 by Konstantin.
9
10 Package-Manager: portage-2.3.1
11
12 sys-cluster/drbd/drbd-8.4.3-r2.ebuild | 86 ++++++++++++++++++++++
13 sys-cluster/drbd/files/drbd-8.4.3-block-drbd.patch | 20 +++++
14 2 files changed, 106 insertions(+)
15
16 diff --git a/sys-cluster/drbd/drbd-8.4.3-r2.ebuild b/sys-cluster/drbd/drbd-8.4.3-r2.ebuild
17 new file mode 100644
18 index 00000000..98cb966
19 --- /dev/null
20 +++ b/sys-cluster/drbd/drbd-8.4.3-r2.ebuild
21 @@ -0,0 +1,86 @@
22 +# Copyright 1999-2016 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Id$
25 +
26 +EAPI=6
27 +inherit bash-completion-r1 versionator udev
28 +
29 +DESCRIPTION="mirror/replicate block-devices across a network-connection"
30 +SRC_URI="http://oss.linbit.com/drbd/$(get_version_component_range 1-2 ${PV})/${P}.tar.gz"
31 +HOMEPAGE="http://www.drbd.org"
32 +
33 +LICENSE="GPL-2"
34 +KEYWORDS="~amd64 ~x86"
35 +IUSE="heartbeat pacemaker +udev xen"
36 +SLOT="0"
37 +
38 +PATCHES=(
39 + # https://bugs.gentoo.org/show_bug.cgi?id=518774
40 + "${FILESDIR}"/${P}-block-drbd.patch
41 +)
42 +
43 +src_prepare() {
44 + default
45 +
46 + # respect LDFLAGS, #453442
47 + sed -e "s/\$(CC) -o/\$(CC) \$(LDFLAGS) -o/" \
48 + -e "/\$(DESTDIR)\$(localstatedir)\/lock/d" \
49 + -i user{,/legacy}/Makefile.in || die
50 + # respect multilib
51 + sed -i -e "s:/lib/:/$(get_libdir)/:g" \
52 + Makefile.in scripts/{Makefile.in,global_common.conf,drbd.conf.example} || die
53 + sed -e "s:@prefix@/lib:@prefix@/$(get_libdir):" \
54 + -e "s:(DESTDIR)/lib:(DESTDIR)/$(get_libdir):" \
55 + -i user/{,legacy/}Makefile.in || die
56 + # correct install paths (really correct this time)
57 + sed -i -e "s:\$(sysconfdir)/bash_completion.d:$(get_bashcompdir):" \
58 + scripts/Makefile.in || die
59 + # don't participate in user survey bug 360483
60 + sed -i -e '/usage-count/ s/yes/no/' scripts/drbd.conf.example || die
61 + sed -i -e "s:\$(sysconfdir)/udev:$(get_udevdir):" scripts/Makefile.in || die
62 +}
63 +
64 +src_configure() {
65 + econf \
66 + --localstatedir=/var \
67 + --with-utils \
68 + --without-km \
69 + --without-rgmanager \
70 + $(use_with udev) \
71 + $(use_with xen) \
72 + $(use_with pacemaker) \
73 + $(use_with heartbeat) \
74 + --with-bashcompletion \
75 + --with-distro=gentoo
76 +}
77 +
78 +src_compile() {
79 + # only compile the tools
80 + emake OPTFLAGS="${CFLAGS}" tools
81 +}
82 +
83 +src_install() {
84 + # only install the tools
85 + emake DESTDIR="${D}" install-tools
86 + einstalldocs
87 +
88 + # install our own init script
89 + newinitd "${FILESDIR}"/${PN}-8.0.rc ${PN}
90 +
91 + dodoc scripts/drbd.conf.example
92 +}
93 +
94 +pkg_postinst() {
95 + einfo
96 + einfo "Please copy and gunzip the configuration file:"
97 + einfo "from /usr/share/doc/${PF}/${PN}.conf.example.bz2 to /etc/${PN}.conf"
98 + einfo "and edit it to your needs. Helpful commands:"
99 + einfo "man 5 drbd.conf"
100 + einfo "man 8 drbdsetup"
101 + einfo "man 8 drbdadm"
102 + einfo "man 8 drbddisk"
103 + einfo "man 8 drbdmeta"
104 + einfo
105 +
106 + einfo "Remember to enable drbd support in kernel."
107 +}
108
109 diff --git a/sys-cluster/drbd/files/drbd-8.4.3-block-drbd.patch b/sys-cluster/drbd/files/drbd-8.4.3-block-drbd.patch
110 new file mode 100644
111 index 00000000..408b813
112 --- /dev/null
113 +++ b/sys-cluster/drbd/files/drbd-8.4.3-block-drbd.patch
114 @@ -0,0 +1,20 @@
115 +--- a/scripts/block-drbd 2014-07-30 17:19:59.000000000 -0700
116 ++++ b/scripts/block-drbd 2014-07-31 09:54:56.000000000 -0700
117 +@@ -248,7 +248,7 @@
118 + fi
119 +
120 + case $t in
121 +- drbd)
122 ++ drbd|phy)
123 + drbd_resource=$p
124 + drbd_role="$(/sbin/drbdadm role $drbd_resource)"
125 + drbd_lrole="${drbd_role%%/*}"
126 +@@ -276,7 +276,7 @@
127 +
128 + remove)
129 + case $t in
130 +- drbd)
131 ++ drbd|phy)
132 + p=$(xenstore_read "$XENBUS_PATH/params")
133 + drbd_resource=$p
134 + drbd_role="$(/sbin/drbdadm role $drbd_resource)"