app-emulation/wine-vanilla: x86 stable wrt bug #717006
[gentoo.git] / sys-cluster / corosync / corosync-2.3.5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools
7
8 MY_TREE="56ae8fe"
9
10 DESCRIPTION="OSI Certified implementation of a complete cluster engine"
11 HOMEPAGE="http://www.corosync.org/"
12 SRC_URI="http://build.clusterlabs.org/corosync/releases/${P}.tar.gz"
13
14 LICENSE="BSD-2 public-domain"
15 SLOT="0"
16 KEYWORDS="amd64 hppa ppc ppc64 x86"
17 IUSE="doc infiniband static-libs systemd xml"
18
19 # TODO: support those new configure flags
20 # --enable-augeas : Install the augeas lens for corosync.conf
21 # --enable-snmp : SNMP protocol support
22 # --enable-watchdog : Watchdog support
23 RDEPEND="!sys-cluster/heartbeat
24         infiniband? (
25                 sys-fabric/libibverbs:*
26                 sys-fabric/librdmacm:*
27         )
28         dev-libs/nss
29         >=sys-cluster/libqb-0.14.4"
30 DEPEND="${RDEPEND}
31         virtual/pkgconfig
32         doc? ( sys-apps/groff )"
33
34 PATCHES=( "${FILESDIR}/${PN}-2.3.4-docs.patch" )
35
36 DOCS=( README.recovery SECURITY AUTHORS )
37
38 S="${WORKDIR}/${PN}-${PN}-${MY_TREE}"
39
40 src_prepare() {
41         default
42         eautoreconf
43 }
44
45 src_configure() {
46         default
47         # appends lib to localstatedir automatically
48         # FIXME: install just shared libs --disable-static does not work
49         econf_opts=(
50                 --localstatedir=/var \
51                 $(use_enable infiniband rdma) \
52                 $(use_enable systemd) \
53                 $(use_enable xml xmlconf)
54         )
55         use doc && econf_opts+=( --enable-doc )
56         econf "${econf_opts[@]}"
57 }
58
59 src_install() {
60         default
61         newinitd "${FILESDIR}"/${PN}.initd ${PN}
62
63         if use systemd; then
64                 rm "${D}"/lib/systemd/system/corosync-notifyd.service || die
65         else
66                 rm "${D}"/etc/init.d/corosync-notifyd || die
67         fi
68
69         insinto /etc/logrotate.d
70         newins "${FILESDIR}"/${PN}.logrotate ${PN}
71
72         keepdir /var/lib/corosync
73         use static-libs || rm -rf "${D}"/usr/$(get_libdir)/*.{,l}a || die
74
75 }
76
77 pkg_postinst() {
78         if [[ ${REPLACING_VERSIONS} < 2.0 ]]; then
79                 ewarn "!! IMPORTANT !!"
80                 ewarn " "
81                 ewarn "Migrating from a previous version of corosync can be dangerous !"
82                 ewarn " "
83                 ewarn "Make sure you backup your cluster configuration before proceeding"
84                 ewarn " "
85         fi
86 }