summaryrefslogtreecommitdiff
blob: 0e3cb6e27a3351d2ad2fbb060bc026ebc50734aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openais/openais-0.82.ebuild,v 1.3 2008/03/17 16:02:41 xmerlin Exp $

inherit eutils flag-o-matic toolchain-funcs

IUSE="debug"
DESCRIPTION="Open Application Interface Specification cluster framework"
HOMEPAGE="http://www.openais.org/"
#SRC_URI="ftp://ftp%40openais%2Eorg:downloads@openais.org/downloads/${P}/${P}.tar.gz"
SRC_URI="http://devresources.linux-foundation.org/dev/openais/downloads/${P}/${P}.tar.gz"
LICENSE="BSD public-domain"
SLOT="0"
KEYWORDS="~amd64 ~x86"
DEPEND="virtual/libc"

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/Makefile-ARCH.patch
	epatch "${FILESDIR}"/Makefile-LIBDIR.patch
	epatch "${FILESDIR}"/Makefile-install.patch
	epatch "${FILESDIR}"/Makefile.inc-FLAGS.patch
}

pkg_setup() {
	enewgroup ais
	enewuser ais -1 -1 -1 ais
}

src_compile() {
	useq debug && append-flags -O0 -ggdb -Wall -DDEBUG
	emake -j1 LIBDIR="/usr/$(get_libdir)/openais" \
		CFLAGS="${CFLAGS}" CC="$(tc-getCC)"
}

src_install() {
	emake LIBDIR="/usr/$(get_libdir)/openais" \
		DESTDIR="${D}" install || die "make install failed"

	insinto /etc/ais
	doins "${FILESDIR}"/openais.conf

	insinto /usr/include/openais/service
	doins exec/logsys.h || die

	# http://bugs.gentoo.org/show_bug.cgi?id=160847#c16
	dosym /usr/sbin/aisexec /sbin/aisexec

	dodir /etc/env.d
	echo LDPATH="/usr/$(get_libdir)/openais" > "${D}"/etc/env.d/03openais

	newinitd "${FILESDIR}"/ais.initd ais

	diropts -o ais -g ais -m 0750
	keepdir /var/log/ais

	exeinto /usr/libexec/openais
	doexe exec/openais-instantiate || die
	doexe test/{ckptbench,ckptbenchth,ckpt-rd,ckptstress,ckpt-wr,clc_cli_script} || die
	doexe test/{cpgbench,evsbench,evtbench,logsys_s,logsys_t1,logsys_t2} || die
	doexe test/{publish,subscription,testamf1,testckpt,testclm,testclm2,testcpg,testcpg2} || die
	doexe test/{testevs,testevt,testlck,testmsg,unlink} || die

	dosbin test/openais-cfgtool || die

	dodoc CHANGELOG QUICKSTART README.* SECURITY TODO conf/*
}