summaryrefslogtreecommitdiff
blob: a38c1c731554f3b3e1a89a5fdb10c4a49660d6ef (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
69
70
71
72
73
74
75
76
77
78
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/ocfs2-tools/ocfs2-tools-1.2.1.ebuild,v 1.4 2009/07/12 18:24:49 halcy0n Exp $

PV_MAJOR="${PV%%.*}"
PV_MINOR="${PV#*.}"
PV_MINOR="${PV_MINOR%%.*}"
DESCRIPTION="Support programs for the Oracle Cluster Filesystem 2"
HOMEPAGE="http://oss.oracle.com/projects/ocfs2-tools/"
SRC_URI="http://oss.oracle.com/projects/ocfs2-tools/dist/files/source/v${PV_MAJOR}.${PV_MINOR}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="X"
# (#142216) build system's broke, always requires glib for debugfs utility
RDEPEND="X? (
		=x11-libs/gtk+-2*
		>=dev-lang/python-2
		>=dev-python/pygtk-2
	)
	>=dev-libs/glib-2.2.3
	sys-fs/e2fsprogs"
DEPEND="${RDEPEND}"

src_compile() {
	local myconf="--enable-dynamic-fsck --enable-dynamic-ctl"

	econf --prefix=${ROOT} \
		$(use_enable X ocfs2console) \
		${myconf} \
		|| die "Failed to configure"

	emake -j1 || die "Failed to compile"
}

src_install() {
	make DESTDIR="${D}" install || die "Failed to install"

	doman \
		mkfs.ocfs2/mkfs.ocfs2.8 \
		ocfs2cdsl/ocfs2cdsl.8 \
		ocfs2console/ocfs2console.8 \
		ocfs2_hb_ctl/ocfs2_hb_ctl.8 \
		tunefs.ocfs2/tunefs.ocfs2.8
	dodoc \
		COPYING CREDITS MAINTAINERS README README.O2CB debugfs.ocfs2/README \
		documentation/users_guide.txt documentation/samples/cluster.conf \
		"${FILESDIR}"/INSTALL.GENTOO

	# Keep o2cb script in case someone needs it
	insinto /usr/sbin
	newins "${S}"/vendor/common/o2cb.init o2cb
	insinto /etc/default
	newins "${S}"/vendor/common/o2cb.sysconfig o2cb

	# Move programs not needed before /usr is mounted to /usr/sbin/
	mv "${D}"/sbin/ocfs2cdsl "${D}"/usr/sbin/
	mv "${D}"/sbin/ocfs2console "${D}"/usr/sbin/

	newinitd "${FILESDIR}"/ocfs2.init ocfs2
	newconfd "${FILESDIR}"/ocfs2.conf ocfs2

	insinto /etc/ocfs2
	newins "${S}"/documentation/samples/cluster.conf cluster.conf

	keepdir /config
	keepdir /dlm

	# FIXME - fix the python lib.
	# pythonians wouldn't like this probably, but I couldn't find better
	# solution.
	mv "${D}"/lib "${D}"/usr
}

pkg_postinst() {
	elog "Read INSTALL.GENTOO in ${ROOT}usr/share/doc/${P}/ for instructions"
	elog "about how to install, configure and run ocfs2."
}