Skip to content

Commit 0e26f5a

Browse files
oleksandrivantsivlguohan
authored andcommitted
[test/saithrift]: Cherry-pick commits from v0.9.4 (opencomputeproject#730)
* [test/saithrift]: Create a debian package for client/server rpc library (opencomputeproject#471) * Initial debian file * Add install target for test/saithrift Makefile * Add saithrift and saithrift-install target for root Makefile * Fixes * [saithrift]: Fix debian packages for saithrift libraries
1 parent 121d107 commit 0e26f5a

10 files changed

+80
-0
lines changed

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,11 @@ doc:
2525
test:
2626
make -C test
2727

28+
saithrift-build:
29+
make -C test/saithrift
30+
31+
saithrift-install: saithrift-build
32+
make -C test/saithrift install
33+
2834
clean:
2935
make -C test clean

debian/changelog

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
saithrift (0.9.4) stable; urgency=medium
2+
3+
* Initial release.
4+
5+
-- Pavel Shirshov <[email protected]> Fri, 24 Mar 2017 14:23:00 -0800

debian/compat

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

debian/control

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Source: saithrift
2+
Maintainer: Pavel Shirshov <[email protected]>
3+
Section: net
4+
Priority: optional
5+
Build-Depends: dh-exec (>=0.3), debhelper (>= 9)
6+
Standards-Version: 0.9.4
7+
8+
Package: libsaithrift-dev
9+
Architecture: any
10+
Depends: ${shlibs:Depends}
11+
Description: This package contains SAI rpc library development headers
12+
13+
Package: python-saithrift
14+
Architecture: any
15+
Depends: ${shlibs:Depends}
16+
Description: This package contains python SAI rpc library.

debian/libsaithrift-dev.dirs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/usr/include
2+
/usr/lib

debian/libsaithrift-dev.install

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
debian/usr/include/switch_sai_rpc_server.h usr/include
2+
debian/usr/lib/librpcserver.a usr/lib

debian/python-saithrift.dirs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/usr/local/lib

debian/python-saithrift.install

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
debian/usr/local/lib/python2.7/site-packages/* usr/include/local/lib/python2.7/site-packages

debian/rules

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/make -f
2+
3+
# See debhelper(7) (uncomment to enable)
4+
# output every command that modifies files on the build system.
5+
export DH_VERBOSE = 1
6+
7+
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
8+
DPKG_EXPORT_BUILDFLAGS = 1
9+
include /usr/share/dpkg/default.mk
10+
11+
# see FEATURE AREAS in dpkg-buildflags(1)
12+
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
13+
14+
# see ENVIRONMENT in dpkg-buildflags(1)
15+
# package maintainers to append CFLAGS
16+
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
17+
# package maintainers to append LDFLAGS
18+
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
19+
20+
21+
# main packaging script based on dh7 syntax
22+
%:
23+
dh $@
24+
25+
override_dh_auto_build:
26+
$(MAKE) DESTDIR=$(CURDIR)/debian saithrift-build
27+
28+
override_dh_auto_install:
29+
$(MAKE) DESTDIR=$(CURDIR)/debian saithrift-install
30+
31+
override_dh_auto_test:
32+
33+
override_dh_auto_clean:
34+
dh_auto_clean
35+
rm -rf *.egg-info
36+

test/saithrift/Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ SAI_PY_HEADERS = \
5151
src/gen-py/switch_sai/sai_headers.py
5252

5353
MKDIR_P = mkdir -p
54+
INSTALL := /usr/bin/install
5455

5556
all: directories $(ODIR)/librpcserver.a saiserver clientlib
5657

@@ -85,5 +86,14 @@ saiserver: $(ODIR)/saiserver.o $(ODIR)/librpcserver.a
8586
$(CXX) $(LDFLAGS) $(ODIR)/switch_sai_rpc_server.o $(ODIR)/saiserver.o -o $@ \
8687
$(ODIR)/librpcserver.a $(LIBS)
8788

89+
install-lib: $(ODIR)/librpcserver.a
90+
$(INSTALL) -D $(ODIR)/librpcserver.a $(DESTDIR)/usr/lib/librpcserver.a
91+
$(INSTALL) -D $(SRC)/switch_sai_rpc_server.h $(DESTDIR)/usr/include/switch_sai_rpc_server.h
92+
93+
install-pylib: $(PY_SOURCES) $(SAI_PY_HEADERS)
94+
python setup.py install --prefix $(DESTDIR)/usr/local$(prefix)
95+
96+
install: install-lib install-pylib
97+
8898
clean:
8999
rm -rf $(ODIR) $(SRC)/gen-cpp $(SRC)/gen-py saiserver dist

0 commit comments

Comments
 (0)