2018-05-14 18:15:53 +00:00
|
|
|
#!/bin/bash -e
|
2015-11-26 07:41:06 +00:00
|
|
|
|
|
|
|
OUTPUT_DIR=$PWD
|
|
|
|
|
|
|
|
SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
|
|
|
|
|
2019-09-04 06:33:16 +00:00
|
|
|
VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty)-1~upstream-debian10
|
2017-08-19 07:47:27 +00:00
|
|
|
|
2018-05-14 18:15:53 +00:00
|
|
|
DOCKER_TAG=$(docker build -q - <<EOS
|
2019-09-04 06:33:16 +00:00
|
|
|
FROM debian:10-slim
|
|
|
|
RUN apt-get update && apt-get install -y wget cmake g++ capnproto libcapnp-dev rapidjson-dev libsqlite3-dev libboost-dev zlib1g-dev
|
2018-05-14 18:15:53 +00:00
|
|
|
EOS
|
|
|
|
)
|
2015-11-26 07:41:06 +00:00
|
|
|
|
2018-05-14 18:15:53 +00:00
|
|
|
docker run --rm -i -v $SOURCE_DIR:/laminar:ro -v $OUTPUT_DIR:/output $DOCKER_TAG bash -xe <<EOS
|
2015-11-26 07:41:06 +00:00
|
|
|
|
|
|
|
mkdir /build
|
|
|
|
cd /build
|
|
|
|
|
2018-10-16 17:20:43 +00:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ -DZSH_COMPLETIONS_DIR=/usr/share/zsh/functions/Completion/Unix /laminar
|
2015-11-26 07:41:06 +00:00
|
|
|
make -j4
|
|
|
|
mkdir laminar
|
|
|
|
make DESTDIR=laminar install/strip
|
|
|
|
|
|
|
|
mkdir laminar/DEBIAN
|
|
|
|
cat <<EOF > laminar/DEBIAN/control
|
|
|
|
Package: laminar
|
|
|
|
Version: $VERSION
|
|
|
|
Section:
|
|
|
|
Priority: optional
|
|
|
|
Architecture: amd64
|
2015-12-06 10:39:17 +00:00
|
|
|
Maintainer: Oliver Giles <web ohwg net>
|
2018-09-28 07:36:10 +00:00
|
|
|
Depends: libsqlite3-0, zlib1g
|
2015-11-26 07:41:06 +00:00
|
|
|
Description: Lightweight Continuous Integration Service
|
|
|
|
EOF
|
|
|
|
cat <<EOF > laminar/DEBIAN/postinst
|
2015-12-06 10:41:46 +00:00
|
|
|
#!/bin/bash
|
2015-11-26 07:41:06 +00:00
|
|
|
echo Creating laminar user with home in /var/lib/laminar
|
|
|
|
useradd -r -d /var/lib/laminar -s /usr/sbin/nologin laminar
|
2015-12-06 10:41:46 +00:00
|
|
|
mkdir -p /var/lib/laminar/cfg/{jobs,nodes,scripts}
|
2015-11-26 07:41:06 +00:00
|
|
|
chown -R laminar: /var/lib/laminar
|
|
|
|
EOF
|
|
|
|
chmod +x laminar/DEBIAN/postinst
|
|
|
|
|
|
|
|
dpkg-deb --build laminar
|
2019-08-30 17:32:48 +00:00
|
|
|
mv laminar.deb /output/laminar_${VERSION}_amd64.deb
|
2015-11-26 07:41:06 +00:00
|
|
|
EOS
|