b8e992339c62d651b86baddac9547ccb1f05978e
[pti/rtp.git] / meta-stx / recipes-core / stx-ha / sm-db.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-db"
17
18 DEPENDS =+ "sqlite3-native"
19
20 do_configure_append () {
21         :
22
23
24 do_compile_append () {
25         cd ${S}/service-mgmt/sm-db
26         sqlite3 database/sm.db < database/create_sm_db.sql
27         sqlite3 database/sm.hb.db < database/create_sm_hb_db.sql
28
29         oe_runmake -e VER=0 VER_MJR=1 \
30                 INCLUDES="-I. -I${S}/service-mgmt/sm-common/src " \
31                 CCFLAGS="${CXXFLAGS} -fPIC" \
32                 LDFLAGS="${LDFLAGS} -shared -rdynamic -L${S}/service-mgmt/sm-common/src " \
33                 EXTRACCFLAGS="-D_TEST__AA__BB ${LDFLAGS} -L${S}/service-mgmt/sm-common/src "
34 }
35
36 do_install_append () {
37         cd ${S}/service-mgmt/sm-db
38         oe_runmake -e DEST_DIR=${D} BIN_DIR=${bindir} UNIT_DIR=${systemd_system_unitdir} \
39                         LIB_DIR=${libdir} INC_DIR=${includedir} VER=0 VER_MJR=1 install
40 }
41
42 FILES_sm-db = " \
43         ${bindir}/sm_db_build \
44         ${libdir}/libsm_db.so.1 \
45         ${libdir}/libsm_db.so.0 \
46         ${localstatedir}/lib/sm \
47         "