From 8a1095cb737ba8e3ec732a894d629c33f5b80d49 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Fri, 1 Nov 2019 10:24:03 +0200 Subject: [PATCH] move packaging scripts into pkg directory This helps avoid confusion with the 'docker' directory. Also restore the debian9 scripts which may be useful for a while longer, update the names of the scripts and update the README accordingly. --- README.md | 3 + .../centos7-x86_64.sh | 2 +- .../debian10-amd64.sh | 2 +- .../debian10-armhf.sh | 2 +- pkg/debian9-amd64.sh | 67 ++++++++++++++ pkg/debian9-armhf.sh | 87 +++++++++++++++++++ 6 files changed, 160 insertions(+), 3 deletions(-) rename docker-build-centos.sh => pkg/centos7-x86_64.sh (97%) rename docker-build-debian.sh => pkg/debian10-amd64.sh (95%) rename docker-xbuild-debian-armhf.sh => pkg/debian10-armhf.sh (96%) create mode 100755 pkg/debian9-amd64.sh create mode 100755 pkg/debian9-armhf.sh diff --git a/README.md b/README.md index e0dd48c..d4bfacb 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,6 @@ sudo make install `make install` includes a systemd unit file. If you intend to use it, consider creating a new user `laminar` or modifying the user specified in the unit file. +## Packaging for distributions + +The `pkg` directory contains shell scripts which use docker to build native packages (deb,rpm) for common Linux distributions. Note that these are very simple packages which may not completely conform to the distribution's packaging guidelines, however they may serve as a starting point for creating an official package, or may be useful if the official package lags. diff --git a/docker-build-centos.sh b/pkg/centos7-x86_64.sh similarity index 97% rename from docker-build-centos.sh rename to pkg/centos7-x86_64.sh index 0367214..ced9a72 100755 --- a/docker-build-centos.sh +++ b/pkg/centos7-x86_64.sh @@ -2,7 +2,7 @@ OUTPUT_DIR=$PWD -SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) +SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})/..) VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty | tr - .) diff --git a/docker-build-debian.sh b/pkg/debian10-amd64.sh similarity index 95% rename from docker-build-debian.sh rename to pkg/debian10-amd64.sh index 0010a26..6d6434c 100755 --- a/docker-build-debian.sh +++ b/pkg/debian10-amd64.sh @@ -2,7 +2,7 @@ OUTPUT_DIR=$PWD -SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) +SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})/..) VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty)-1~upstream-debian10 diff --git a/docker-xbuild-debian-armhf.sh b/pkg/debian10-armhf.sh similarity index 96% rename from docker-xbuild-debian-armhf.sh rename to pkg/debian10-armhf.sh index 95c06a0..fb3409f 100755 --- a/docker-xbuild-debian-armhf.sh +++ b/pkg/debian10-armhf.sh @@ -2,7 +2,7 @@ OUTPUT_DIR=$PWD -SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) +SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})/..) VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty)-1~upstream-debian10 diff --git a/pkg/debian9-amd64.sh b/pkg/debian9-amd64.sh new file mode 100755 index 0000000..c0657a4 --- /dev/null +++ b/pkg/debian9-amd64.sh @@ -0,0 +1,67 @@ +#!/bin/bash -e + +OUTPUT_DIR=$PWD + +SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})/..) + +VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty)-1~upstream-debian9 + +DOCKER_TAG=$(docker build -q - < laminar/DEBIAN/control +Package: laminar +Version: $VERSION +Section: +Priority: optional +Architecture: amd64 +Maintainer: Oliver Giles +Depends: libsqlite3-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}_amd64.deb +EOS diff --git a/pkg/debian9-armhf.sh b/pkg/debian9-armhf.sh new file mode 100755 index 0000000..2075958 --- /dev/null +++ b/pkg/debian9-armhf.sh @@ -0,0 +1,87 @@ +#!/bin/bash -e + +OUTPUT_DIR=$PWD + +SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})/..) + +VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty)-1~upstream-debian9 + +DOCKER_TAG=$(docker build -q - < toolchain.cmake < laminar/DEBIAN/control +Package: laminar +Version: $VERSION +Section: +Priority: optional +Architecture: armhf +Maintainer: Oliver Giles +Depends: libsqlite3-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}_armhf.deb +EOS