Add debian package for service-mgmt/sm-db

Add debian packaging infrastructure for service-mgmt/sm-db
to build a debian package.

Story: 2009101
Task: 43700

Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: I88004efa3755c6af008d7fb0707388d4c8c824e8
This commit is contained in:
Leonardo Fagundes Luz Serrano 2021-10-20 13:40:45 +00:00
parent aa546e8705
commit b091500aa8
12 changed files with 131 additions and 1 deletions

View File

@ -0,0 +1,5 @@
sm-db (1.0.0-1) unstable; urgency=medium
* Initial release.
-- Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com> Tue, 21 Sep 2021 19:52:46 +0000

View File

@ -0,0 +1 @@
10

View File

@ -0,0 +1,25 @@
Source: sm-db
Section: admin
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper (>= 13),
sm-common-dev,
libglib2.0-dev,
libsqlite3-dev,
uuid-dev,
sqlite3
Standards-Version: 4.1.2
Homepage: https://www.starlingx.io
Package: sm-db
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Service Management Databases
This package handles the Service Management Databases
Package: sm-db-dev
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, sm-db
Description: Service Management Databases - Development files
This package contains symbolic links, header files,
and related items necessary for software development.

View File

@ -0,0 +1,44 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: sm-db
Upstream-Contact: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Source: https://opendev.org/starlingx/ha
Files: *
Copyright:
(c) 2013-2021 Wind River Systems, Inc
(c) Others (See individual files for more details)
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2021 Wind River Systems, Inc
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.

View File

@ -0,0 +1,26 @@
#!/usr/bin/make -f
export ROOT = $(CURDIR)/debian/tmp
export VER = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
export VER_MJR = $(shell echo $(VER) | cut -d. -f1)
%:
dh $@
override_dh_auto_build:
sqlite3 database/sm.db < database/create_sm_db.sql
sqlite3 database/sm.hb.db < database/create_sm_hb_db.sql
dh_auto_build
override_dh_auto_install:
rm -rf ${ROOT}
$(MAKE) DEST_DIR=${ROOT} \
VER=$(VER) \
VER_MJR=$(VER_MJR) \
install
# Prevents dh_fixperms from changing the permissions defined in the makefiles
override_dh_fixperms:
dh_fixperms \
-Xlibsm_db.so.*

View File

@ -0,0 +1,2 @@
usr/lib64/libsm_db.so
usr/include/*.h

View File

@ -0,0 +1,6 @@
usr/lib64/libsm_db.so.*
var/lib/sm/patches/sm-patch.sql
# Marked on centos .spec file as "%config(noreplace)"
var/lib/sm/sm.hb.db
var/lib/sm/sm.db

View File

@ -0,0 +1 @@
shared-library-is-executable

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -x
PKG_BUILD_NAME=$1
PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME})
STX_BASE=$(realpath ${MY_REPO}/stx)
SRC=$(realpath ${STX_BASE}/ha/service-mgmt/sm-db)
mkdir ${PKG_BUILD_NAME}
pushd ${PKG_BUILD_NAME}
cp -pr ${SRC}/{src,database,Makefile} ${PKG_BUILD_ROOT}/

View File

@ -0,0 +1,7 @@
---
debname: sm-db
debver: 1.0.0-1
dl_hook: dl_hook
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true

View File

@ -5,6 +5,7 @@
#
INCLUDES =-I$(STAGING_DIR)/usr/include/glib-2.0
INCLUDES+=-I$(STAGING_DIR)/usr/lib64/glib-2.0/include
INCLUDES+=-I$(STAGING_DIR)/usr/lib/x86_64-linux-gnu/glib-2.0/include
SRCS=sm_db.c
SRCS+=sm_db_iterator.c
@ -28,7 +29,7 @@ SRCS+=sm_db_build.c
SRCS+=sm_db_configuration.c
OBJS = $(SRCS:.c=.o)
CCFLAGS= -fPIC -g -O2 -Wall -Werror -std=c++11 -Wformat -Wformat-security
CCFLAGS= -fPIC -g -O2 -Wall -Werror -std=c++11 -Wformat -Wformat-security -Wno-stringop-truncation
EXTRACCFLAGS= -D__STDC_FORMAT_MACROS
LDLIBS= -lsqlite3 -lglib-2.0 -luuid -lrt -lsm_common
LDFLAGS = -shared -rdynamic