Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions 0001-disable-warning-as-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 1c87ef9a7b50063836f7dbb51455045d3d45a6ff Mon Sep 17 00:00:00 2001
From: Mingyuan Qi <[email protected]>
Date: Fri, 28 Sep 2018 23:09:18 +0800
Subject: [PATCH 1/2] disable warning as error

---
service-mgmt/sm-db-1.0.0/src/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/service-mgmt/sm-db-1.0.0/src/Makefile b/service-mgmt/sm-db-1.0.0/src/Makefile
index c6be42f..2989294 100644
--- a/service-mgmt/sm-db-1.0.0/src/Makefile
+++ b/service-mgmt/sm-db-1.0.0/src/Makefile
@@ -28,7 +28,7 @@ SRCS+=sm_db_build.c
SRCS+=sm_db_configuration.c

OBJS = $(SRCS:.c=.o)
-CCFLAGS= -fPIC -g -O2 -Wall -Werror -std=c++11
+CCFLAGS= -fPIC -g -O2 -Wall -std=c++11
EXTRACCFLAGS= -D__STDC_FORMAT_MACROS
LDLIBS= -lsqlite3 -lglib-2.0 -luuid -lrt -lsm_common
LDFLAGS = -shared -rdynamic
--
2.19.0

25 changes: 25 additions & 0 deletions 0002-reorder-LDLIBS.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From c852095748cf001ae6e3e5fb049c9957afe23165 Mon Sep 17 00:00:00 2001
From: Mingyuan Qi <[email protected]>
Date: Fri, 28 Sep 2018 23:09:18 +0800
Subject: [PATCH 2/2] reorder LDLIBS

---
service-mgmt/sm-db-1.0.0/src/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/service-mgmt/sm-db-1.0.0/src/Makefile b/service-mgmt/sm-db-1.0.0/src/Makefile
index 2989294..9bcb036 100644
--- a/service-mgmt/sm-db-1.0.0/src/Makefile
+++ b/service-mgmt/sm-db-1.0.0/src/Makefile
@@ -30,7 +30,7 @@ SRCS+=sm_db_configuration.c
OBJS = $(SRCS:.c=.o)
CCFLAGS= -fPIC -g -O2 -Wall -std=c++11
EXTRACCFLAGS= -D__STDC_FORMAT_MACROS
-LDLIBS= -lsqlite3 -lglib-2.0 -luuid -lrt -lsm_common
+LDLIBS= -lsm_common -lsqlite3 -lglib-2.0 -luuid -lrt
LDFLAGS = -shared -rdynamic

build: libsm_db.so sm_db_build
--
2.19.0

48 changes: 48 additions & 0 deletions 0003-fix-comparison-between-pointer-and-char.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 9e25fd6202e38f1882990cb11c123f4bd8e65263 Mon Sep 17 00:00:00 2001
From: Mingyuan Qi <[email protected]>
Date: Fri, 28 Sep 2018 23:14:27 +0800
Subject: [PATCH] fix comparison between pointer and char

Signed-off-by: Mingyuan Qi <[email protected]>
---
.../sm-db-1.0.0/src/sm_db_service_domain_interfaces.c | 2 +-
service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_neighbors.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_interfaces.c b/service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_interfaces.c
index ecdff20..c7d6b65 100644
--- a/service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_interfaces.c
+++ b/service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_interfaces.c
@@ -363,7 +363,7 @@ SmErrorT sm_db_service_domain_interfaces_update( SmDbHandleT* sm_db_handle,
sm_auth_type_str(record->auth_type) );
}

