From 230f322b66f4da67b5dba7dbedf39e70219a21f7 Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Wed, 19 Apr 2017 10:52:35 -0700 Subject: [PATCH] Add packaging for syncd-rpc (#173) --- debian/changelog | 6 ++++++ debian/control | 6 ++++++ debian/rules | 39 ++++++++++++++++++++++++++------------- debian/syncd-rpc.dirs | 1 + debian/syncd-rpc.init | 1 + debian/syncd-rpc.install | 1 + syncd/Makefile.am | 6 ++---- 7 files changed, 43 insertions(+), 17 deletions(-) create mode 120000 debian/syncd-rpc.dirs create mode 120000 debian/syncd-rpc.init create mode 120000 debian/syncd-rpc.install diff --git a/debian/changelog b/debian/changelog index 2f82fdd93645..17bb992be0b2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sonic (1.0.0) stable; urgency=medium + + * syncd-rpc is added + + -- Pavel Shirshov Wed, 12 Apr 2017 12:00:00 -0800 + sonic (1.0.0) stable; urgency=medium * Initial release. diff --git a/debian/control b/debian/control index 51c35622ef6e..3603ba87e1b0 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,12 @@ Architecture: any Description: This package contains sync daemon for SONiC project. This sync daemon syncs the ASIC_DB in Redis database and the real ASIC via SAI. +Package: syncd-rpc +Architecture: any +Description: This package contains sync daemon with rpc for SONiC project. + This sync daemon syncs the ASIC_DB in Redis database and the real ASIC via SAI. + This daemon contains saithrift rpc library for remote control of an ASIC. + Package: libsairedis Architecture: any Section: libs diff --git a/debian/rules b/debian/rules index 621512da0e44..7e1075ce51cd 100755 --- a/debian/rules +++ b/debian/rules @@ -16,9 +16,25 @@ include /usr/share/dpkg/default.mk # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -# main packaging script based on dh7 syntax -%: - dh $@ --with autotools-dev +clean: + dh $@ --with autotools-dev + +build: + echo build stage is skipped. Please use binary to generate debian packages + +binary: binary-syncd binary-syncd-rpc + +binary-syncd: + $(shell echo > /tmp/syncd-build) + dh clean --with autotools-dev + dh build -N syncd-rpc --with autotools-dev + dh binary -N syncd-rpc --with autotools-dev + +binary-syncd-rpc: + $(shell echo '--enable-rpcserver=yes' > /tmp/syncd-build) + dh clean --with autotools-dev + dh build -N syncd --with autotools-dev + dh binary -N syncd --with autotools-dev # dh_make generated override targets # This is example for Cmake (See https://bugs.debian.org/641051 ) @@ -26,20 +42,17 @@ include /usr/share/dpkg/default.mk # dh_auto_configure -- \ # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) -ifeq ($(findstring --enable-rpcserver=yes,${CONFIGURE_ARGS}),--enable-rpcserver=yes) - saithrift = yes -else - saithrift = no -endif - override_dh_auto_configure: - dh_auto_configure -- ${CONFIGURE_ARGS} + ./autogen.sh + dh_auto_configure -- $(shell cat /tmp/syncd-build) override_dh_installinit: - ifeq ($(saithrift), yes) - sed -i 's/ENABLE_SAITHRIFT=0/ENABLE_SAITHRIFT=1/' debian/syncd.init + ifeq ($(shell cat /tmp/syncd-build), --enable-rpcserver=yes) + sed -i 's/ENABLE_SAITHRIFT=0/ENABLE_SAITHRIFT=1/' debian/syncd-rpc.init + else + sed -i 's/ENABLE_SAITHRIFT=1/ENABLE_SAITHRIFT=0/' debian/syncd.init endif - dh_installinit + dh_installinit --init-script=syncd override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info diff --git a/debian/syncd-rpc.dirs b/debian/syncd-rpc.dirs new file mode 120000 index 000000000000..9fda9b75373a --- /dev/null +++ b/debian/syncd-rpc.dirs @@ -0,0 +1 @@ +syncd.dirs \ No newline at end of file diff --git a/debian/syncd-rpc.init b/debian/syncd-rpc.init new file mode 120000 index 000000000000..1a51fab437ef --- /dev/null +++ b/debian/syncd-rpc.init @@ -0,0 +1 @@ +syncd.init \ No newline at end of file diff --git a/debian/syncd-rpc.install b/debian/syncd-rpc.install new file mode 120000 index 000000000000..066eee517941 --- /dev/null +++ b/debian/syncd-rpc.install @@ -0,0 +1 @@ +syncd.install \ No newline at end of file diff --git a/syncd/Makefile.am b/syncd/Makefile.am index e321ea1b7718..5d0945a190d0 100644 --- a/syncd/Makefile.am +++ b/syncd/Makefile.am @@ -28,10 +28,8 @@ syncd_CPPFLAGS = $(DBGFLAGS) $(AM_CPPFLAGS) $(CFLAGS_COMMON) $(SAIFLAGS) syncd_LDADD = -lhiredis -lswsscommon $(SAILIB) -lpthread -L$(top_srcdir)/meta/.libs -lsaimetadata if SAITHRIFT -SAI_RPC_INCLUDE_DIR = ../libsaiserver/include -SAI_RPC_LIB_DIR = ../libsaiserver/lib -syncd_CPPFLAGS += -I$(SAI_RPC_INCLUDE_DIR) -DSAITHRIFT=yes -syncd_LDADD += -L$(SAI_RPC_LIB_DIR) -lrpcserver -lthrift +syncd_CPPFLAGS += -DSAITHRIFT=yes +syncd_LDADD += -lrpcserver -lthrift endif syncd_request_shutdown_SOURCES = syncd_request_shutdown.cpp