2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 PACKAGES += " libsm-common"
17 PACKAGES += " sm-common-libs"
20 RDEPENDS_sm-common-libs += " \
26 RDEPENDS_sm-eru = " sm-common-libs"
27 RDEPENDS_libsm-common = " sm-common-libs"
30 do_configure_prepend () {
34 do_compile_prepend () {
35 cd ${S}/service-mgmt/sm-common/src
36 oe_runmake -e VER=0 VER_MJR=1 \
37 INCLUDES="-I. $(pkg-config --cflags glib-2.0)" \
38 CCFLAGS="${CXXFLAGS} -fPIC" LDFLAGS="${LDFLAGS} -shared -rdynamic" \
39 EXTRACCFLAGS="${LDFLAGS}"
43 do_install_prepend () {
44 cd ${S}/service-mgmt/sm-common/src
45 oe_runmake -e DEST_DIR=${D} BIN_DIR=${bindir} UNIT_DIR=${systemd_system_unitdir} \
46 LIB_DIR=${libdir} INC_DIR=${includedir} VER=0 VER_MJR=1 install
48 cd ${S}/service-mgmt/sm-common/
49 install -d -m 755 ${D}/${systemd_system_unitdir}
50 # install -m 755 -d ${D}/${sysconfdir}/pmon.d
51 # install -m 755 -d ${D}/${sysconfdir}/init.d
53 install -m 644 -p -D scripts/sm-eru.service ${D}/${systemd_system_unitdir}/sm-eru.service
54 install -m 644 -p -D scripts/sm-watchdog.service ${D}/${systemd_system_unitdir}/sm-watchdog.service
56 install -m 640 -p -D scripts/sm-eru.conf ${D}/${sysconfdir}/pmon.d/sm-eru.conf
57 install -m 640 -p -D scripts/sm-watchdog.conf ${D}/${sysconfdir}/pmon.d/sm-watchdog.conf
58 install -m 750 -p -D scripts/sm-eru ${D}/${sysconfdir}/init.d/sm-eru
59 install -m 750 -p -D scripts/sm-watchdog ${D}/${sysconfdir}/init.d/sm-watchdog
62 FILES_libsm-common = " \
63 ${libdir}/libsm_common.so.0 \
64 ${libdir}/libsm_common.so.1 \
65 ${libdir}/libsm_common.so \
68 FILES_sm-common-libs = " \
69 var/lib/sm/watchdog/modules/libsm_watchdog_nfs.so.0 \
70 var/lib/sm/watchdog/modules/libsm_watchdog_nfs.so.1 \
75 ${bindir}/sm-eru-dump \
76 ${bindir}/sm-watchdog \
77 ${systemd_system_unitdir}/sm-eru.service \
78 ${systemd_system_unitdir}/sm-watchdog.service \
79 ${sysconfdir}/init.d/sm-eru \
80 ${sysconfdir}/pmon.d/sm-eru.conf \
81 ${sysconfdir}/init.d/sm-watchdog \
82 ${sysconfdir}/pmon.d/sm-watchdog.conf \
85 SYSTEMD_PACKAGES += "sm-eru"
86 SYSTEMD_SERVICE_sm-eru = "sm-eru.service sm-watchdog.service"
87 SYSTEMD_AUTO_ENABLE_sm-eru = "enable"