2015-11-26 07:41:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
OUTPUT_DIR=$PWD
|
|
|
|
|
|
|
|
SOURCE_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
|
|
|
|
|
2017-08-19 07:47:27 +00:00
|
|
|
VERSION=$(cd "$SOURCE_DIR" && git describe --tags --abbrev=8 --dirty)
|
|
|
|
|
2016-07-26 10:02:58 +00:00
|
|
|
docker run --rm -i -v $SOURCE_DIR:/laminar:ro -v $OUTPUT_DIR:/output debian:stable bash -xe <<EOS
|
2015-11-26 07:41:06 +00:00
|
|
|
|
|
|
|
apt-get update
|
2017-07-31 05:58:06 +00:00
|
|
|
apt-get install -y wget cmake g++ libsqlite3-dev libboost-filesystem1.62-dev zlib1g-dev
|
2015-11-26 07:41:06 +00:00
|
|
|
|
|
|
|
mkdir /build
|
|
|
|
cd /build
|
|
|
|
|
2017-08-19 07:43:01 +00:00
|
|
|
wget -O capnproto.tar.gz https://github.com/capnproto/capnproto/archive/7a7c4007e3e1b249f078a246749a584c96bf7503.tar.gz
|
2017-07-31 05:58:06 +00:00
|
|
|
wget -O websocketpp.tar.gz https://github.com/zaphoyd/websocketpp/archive/0.7.0.tar.gz
|
|
|
|
wget -O rapidjson.tar.gz https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz
|
2015-11-26 07:41:06 +00:00
|
|
|
md5sum -c <<EOF
|
2017-08-19 07:43:01 +00:00
|
|
|
58d238ffbb19152f04d2bff520847788 capnproto.tar.gz
|
2017-07-31 05:58:06 +00:00
|
|
|
5027c20cde76fdaef83a74acfcf98e23 websocketpp.tar.gz
|
|
|
|
badd12c511e081fec6c89c43a7027bce rapidjson.tar.gz
|
2015-11-26 07:41:06 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
tar xzf capnproto.tar.gz
|
|
|
|
tar xzf websocketpp.tar.gz
|
|
|
|
tar xzf rapidjson.tar.gz
|
|
|
|
|
2017-08-19 07:43:01 +00:00
|
|
|
cd /build/capnproto-7a7c4007e3e1b249f078a246749a584c96bf7503/c++/
|
2015-11-26 07:41:06 +00:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=off .
|
|
|
|
make -j4
|
|
|
|
make install
|
|
|
|
|
2017-07-31 05:58:06 +00:00
|
|
|
cd /build/websocketpp-0.7.0/
|
2015-11-26 07:41:06 +00:00
|
|
|
cmake .
|
|
|
|
make install
|
|
|
|
|
2017-07-31 05:58:06 +00:00
|
|
|
cd /build/rapidjson-1.1.0/
|
2015-11-26 07:41:06 +00:00
|
|
|
cmake -DRAPIDJSON_BUILD_EXAMPLES=off .
|
|
|
|
make install
|
|
|
|
|
|
|
|
cd /build
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ /laminar
|
|
|
|
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>
|
2017-07-31 05:58:06 +00:00
|
|
|
Depends: libboost-filesystem1.62.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
|
2015-12-06 13:12:12 +00:00
|
|
|
mv laminar.deb /output/laminar-$VERSION-1-amd64.deb
|
2015-11-26 07:41:06 +00:00
|
|
|
EOS
|