Skip to content

Commit 230f322

Browse files
Add packaging for syncd-rpc (sonic-net#173)
1 parent e28e4c0 commit 230f322

File tree

7 files changed

+43
-17
lines changed

7 files changed

+43
-17
lines changed

debian/changelog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
sonic (1.0.0) stable; urgency=medium
2+
3+
* syncd-rpc is added
4+
5+
-- Pavel Shirshov <[email protected]> Wed, 12 Apr 2017 12:00:00 -0800
6+
17
sonic (1.0.0) stable; urgency=medium
28

39
* Initial release.

debian/control

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Architecture: any
1010
Description: This package contains sync daemon for SONiC project.
1111
This sync daemon syncs the ASIC_DB in Redis database and the real ASIC via SAI.
1212

13+
Package: syncd-rpc
14+
Architecture: any
15+
Description: This package contains sync daemon with rpc for SONiC project.
16+
This sync daemon syncs the ASIC_DB in Redis database and the real ASIC via SAI.
17+
This daemon contains saithrift rpc library for remote control of an ASIC.
18+
1319
Package: libsairedis
1420
Architecture: any
1521
Section: libs

debian/rules

+26-13
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,43 @@ include /usr/share/dpkg/default.mk
1616
# package maintainers to append LDFLAGS
1717
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
1818

19-
# main packaging script based on dh7 syntax
20-
%:
21-
dh $@ --with autotools-dev
19+
clean:
20+
dh $@ --with autotools-dev
21+
22+
build:
23+
echo build stage is skipped. Please use binary to generate debian packages
24+
25+
binary: binary-syncd binary-syncd-rpc
26+
27+
binary-syncd:
28+
$(shell echo > /tmp/syncd-build)
29+
dh clean --with autotools-dev
30+
dh build -N syncd-rpc --with autotools-dev
31+
dh binary -N syncd-rpc --with autotools-dev
32+
33+
binary-syncd-rpc:
34+
$(shell echo '--enable-rpcserver=yes' > /tmp/syncd-build)
35+
dh clean --with autotools-dev
36+
dh build -N syncd --with autotools-dev
37+
dh binary -N syncd --with autotools-dev
2238

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

29-
ifeq ($(findstring --enable-rpcserver=yes,${CONFIGURE_ARGS}),--enable-rpcserver=yes)
30-
saithrift = yes
31-
else
32-
saithrift = no
33-
endif
34-
3545
override_dh_auto_configure:
36-
dh_auto_configure -- ${CONFIGURE_ARGS}
46+
./autogen.sh
47+
dh_auto_configure -- $(shell cat /tmp/syncd-build)
3748

3849
override_dh_installinit:
39-
ifeq ($(saithrift), yes)
40-
sed -i 's/ENABLE_SAITHRIFT=0/ENABLE_SAITHRIFT=1/' debian/syncd.init
50+
ifeq ($(shell cat /tmp/syncd-build), --enable-rpcserver=yes)
51+
sed -i 's/ENABLE_SAITHRIFT=0/ENABLE_SAITHRIFT=1/' debian/syncd-rpc.init
52+
else
53+
sed -i 's/ENABLE_SAITHRIFT=1/ENABLE_SAITHRIFT=0/' debian/syncd.init
4154
endif
42-
dh_installinit
55+
dh_installinit --init-script=syncd
4356

4457
override_dh_shlibdeps:
4558
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

debian/syncd-rpc.dirs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
syncd.dirs

debian/syncd-rpc.init

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
syncd.init

debian/syncd-rpc.install

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
syncd.install

syncd/Makefile.am

+2-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ syncd_CPPFLAGS = $(DBGFLAGS) $(AM_CPPFLAGS) $(CFLAGS_COMMON) $(SAIFLAGS)
2828
syncd_LDADD = -lhiredis -lswsscommon $(SAILIB) -lpthread -L$(top_srcdir)/meta/.libs -lsaimetadata
2929

3030
if SAITHRIFT
31-
SAI_RPC_INCLUDE_DIR = ../libsaiserver/include
32-
SAI_RPC_LIB_DIR = ../libsaiserver/lib
33-
syncd_CPPFLAGS += -I$(SAI_RPC_INCLUDE_DIR) -DSAITHRIFT=yes
34-
syncd_LDADD += -L$(SAI_RPC_LIB_DIR) -lrpcserver -lthrift
31+
syncd_CPPFLAGS += -DSAITHRIFT=yes
32+
syncd_LDADD += -lrpcserver -lthrift
3533
endif
3634

3735
syncd_request_shutdown_SOURCES = syncd_request_shutdown.cpp

0 commit comments

Comments
 (0)