Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | SUMMARY = "The Corosync Cluster Engine and Application Programming Interfaces" |
| 2 | DESCRIPTION = "This package contains the Corosync Cluster Engine Executive, several default \ |
| 3 | APIs and libraries, default configuration files, and an init script." |
| 4 | HOMEPAGE = "http://corosync.github.io/corosync/" |
| 5 | |
| 6 | SECTION = "base" |
| 7 | |
| 8 | inherit autotools pkgconfig systemd useradd |
| 9 | |
| 10 | SRC_URI = "http://build.clusterlabs.org/corosync/releases/${BP}.tar.gz \ |
| 11 | file://corosync.conf \ |
| 12 | " |
| 13 | |
| 14 | SRC_URI[md5sum] = "69db29ff4bc035936946be44fc8be5cd" |
| 15 | SRC_URI[sha256sum] = "9bd4707bb271df16f8d543ec782eb4c35ec0330b7be696b797da4bd8f058a25d" |
| 16 | |
| 17 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.(?!99)\d+(\.\d+)+)" |
| 18 | |
| 19 | LICENSE = "BSD" |
| 20 | LIC_FILES_CHKSUM = "file://LICENSE;md5=a85eb4ce24033adb6088dd1d6ffc5e5d" |
| 21 | |
| 22 | DEPENDS = "groff-native nss libqb" |
| 23 | |
| 24 | SYSTEMD_SERVICE_${PN} = "corosync.service corosync-notifyd.service \ |
| 25 | ${@bb.utils.contains('PACKAGECONFIG', 'qdevice', 'corosync-qdevice.service', '', d)} \ |
| 26 | ${@bb.utils.contains('PACKAGECONFIG', 'qnetd', 'corosync-qnetd.service', '', d)} \ |
| 27 | " |
| 28 | SYSTEMD_AUTO_ENABLE = "disable" |
| 29 | |
| 30 | INITSCRIPT_NAME = "corosync-daemon" |
| 31 | |
| 32 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ |
| 33 | dbus qdevice qnetd snmp \ |
| 34 | " |
| 35 | |
| 36 | PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" |
| 37 | PACKAGECONFIG[qdevice] = "--enable-qdevices,--disable-qdevices" |
| 38 | PACKAGECONFIG[qnetd] = "--enable-qnetd,--disable-qnetd" |
| 39 | PACKAGECONFIG[rdma] = "--enable-rdma,--disable-rdma" |
| 40 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp" |
| 41 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemddir=${systemd_system_unitdir},--disable-systemd --without-systemddir,systemd" |
| 42 | |
| 43 | EXTRA_OECONF = "ac_cv_path_BASHPATH=${base_bindir}/bash ap_cv_cc_pie=no" |
| 44 | EXTRA_OEMAKE = "tmpfilesdir_DATA=" |
| 45 | |
| 46 | do_configure_prepend() { |
| 47 | ( cd ${S} |
| 48 | ${S}/autogen.sh ) |
| 49 | } |
| 50 | |
| 51 | do_install_append() { |
| 52 | install -D -m 0644 ${WORKDIR}/corosync.conf ${D}/${sysconfdir}/corosync/corosync.conf.example |
| 53 | install -d ${D}${sysconfdir}/sysconfig/ |
| 54 | install -m 0644 ${S}/init/corosync.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync |
| 55 | install -m 0644 ${S}/tools/corosync-notifyd.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync-notifyd |
| 56 | |
| 57 | rm -rf "${D}${localstatedir}/run" |
| 58 | |
| 59 | install -d ${D}${sysconfdir}/default/volatiles |
| 60 | echo "d root root 0755 ${localstatedir}/log/cluster none" > ${D}${sysconfdir}/default/volatiles/05_corosync |
| 61 | |
| 62 | if [ ${@bb.utils.filter('PACKAGECONFIG', 'qnetd', d)} ]; then |
| 63 | chown -R coroqnetd:coroqnetd ${D}${sysconfdir}/${BPN}/qnetd |
| 64 | echo "d coroqnetd coroqnetd 0770 /var/run/corosync-qnetd none" >> ${D}${sysconfdir}/default/volatiles/05_corosync |
| 65 | fi |
| 66 | |
| 67 | if [ ${@bb.utils.filter('DISTRO_FEATURES','systemd',d)} ]; then |
| 68 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 69 | echo "d ${localstatedir}/log/cluster - - - -" > ${D}${sysconfdir}/tmpfiles.d/corosync.conf |
| 70 | fi |
| 71 | } |
| 72 | |
| 73 | RDEPENDS_${PN} += "bash ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}" |
| 74 | |
| 75 | FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug" |
| 76 | FILES_${PN}-doc += "${datadir}/snmp/mibs/COROSYNC-MIB.txt" |
| 77 | |
| 78 | USERADD_PACKAGES = "${PN}" |
| 79 | GROUPADD_PARAM_${PN} = "--system coroqnetd" |
| 80 | USERADD_PARAM_${PN} = "--system -d / -M -s /bin/nologin -c 'User for corosync-qnetd' -g coroqnetd coroqnetd" |