Skip to content

Commit

Permalink
add make dist-deb
Browse files Browse the repository at this point in the history
  • Loading branch information
matzf committed Dec 8, 2023
1 parent e70342d commit 4f4060d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ doc/venv/
/bin/*
!/bin/.keepme

# Generated package files
##########################
/deb/

# CTags
##########################
tags
Expand Down
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all build build-dev antlr clean docker-images gazelle go.mod licenses mocks protobuf scion-topo test test-integration write_all_source_files
.PHONY: all build build-dev dist-deb antlr clean docker-images gazelle go.mod licenses mocks protobuf scion-topo test test-integration write_all_source_files

build-dev:
rm -f bin/*
Expand All @@ -11,6 +11,20 @@ build:
bazel build //:scion
tar -kxf bazel-bin/scion.tar -C bin

dist-deb:
bazel build //dist:deb_all
mkdir -p deb; rm -f deb/*;
@ # Bazel cannot include the version in the filename.
@ # Extract the version from the .deb files and expand the "__" in the filename to "_<version>_".
@for f in `bazel cquery //dist:deb_all --output=files 2>/dev/null`; do \
if [ -f "$$f" ]; then \
bf=`basename $$f`; \
v="$$(ar p $$f control.tar.gz | tar -xz --to-stdout ./control | sed -n 's/Version: //p')"; \
bfv=$${bf%%__*}_$${v}_$${bf#*__}; \
cp -v "$$f" deb/$$bfv; \
fi \
done

# all: performs the code-generation steps and then builds; the generated code
# is git controlled, and therefore this is only necessary when changing the
# sources for the code generation.
Expand Down

0 comments on commit 4f4060d

Please sign in to comment.