Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-ha / sm.bb
1 require ha-common.inc
2 SUBPATH0 = "service-mgmt/sm"
3
4 LICENSE = "Apache-2.0"
5 LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
6
7 RDEPENDS_sm += " \
8         bash \
9         python \
10         logrotate \
11         time \
12         systemd \
13         chkconfig \
14         mtce-pmon \
15         "
16
17 DEPENDS_append = " \
18         libsm-common \
19         mtce \
20         sm-db \
21         "
22
23 EXTRA_OEMAKE = ' \
24         -e -j1 VER=0 VER_MJR=1 \
25         INCLUDES="-I.  $(pkg-config --cflags glib-2.0)" \
26         EXTRACCFLAGS="-I. $(pkg-config --cflags glib-2.0) $(pkg-config --ldflags glib-2.0) -lsqlite3" \
27         CCFLAGS="${CXXFLAGS} -std=c++11" LDFLAGS="${LDFLAGS} -rdynamic" \
28         '
29 do_install() {
30         cd ${S}/src
31         oe_runmake -e DEST_DIR=${D} BIN_DIR=${bindir} UNIT_DIR=${systemd_system_unitdir} \
32                 LIB_DIR=${libdir} INC_DIR=${includedir} VER=0 VER_MJR=1 install
33
34         cd ${S}/scripts
35         install -d ${D}/${sysconfdir}/init.d
36         install sm ${D}/${sysconfdir}/init.d/sm
37         install sm.shutdown ${D}/${sysconfdir}/init.d/sm-shutdown
38         install -d -m0755 ${D}/${sysconfdir}/pmon.d
39         install -m 644 sm.conf ${D}/${sysconfdir}/pmon.d/sm.conf
40         install -d ${D}/${sysconfdir}/logrotate.d
41         install -m 644 sm.logrotate ${D}/${sysconfdir}/logrotate.d/sm.logrotate
42         install -d -m 755 ${D}/${sbindir}
43         install sm.notify ${D}/${sbindir}/stx-ha-sm-notify
44         install sm.troubleshoot ${D}/${sbindir}/sm-troubleshoot
45         install sm.notification ${D}/${sbindir}/sm-notification
46         install -d -m0755 ${D}/${systemd_system_unitdir}
47         install -m 644 *.service ${D}/${systemd_system_unitdir}
48 }
49
50 pkg_postinst_ontarget_sm_append () {
51         /usr/bin/update-alternatives --install /usr/sbin/sm-notify sm-notify /usr/sbin/stx-ha-sm-notify 5
52 }
53
54 SYSTEMD_PACKAGES += "sm"
55 SYSTEMD_SERVICE_sm = "sm.service sm-shutdown.service"
56 SYSTEMD_AUTO_ENABLE_sm = "enable"