#!/bin/bash OUTPUT_DIR=$PWD SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty) docker run --rm -i -v $SOURCE_DIR:/laminar:ro -v $OUTPUT_DIR:/output debian:9-slim bash -xe < laminar/DEBIAN/control Package: laminar Version: $VERSION Section: Priority: optional Architecture: amd64 Maintainer: Oliver Giles Depends: libsqlite3-0, libboost-filesystem1.62.0, zlib1g Description: Lightweight Continuous Integration Service EOF cat < laminar/DEBIAN/postinst #!/bin/bash echo Creating laminar user with home in /var/lib/laminar useradd -r -d /var/lib/laminar -s /usr/sbin/nologin laminar mkdir -p /var/lib/laminar/cfg/{jobs,nodes,scripts} chown -R laminar: /var/lib/laminar EOF chmod +x laminar/DEBIAN/postinst dpkg-deb --build laminar mv laminar.deb /output/laminar-$VERSION-1-amd64.deb EOS