aboutsummaryrefslogtreecommitdiffstats
path: root/meta-cgl-common/recipes-cgl/ocfs2-tools/ocfs2-tools_1.8.4.bb
blob: 9098fbf67a5bb2a3ad81436f337ea20e964d401b (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
SUMMARY = "Tools for managing the Ocfs2 cluster file system"
DESCRIPTION = "Programs to manage the Ocfs2 cluster file system, including mkfs.ocfs2, \
tunefs.ocfs2 and fsck.ocfs2.\
Ocfs2 is a general purpose extent based shared disk cluster file \
system. It supports 64 bit inode numbers, and has automatically \
extending metadata groups which may also make it attractive for \
non-clustered use. Ocfs2 leverages some well tested kernel \
technologies, such as JBD - the same journaling subsystem in use by \
ext3."
HOMEPAGE = "http://oss.oracle.com/projects/ocfs2-tools/"
SECTION = "System Environment/Base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"

SRC_URI = "git://oss.oracle.com/git/ocfs2-tools.git \
    file://0003-vendor-common-o2cb.ocf-add-new-conf-file.patch \
    file://disable-ocfs2-stack-user-support.patch \
    file://ocfs2-fix-compile-error-when-glibc-upgrade.patch \
    file://o2cb.service \
    file://ocfs2.service \
"
SRCREV = "0b8be47d61dbdcd08d21c83f0b3993735b884ef9"
S = "${WORKDIR}/git"

inherit autotools-brokensep pkgconfig systemd

DEPENDS = "corosync cluster-glue openais pacemaker \
    libxml2 linux-libc-headers libaio \
    e2fsprogs e2fsprogs-native \
"
RDEPENDS_${PN} = "bash coreutils net-tools module-init-tools e2fsprogs chkconfig glib-2.0"

ASNEEDED_pn-${PN} = ""
PARALLEL_MAKE = ""
INSANE_SKIP_${PN} = "unsafe-references-in-binaries"
CFLAGS_append += "-DGLIB_COMPILATION"
CPPFLAGS_append += "-DGLIB_COMPILATION"

EXTRA_OECONF = " \
    --enable-ocfs2console=no \
    --enable-dynamic-fsck=yes \
    --enable-dynamic-ctl=yes \
"

do_configure_prepend () {
        # fix here or EXTRA_OECONF
        sed -i -e '/^PYTHON_INCLUDES="-I/c\
PYTHON_INCLUDES="-I=/usr/include/python${PYTHON_BASEVERSION}"' \
                ${S}/pythondev.m4
        sed -i  -e 's:PYTHON_PREFIX/lib/python:PYTHON_PREFIX/${baselib}/python:' \
            -e 's:PYTHON_EXEC_PREFIX}/lib/python:PYTHON_EXEC_PREFIX}/${baselib}/python:' \
                ${S}/python.m4

        # fix the AIS_TRY_PATH which will search corosync|openais
        # AIS_TRY_PATH=":/usr/lib64/:/usr/lib:/usr/local/lib64:/usr/local/lib"
        sed -i -e '/^AIS_TRY_PATH=":\/usr\/lib64:/s;:;:=;g' ${S}/configure.in
}


do_compile_prepend() {
    for m in `find . -name "Makefile"` ; do
        sed -i -e "s@-I/usr/include@-I${STAGING_DIR_TARGET}/usr/include@g" $m
    done
}

SYSTEMD_SERVICE_${PN} = "o2cb.service ocfs2.service"
SYSTEMD_AUTO_ENABLE = "disable"

do_install_append() {
    install -d ${D}${sysconfdir}/init.d
    install -m 0755 ${S}/vendor/common/o2cb.init ${D}${sysconfdir}/init.d/o2cb
    install -m 0755 ${S}/vendor/common/ocfs2.init ${D}${sysconfdir}/init.d/ocfs2

    install -d ${D}${sysconfdir}/sysconfig
    install -m 0644 ${S}/vendor/common/o2cb.sysconfig ${D}${sysconfdir}/sysconfig/o2cb

    install -d ${D}${sysconfdir}/udev/rules.d
    install -m 0644 ${S}/vendor/common/51-ocfs2.rules ${D}${sysconfdir}/udev/rules.d/51-ocfs2.rules

    install -d ${D}/${libdir}/ocf/resource.d/ocfs2
    install  -m 0755 ${S}/vendor/common/o2cb.ocf ${D}/${libdir}/ocf/resource.d/ocfs2/o2cb
    chmod 644 ${D}/${libdir}/*.a

    install -dm 0755  ${D}${sysconfdir}/ocfs2
    install -m 0644 ${S}/documentation/samples/cluster.conf ${D}${sysconfdir}/ocfs2/cluster.conf.sample

    rm -rf ${D}/${libdir}/ocf
    rm -rf ${D}/sbin/ocfs2_controld.pcmk
    rm -rf ${D}/sbin/ocfs2_controld.cman

    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
        install -d ${D}/${systemd_system_unitdir}
        install -m 0644 ${WORKDIR}/o2cb.service ${D}/${systemd_system_unitdir}
        sed -i -e 's,@LIBDIR@,${libexecdir},' ${D}${systemd_system_unitdir}/o2cb.service

        install -m 0644 ${WORKDIR}/ocfs2.service ${D}/${systemd_system_unitdir}
        sed -i -e 's,@LIBDIR@,${libexecdir},' ${D}${systemd_system_unitdir}/ocfs2.service

        install -d ${D}/${libexecdir}
        install -m 0755 ${S}/vendor/common/o2cb.init ${D}/${libexecdir}/o2cb-helper
        install -m 0755 ${S}/vendor/common/ocfs2.init ${D}${libexecdir}/ocfs2-helper
    fi
}