You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.8 KiB
68 lines
1.8 KiB
6 years ago
|
#!/bin/bash -e
|
||
9 years ago
|
|
||
|
OUTPUT_DIR=$PWD
|
||
|
|
||
5 years ago
|
SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})/..)
|
||
9 years ago
|
|
||
5 years ago
|
VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty)-1~upstream-debian9
|
||
7 years ago
|
|
||
6 years ago
|
DOCKER_TAG=$(docker build -q - <<EOS
|
||
5 years ago
|
FROM debian:9-slim
|
||
|
RUN apt-get update && apt-get install -y wget cmake g++ libsqlite3-dev libboost-dev zlib1g-dev
|
||
6 years ago
|
EOS
|
||
|
)
|
||
9 years ago
|
|
||
6 years ago
|
docker run --rm -i -v $SOURCE_DIR:/laminar:ro -v $OUTPUT_DIR:/output $DOCKER_TAG bash -xe <<EOS
|
||
9 years ago
|
|
||
|
mkdir /build
|
||
|
cd /build
|
||
|
|
||
5 years ago
|
wget -O capnproto.tar.gz https://github.com/capnproto/capnproto/archive/v0.7.0.tar.gz
|
||
|
wget -O rapidjson.tar.gz https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz
|
||
|
md5sum -c <<EOF
|
||
|
a9de5f042f4cf05515c2d7dfc7f5df21 capnproto.tar.gz
|
||
|
badd12c511e081fec6c89c43a7027bce rapidjson.tar.gz
|
||
|
EOF
|
||
|
|
||
|
tar xzf capnproto.tar.gz
|
||
|
tar xzf rapidjson.tar.gz
|
||
|
|
||
|
cd /build/capnproto-0.7.0/c++/
|
||
|
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=off .
|
||
|
make -j4
|
||
|
make install
|
||
|
|
||
|
cd /build/rapidjson-1.1.0/
|
||
|
cmake -DRAPIDJSON_BUILD_EXAMPLES=off .
|
||
|
make install
|
||
|
|
||
|
cd /build
|
||
6 years ago
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ -DZSH_COMPLETIONS_DIR=/usr/share/zsh/functions/Completion/Unix /laminar
|
||
9 years ago
|
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
|
||
9 years ago
|
Maintainer: Oliver Giles <web ohwg net>
|
||
6 years ago
|
Depends: libsqlite3-0, zlib1g
|
||
9 years ago
|
Description: Lightweight Continuous Integration Service
|
||
|
EOF
|
||
|
cat <<EOF > laminar/DEBIAN/postinst
|
||
9 years ago
|
#!/bin/bash
|
||
9 years ago
|
echo Creating laminar user with home in /var/lib/laminar
|
||
|
useradd -r -d /var/lib/laminar -s /usr/sbin/nologin laminar
|
||
9 years ago
|
mkdir -p /var/lib/laminar/cfg/{jobs,nodes,scripts}
|
||
9 years ago
|
chown -R laminar: /var/lib/laminar
|
||
|
EOF
|
||
|
chmod +x laminar/DEBIAN/postinst
|
||
|
|
||
|
dpkg-deb --build laminar
|
||
5 years ago
|
mv laminar.deb /output/laminar_${VERSION}_amd64.deb
|
||
9 years ago
|
EOS
|