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 () {
31 cd ${S}/service-mgmt/sm-common/src
35 do_compile_prepend () {
36 cd ${S}/service-mgmt/sm-common/src
37 oe_runmake -e VER=0 VER_MJR=1 \
38 INCLUDES="-I. $(pkg-config --cflags glib-2.0)" \
39 CCFLAGS="${CXXFLAGS} -fPIC" LDFLAGS="${LDFLAGS} -shared -rdynamic" \
40 EXTRACCFLAGS="${LDFLAGS}"
44 do_install_prepend () {
45 cd ${S}/service-mgmt/sm-common/src
46 oe_runmake -e DEST_DIR=${D} BIN_DIR=${bindir} UNIT_DIR=${systemd_system_unitdir} \
47 LIB_DIR=${libdir} INC_DIR=${includedir} VER=0 VER_MJR=1 install
49 cd ${S}/service-mgmt/sm-common/
50 install -d -m 755 ${D}/${systemd_system_unitdir}
51 install -m 644 -p -D scripts/sm-eru.service ${D}/${systemd_system_unitdir}/sm-eru.service
52 install -m 644 -p -D scripts/sm-watchdog.service ${D}/${systemd_system_unitdir}/sm-watchdog.service
54 install -m 640 -p -D scripts/sm-eru.conf ${D}/${sysconfdir}/pmon.d/sm-eru.conf
55 install -m 640 -p -D scripts/sm-watchdog.conf ${D}/${sysconfdir}/pmon.d/sm-watchdog.conf
56 install -m 750 -p -D scripts/sm-eru ${D}/${sysconfdir}/init.d/sm-eru
57 install -m 750 -p -D scripts/sm-watchdog ${D}/${sysconfdir}/init.d/sm-watchdog
60 FILES_libsm-common = " \
61 ${libdir}/libsm_common.so.0 \
62 ${libdir}/libsm_common.so.1 \
63 ${libdir}/libsm_common.so \
66 FILES_sm-common-libs = " \
67 var/lib/sm/watchdog/modules/libsm_watchdog_nfs.so.0 \
68 var/lib/sm/watchdog/modules/libsm_watchdog_nfs.so.1 \
73 ${bindir}/sm-eru-dump \
74 ${bindir}/sm-watchdog \
75 ${systemd_system_unitdir}/sm-eru.service \
76 ${systemd_system_unitdir}/sm-watchdog.service \
77 ${sysconfdir}/init.d/sm-eru \
78 ${sysconfdir}/pmon.d/sm-eru.conf \
79 ${sysconfdir}/init.d/sm-watchdog \
80 ${sysconfdir}/pmon.d/sm-watchdog.conf \
83 SYSTEMD_PACKAGES += "sm-eru"
84 SYSTEMD_SERVICE_sm-eru = "sm-eru.service sm-watchdog.service"
85 SYSTEMD_AUTO_ENABLE_sm-eru = "enable"