sci/scripts/package-sci-deb.sh
Asger Gitz-Johansen d02eb34285 feat: add debian packaging
fuck this is complicated. Why'd you make it so insane, debian
maintainers?
Please fix this.

It's working now, but Makefile must be modified... I dont like that.
Let's find another way
2024-08-19 19:47:44 +02:00

32 lines
909 B
Bash
Executable File

#!/bin/bash
# TODO: SCI_VERSION env var
debbuilder_image=$(docker images | grep debbuilder)
set -e
if [ -z $debbuilder_image ]; then
echo "building debbuilder image..."
docker build -t debbuilder -f deb-builder.dockerfile .
fi
echo "building source dist..."
make dist
echo "building .deb in debbuilder docker image..."
docker run --rm -it -v .:/src debbuilder sh -c '\
cd && \
mkdir -p artifacts && \
cp /src/sci-1.0.0.tar.gz . && \
mv sci-1.0.0.tar.gz sci_1.0.0.orig.tar.gz && \
tar xf sci_1.0.0.orig.tar.gz && \
cd sci-1.0.0 && \
cp -r /src/debian . && \
debuild && \
cp ../*.deb ~/artifacts && \
cp ../*.dsc ~/artifacts && \
cp ../*.build ~/artifacts && \
cp ../*.buildinfo ~/artifacts && \
cp ../*.changes ~/artifacts && \
cp ../*.tar.xz ~/artifacts && \
cp ../*.tar.gz ~/artifacts && \
tar czf /src/artifacts.tar.gz ~/artifacts
'