Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-core / stx-ha / sm-api.inc
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
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
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15
16 PACKAGES += " sm-api"
17
18 RDEPENDS_sm-api += " \
19         bash \
20         python-six \
21         chkconfig \
22         mtce-pmon \
23         "
24
25 do_configure_append () {
26         cd ${S}/service-mgmt-api/sm-api
27         distutils_do_configure
28
29
30 do_compile_append () {
31         cd ${S}/service-mgmt-api/sm-api
32         distutils_do_compile
33 }
34
35 do_install_append () {
36         cd ${S}/service-mgmt-api/sm-api
37         distutils_do_install
38         install -d -m 0755 ${D}/${sysconfdir}/sm
39         install -d -m 0755 ${D}/${sysconfdir}/init.d
40         install -d -m 0755 ${D}/${sysconfdir}/pmon.d
41         install -d -m 0755 ${D}/${sysconfdir}/sm-api
42         install -d -m 0755 ${D}/${systemd_system_unitdir}
43         install -m 644 scripts/sm_api.ini ${D}/${sysconfdir}/sm
44         install -m 755 scripts/sm-api ${D}/${sysconfdir}/init.d
45         install -m 644 scripts/sm-api.service ${D}/${systemd_system_unitdir}
46         install -m 644 scripts/sm-api.conf ${D}/${sysconfdir}/pmon.d
47         install -m 644 etc/sm-api/policy.json ${D}/${sysconfdir}/sm-api
48 }
49
50 FILES_sm-api = " \
51         ${libdir}/python2.7/site-packages/sm_api*.egg-info/ \
52         ${libdir}/python2.7/site-packages/sm_api/ \
53         ${systemd_system_unitdir}/sm-api.service \
54         ${sysconfdir}/init.d/sm-api \
55         ${sysconfdir}/pmon.d/sm-api.conf \
56         ${sysconfdir}/sm/sm_api.ini \
57         ${sysconfdir}/sm-api/policy.json \
58         ${bindir}/sm-api \
59         "
60
61 SYSTEMD_PACKAGES += "sm-api"
62 SYSTEMD_SERVICE_sm-api = "sm-api.service"
63 SYSTEMD_AUTO_ENABLE_sm-api = "enable"