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