Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 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
8 changes: 8 additions & 0 deletions rules/sonic-db-cli.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SPATH := $($(SONIC_DB_CLI)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-db-cli.mk rules/sonic-db-cli.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(SPATH))

$(BASH)_CACHE_MODE := GIT_CONTENT_SHA
$(BASH)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(BASH)_DEP_FILES := $(DEP_FILES)
15 changes: 15 additions & 0 deletions rules/sonic-db-cli.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# sonic-cli Debian package
SONIC_DB_CLI_VERSION = 1.0.0
export SONIC_DB_CLI_VERSION

SONIC_DB_CLI = sonic-db-cli_$(SONIC_DB_CLI_VERSION)_$(CONFIGURED_ARCH).deb
$(SONIC_DB_CLI)_DEPENDS += $(LIBSWSSCOMMON_DEV)
$(SONIC_DB_CLI)_RDEPENDS += $(LIBSWSSCOMMON)
$(SONIC_DB_CLI)_SRC_PATH = $(SRC_PATH)/sonic-db-cli

SONIC_DPKG_DEBS += $(SONIC_DB_CLI)

# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
# are archived into debug one image to facilitate debugging.
#
DBG_SRC_ARCHIVE += sonic-db-cli
24 changes: 24 additions & 0 deletions src/sonic-db-cli/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
###########################################################################
##
## File: ./Makefile.am
## Versions: $Id: Makefile.am,v 1.0 2022/04/02 12:04:29 liuh@microsoft.com Exp $
## Created: 2022/04/02
##
###########################################################################
ACLOCAL_AMFLAGS = -I m4 --install
ACLOCAL_AMFLAGS = -I config
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS = tests

bin_PROGRAMS = sonic-db-cli
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sonic-db-cli

Offline discussed. Let's move this application to sonic-swss-common repo. Following original practice that in sonic-py-swsssdk repo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will close this PR and send another PR for this.

sonic_db_cli_SOURCES = sonic-db-cli.h sonic-db-cli.cpp
sonic_db_cli_CPPFLAGS = $(AM_CPPFLAGS) -std=c++17
sonic_db_cli_LDFLAGS = -lswsscommon $(BOOST_PROGRAM_OPTIONS_LIB)

EXTRA_DIST = bootstrap sonic-db-cli.spec

MAINTAINERCLEANFILES = Makefile.in config.h.in configure aclocal.m4 \
config/config.guess config/config.sub config/depcomp \
config/install-sh config/ltmain.sh config/missing

pkgconfigdir = $(libdir)/pkgconfig
70 changes: 70 additions & 0 deletions src/sonic-db-cli/configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
dnl
dnl File: configure.in
dnl Revision: $Id: configure.ac,v 1.0 2022/04/02 12:04:29 liuh@microsoft.com Exp $
dnl Created: 2022/04/02
dnl Author: Liu Hua <liuh@microsoft.com>
dnl
dnl Process this file with autoconf to produce a configure script
dnl You need autoconf 2.59 or better!
dnl
dnl ---------------------------------------------------------------------------

AC_PREREQ(2.59)
AC_COPYRIGHT([
See the included file: COPYING for copyright information.
])
AC_INIT(sonic-db-cli, 1.0.0, [liuh@microsoft.com])

AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([sonic-db-cli.cpp])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_MACRO_DIR([m4])

dnl --------------------------------------------------------------------
dnl Checks for programs.
AC_LANG_C
AC_LANG([C++])
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_ENABLE_SHARED
AC_DISABLE_STATIC
AM_PROG_LIBTOOL

dnl --------------------------------------------------------------------
dnl Checks for libraries.
AC_CHECK_LIB(swsscommon, conn)
dnl Check boost libs: https://www.gnu.org/software/autoconf-archive/The-Macros.html#The-Macros
AX_BOOST_BASE(,, [AC_MSG_ERROR([boost lib missing])])
AX_BOOST_PROGRAM_OPTIONS

dnl --------------------------------------------------------------------
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADER([swss/sonicv2connector.h], [], [AC_MSG_ERROR([swsscommon lib missing. ])] )

dnl --------------------------------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

dnl --------------------------------------------------------------------
dnl Checks for library functions.
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([bzero gethostbyname gettimeofday inet_ntoa select socket logwtmp getrandom])

dnl --------------------------------------------------------------------
dnl Generate made files
AC_CONFIG_FILES([
Makefile
tests/Makefile
])
AC_OUTPUT
5 changes: 5 additions & 0 deletions src/sonic-db-cli/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sonic-db-cli (1.0.0) unstable; urgency=medium

* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>

-- Liu Hua <liuh@microsoft.com> Wed, 06 Apr 2022 09:21:18 +0000
14 changes: 14 additions & 0 deletions src/sonic-db-cli/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: sonic-db-cli
Section: unknown
Priority: optional
Maintainer: Liu Hua <liuh@microsoft.com>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Homepage: <insert the upstream URL, if relevant>
Rules-Requires-Root: no

Package: sonic-db-cli
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
1 change: 1 addition & 0 deletions src/sonic-db-cli/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (C) 2022 Microsoft, Inc
25 changes: 25 additions & 0 deletions src/sonic-db-cli/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
dh $@


# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
Loading