Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dash] Add libsai-debs target to create libsai debian packages #444

Merged
merged 1 commit into from
Sep 23, 2023
Merged
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
8 changes: 8 additions & 0 deletions dash-pipeline/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ SAI/lib/libsai.so: sai-headers sai-meta
libsai-clean:
rm -rf SAI/lib/*

libsai-debs: libsai
@echo "build dash libsai debian packages ..."
cd SAI/debian && make

.PHONY: libsai-debs-clean
libsai-debs-clean:
cd SAI/debian && make clean

.PHONY:sai-clean
sai-clean: SAI/SAI libsai-clean saithrift-server-clean
@echo "Restoring SAI subdirectories to baseline..."
Expand Down
3 changes: 3 additions & 0 deletions dash-pipeline/SAI/debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.deb
**/usr
**/DEBIAN/md5sums
29 changes: 29 additions & 0 deletions dash-pipeline/SAI/debian/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# TODO lib directory could be changed to /usr/local/lib

VERSION=1.0.0

all: debs

debs: libsai-dev_$(VERSION)_amd64.deb libsai_$(VERSION)_amd64.deb

libsai-dev_$(VERSION)_amd64.deb: ../SAI/inc/*.h ../SAI/experimental/*.h
mkdir -p -m 755 libsai-dev_$(VERSION)_amd64/usr/include/sai
find -type d |xargs chmod go-w
install -vCD -m 644 ../SAI/inc/*.h libsai-dev_$(VERSION)_amd64/usr/include/sai/
install -vCD -m 644 ../SAI/experimental/*.h libsai-dev_$(VERSION)_amd64/usr/include/sai/
cd libsai-dev_$(VERSION)_amd64 && find usr -type f | xargs md5sum > DEBIAN/md5sums
dpkg-deb --build --root-owner-group libsai-dev_$(VERSION)_amd64

libsai_$(VERSION)_amd64.deb: ../lib/libsai.so
mkdir -p -m 755 libsai_$(VERSION)_amd64/usr/lib/x86_64-linux-gnu/
find -type d |xargs chmod go-w
install -vCD ../lib/libsai.so libsai_$(VERSION)_amd64/usr/lib/x86_64-linux-gnu/libsai.so
cd libsai_$(VERSION)_amd64 && find usr -type f | xargs md5sum > DEBIAN/md5sums
dpkg-deb --build --root-owner-group libsai_$(VERSION)_amd64

.PHONY: clean

clean:
rm -f *.deb */DEBIAN/md5sums
rm -rf libsai_$(VERSION)_amd64/usr libsai-dev_$(VERSION)_amd64/usr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: libsai-dev
Source: dash
Version: 1.0.0
Architecture: amd64
Maintainer: Kamil Cudnik <[email protected]>
Section: libdevel
Priority: optional
Description: This package contains development files for DASH libsai
8 changes: 8 additions & 0 deletions dash-pipeline/SAI/debian/libsai_1.0.0_amd64/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: libsai
Source: dash
Version: 1.0.0
Architecture: amd64
Maintainer: Kamil Cudnik <[email protected]>
Section: libs
Priority: optional
Description: This package contains DASH libsai
1 change: 1 addition & 0 deletions dash-pipeline/SAI/debian/libsai_1.0.0_amd64/DEBIAN/shlibs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libsai 0 libsai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
activate-noawait ldconfig