Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-core / stx-fault / fm-common.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 += " fm-common"
17 RDEPENDS_fm-common = " python"
18
19 do_configure_append () {
20         cd ${S}/fm-common/sources
21
22         # fix the hardcoded path
23         sed -i -e 's|/usr/local/bin|${bindir}|' fmConstants.h
24
25         distutils_do_configure
26
27
28 do_compile_append() {
29         cd ${S}/fm-common/sources
30         oe_runmake -e BINDIR=${bindir} \
31                         INCLUDES="-I./ " \
32                         EXTRACCFLAGS=" " \
33                         CCFLAGS="${CXXFLAGS} ${CCSHARED}" \
34                         LIBDIR=${libdir} INCDIR=${includedir} \
35                         CGCS_DOC_DEPLOY=${cgcs_doc_deploy}
36         distutils_do_compile
37 }
38
39 do_install_append() {
40         cd ${S}/fm-common/sources
41         oe_runmake -e DESTDIR=${D} BINDIR=${bindir} \
42                 LIBDIR=${libdir} INCDIR=${includedir} \
43                 CGCS_DOC_DEPLOY=${cgcs_doc_deploy} install
44         distutils_do_install
45 }
46
47
48 FILES_fm-common = " \
49         ${cgcs_doc_deploy}/fmAlarm.h \
50         ${bindir}/fm_db_sync_event_suppression.py \
51         ${bindir}/fmClientCli \
52         ${libdir}/python2.7/site-packages/fm_core*.egg-info \
53         ${libdir}/python2.7/site-packages/fm_core.so \
54         ${libdir}/libfmcommon.so.1.0 \
55         ${libdir}/libfmcommon.so.1 \
56         ${includedir}/fmConfig.h \
57         ${includedir}/fmLog.h \
58         ${includedir}/fmThread.h \
59         ${includedir}/fmDbAPI.h \
60         ${includedir}/fmAPI.h \
61         ${includedir}/fmAlarm.h \
62         "