dev-qt/qttest: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sys-cluster / cluster-glue / cluster-glue-1.0.11.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 MY_P="${P/cluster-}"
7 inherit autotools eutils multilib user
8
9 DESCRIPTION="Library pack for Heartbeat / Pacemaker"
10 HOMEPAGE="http://www.linux-ha.org/wiki/Cluster_Glue"
11 SRC_URI="http://hg.linux-ha.org/glue/archive/${MY_P}.tar.bz2"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="amd64 hppa x86"
16 IUSE="doc libnet static-libs"
17
18 RDEPEND="app-arch/bzip2
19         app-text/docbook-xml-dtd:4.4
20         dev-libs/glib:2
21         dev-libs/libaio
22         libnet? ( net-libs/libnet:1.1 )
23         net-misc/curl
24         net-misc/iputils
25         || ( net-misc/netkit-telnetd net-misc/telnet-bsd )
26         dev-libs/libxml2
27         !<sys-cluster/heartbeat-3.0"
28 DEPEND="${RDEPEND}
29         doc? (
30                 dev-libs/libxslt
31                 app-text/docbook-xsl-stylesheets
32                 )"
33
34 S="${WORKDIR}/Reusable-Cluster-Components-glue--${MY_P}"
35
36 pkg_setup() {
37         enewgroup haclient
38         enewuser  hacluster -1 /dev/null /var/lib/heartbeat haclient
39 }
40
41 src_prepare() {
42         default
43         sed -e '/ -ggdb3/d' -i configure.ac || die
44         sed -e "s@http://docbook.sourceforge.net/release/xsl/current@/usr/share/sgml/docbook/xsl-stylesheets/@g" \
45                 -i doc/Makefile.am || die
46         eautoreconf
47 }
48
49 src_configure() {
50         local myopts
51
52         use doc && myopts=" --enable-doc"
53         econf \
54                 $(use_enable libnet) \
55                 $(use_enable static-libs static) \
56                 --disable-fatal-warnings \
57                 --localstatedir=/var \
58                 --with-ocf-root=/usr/$(get_libdir)/ocf \
59                 ${myopts} \
60                 --with-group-id=$(id -g hacluster) \
61                 --with-ccmuser-id=$(id -u hacluster) \
62                 --with-daemon-user=hacluster --with-daemon-group=haclient
63 }
64
65 src_install() {
66         default
67
68         dodir /var/lib/heartbeat/cores
69         dodir /var/lib/heartbeat/lrm
70
71         keepdir /var/lib/heartbeat/cores
72         keepdir /var/lib/heartbeat/lrm
73
74         # init.d file
75         cp "${FILESDIR}"/heartbeat-logd.init "${T}/" || die
76         sed -i \
77                 -e "s:%libdir%:$(get_libdir):" \
78                 "${T}/heartbeat-logd.init" || die
79 #       newinitd "${T}/heartbeat-logd.init" heartbeat-logd
80         rm "${D}"/etc/init.d/logd
81
82         use static-libs || find "${D}" -type f -name "*.la" -delete
83 }
84
85 pkg_postinst() {
86         chown -R hacluster:haclient /var/lib/heartbeat/cores
87         chown -R hacluster:haclient /var/lib/heartbeat/lrm
88 }