diff --git a/.gitignore b/.gitignore index e994a71edd..d3df276f72 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,10 @@ doc/venv/ /bin/* !/bin/.keepme +# Generated package files +########################## +/deb/ + # CTags ########################## tags diff --git a/Makefile b/Makefile index ad506aded3..77c9ed31df 100644 --- a/Makefile +++ b/Makefile @@ -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/* @@ -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 "__". + @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.