- if( '\0' != record->auth_key )
+ if( '\0' != record->auth_key[0] )
{
len += snprintf( sql+len, sizeof(sql)-len, "%s = '%s', ",
SM_SERVICE_DOMAIN_INTERFACES_TABLE_COLUMN_AUTH_KEY,
diff --git a/service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_neighbors.c b/service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_neighbors.c
index 809c801..afdcb7c 100644
--- a/service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_neighbors.c
+++ b/service-mgmt/sm-db-1.0.0/src/sm_db_service_domain_neighbors.c
@@ -308,14 +308,14 @@ SmErrorT sm_db_service_domain_neighbors_update( SmDbHandleT* sm_db_handle,
len = snprintf( sql, sizeof(sql), "UPDATE %s SET ",
SM_SERVICE_DOMAIN_NEIGHBORS_TABLE_NAME);

- if( '\0' != record->orchestration )
+ if( '\0' != record->orchestration[0] )
{
len += snprintf( sql+len, sizeof(sql)-len, "%s = '%s', ",
SM_SERVICE_DOMAIN_NEIGHBORS_TABLE_COLUMN_ORCHESTRATION,
record->orchestration );
}

- if( '\0' != record->designation )
+ if( '\0' != record->designation[0] )
{
len += snprintf( sql+len, sizeof(sql)-len, "%s = '%s', ",
SM_SERVICE_DOMAIN_NEIGHBORS_TABLE_COLUMN_DESIGNATION,
--
2.19.0

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PKG_NAME := sm-db-1.0.0
URL = https://github.com/openstack/stx-ha/archive/3ee0e6855958e9d702314f1577e619f657e79ffd.tar.gz
ARCHIVES =

include ../common/Makefile.common
1 change: 1 addition & 0 deletions build_pattern
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make
6 changes: 6 additions & 0 deletions build_prepend
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pushd service-mgmt/sm-db-1.0.0
sqlite3 database/sm.db < database/create_sm_db.sql
sqlite3 database/sm.hb.db < database/create_sm_hb_db.sql
popd
VER=%{version}
MAJOR=`echo $VER | awk -F . '{print $1}'`
4 changes: 4 additions & 0 deletions buildreq_add
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gcc
sm-common-dev
glib-dev
sqlite-autoconf-dev
2 changes: 2 additions & 0 deletions buildreq_ban
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file contains build requirements that get picked up but are
# undesirable. One entry per line, no whitespace.
2 changes: 2 additions & 0 deletions buildreq_cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3ee0e6855958e9d702314f1577e619f657e79ffd
util-linux-dev
2 changes: 2 additions & 0 deletions excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file contains the output files that need %exclude. Full path
# names, one per line.
1 change: 1 addition & 0 deletions install_macro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make DEST_DIR=$RPM_BUILD_ROOT VER=$VER VER_MJR=$MAJOR install_non_bb
2 changes: 2 additions & 0 deletions install_prepend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VER=%{version}
MAJOR=`echo $VER | awk -F . '{print $1}'`
1 change: 1 addition & 0 deletions make_args
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VER=${VER} VER_MJR=$MAJOR
58 changes: 58 additions & 0 deletions options.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[package]
name = sm-db-1.0.0
url = https://github.com/openstack/stx-ha/archive/3ee0e6855958e9d702314f1577e619f657e79ffd.tar.gz
archives =
giturl = https://github.com/openstack/stx-ha.git

[autospec]
# build 32 bit libraries
32bit = false
# allow package to build with test failures
allow_test_failures = false
# unset %build ld_as_needed variable
asneeded = false
# this package is trusted enough to automatically update (used by other tools)
autoupdate = false
# extend flags with '-std=gnu++98
broken_c++ = false
# disable parallelization during build
broken_parallel_build = false
# this package is a library compatability package and only ships versioned library files
compat = false
# set conservative build flags
conservative_flags = false
# dev package requires the extras to be installed
dev_requires_extras = false
# pass -ffast-math to compiler
fast-math = false
# optimize build for speed over size
funroll-loops = false
# set flags to smallest -02 flags possible
insecure_build = false
# do not remove static libraries
keepstatic = false
# do not require autostart subpackage
no_autostart = false
# disable stripping binaries
nostrip = false
# optimize build for size over speed
optimize_size = false
# set profile for pgo
pgo = false
# set flags for security-sensitive builds
security_sensitive = false
# do not run test suite
skip_tests = false
# add .so files to the lib package instead of dev
so_to_lib = false
# configure build for avx2
use_avx2 = false
# configure build for avx512
use_avx512 = false
# add clang flags
use_clang = false
# configure build for lto
use_lto = false
# require package verification for build
verify_required = false

2 changes: 2 additions & 0 deletions pkgconfig_add
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file contains additional pkgconfig build requirements that did
# not get picked up automatically. One name per line, no whitespace.
2 changes: 2 additions & 0 deletions pkgconfig_ban
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file contains pkgconfig build requirements that get picked up
# but are undesirable. One entry per line, no whitespace.
1 change: 1 addition & 0 deletions release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
Empty file added requires_add
Empty file.
2 changes: 2 additions & 0 deletions requires_ban
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file contains runtime requirements that get picked up but are
# undesirable. One entry per line, no whitespace.
3 changes: 3 additions & 0 deletions series
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0001-disable-warning-as-error.patch
0002-reorder-LDLIBS.patch
0003-fix-comparison-between-pointer-and-char.patch
98 changes: 98 additions & 0 deletions sm-db-1.0.0.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#
# This file is auto-generated. DO NOT EDIT
# Generated by: autospec.py
#
Name : sm-db-1.0.0
Version : 3ee0e6855958e9d702314f1577e619f657e79ffd
Release : 1
URL : https://github.com/openstack/stx-ha/archive/3ee0e6855958e9d702314f1577e619f657e79ffd.tar.gz
Source0 : https://github.com/openstack/stx-ha/archive/3ee0e6855958e9d702314f1577e619f657e79ffd.tar.gz
Summary : Service Management Databases
Group : Development/Tools
License : Apache-2.0
Requires: sm-db-1.0.0-lib
BuildRequires : buildreq-distutils3
BuildRequires : gcc
BuildRequires : glib-dev
BuildRequires : pluggy
BuildRequires : py-python
BuildRequires : pytest
BuildRequires : sm-common-dev
BuildRequires : sqlite-autoconf-dev
BuildRequires : tox
BuildRequires : util-linux-dev
BuildRequires : virtualenv
Patch1: 0001-disable-warning-as-error.patch
Patch2: 0002-reorder-LDLIBS.patch
Patch3: 0003-fix-comparison-between-pointer-and-char.patch

%description
Service Managment Databases

%package dev
Summary: dev components for the sm-db-1.0.0 package.
Group: Development
Requires: sm-db-1.0.0-lib
Provides: sm-db-1.0.0-devel

%description dev
dev components for the sm-db-1.0.0 package.


%package lib
Summary: lib components for the sm-db-1.0.0 package.
Group: Libraries

%description lib
lib components for the sm-db-1.0.0 package.


%prep
%setup -q -n stx-ha-3ee0e6855958e9d702314f1577e619f657e79ffd
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
## build_prepend content
pushd service-mgmt/sm-db-1.0.0
sqlite3 database/sm.db < database/create_sm_db.sql
sqlite3 database/sm.hb.db < database/create_sm_hb_db.sql
popd
VER=%{version}
MAJOR=`echo $VER | awk -F . '{print $1}'`
## build_prepend end
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/
export no_proxy=localhost,127.0.0.1,0.0.0.0
export LANG=C
export SOURCE_DATE_EPOCH=1538157565
pushd service-mgmt/sm-db-1.0.0
make %{?_smp_mflags} VER=${VER} VER_MJR=$MAJOR
popd

%install
## install_prepend content
VER=%{version}
MAJOR=`echo $VER | awk -F . '{print $1}'`
## install_prepend end
export SOURCE_DATE_EPOCH=1538157565
rm -rf %{buildroot}
pushd service-mgmt/sm-db-1.0.0
make DEST_DIR=$RPM_BUILD_ROOT VER=$VER VER_MJR=$MAJOR install_non_bb
popd

%files
%defattr(-,root,root,-)
/var/lib/sm/patches/sm-patch.sql
/var/lib/sm/sm.db
/var/lib/sm/sm.hb.db

%files dev
%defattr(-,root,root,-)
/usr/include/*.h
/usr/lib64/libsm_db.so

%files lib
%defattr(-,root,root,-)
/usr/lib64/libsm_db.so.3ee0e6855958e9d702314f1577e619f657e79ffd
1 change: 1 addition & 0 deletions subdir
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service-mgmt/sm-db-1.0.0
Loading