2023-11-28 00:49:05 +08:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
|
|
|
TARGET=`basename $(pwd)`
|
|
|
|
|
2024-10-04 04:44:53 +08:00
|
|
|
SERVER_VERSION=1.7.2
|
|
|
|
CLI_VERSION=2.2.0
|
2023-11-28 00:49:05 +08:00
|
|
|
|
|
|
|
PACKAGE=$(echo $TARGET | cut -d'_' -f1)
|
|
|
|
VERSION=$(echo $TARGET | cut -d'_' -f2)
|
|
|
|
DISTRO=$(echo $TARGET | cut -d'_' -f3)
|
|
|
|
|
|
|
|
BUILDDIR=$PWD
|
|
|
|
DESTDIR=$BUILDDIR/staging
|
|
|
|
|
|
|
|
#
|
|
|
|
# Clear staging directory for build
|
|
|
|
|
|
|
|
rm -rf $DESTDIR
|
|
|
|
mkdir -p $DESTDIR
|
|
|
|
|
|
|
|
. ./opts-$DISTRO.sh
|
|
|
|
|
|
|
|
mkdir -p $DESTDIR/usr/share/bigbluebutton/nginx
|
|
|
|
cp livekit.nginx $DESTDIR/usr/share/bigbluebutton/nginx
|
|
|
|
|
|
|
|
mkdir -p $DESTDIR/lib/systemd/system/
|
|
|
|
cp livekit-server.service $DESTDIR/lib/systemd/system
|
|
|
|
|
|
|
|
mkdir -p $DESTDIR/usr/share/livekit-server
|
|
|
|
cp livekit.yaml $DESTDIR/usr/share/livekit-server
|
|
|
|
|
|
|
|
mkdir -p $DESTDIR/usr/bin
|
|
|
|
|
|
|
|
curl https://github.com/livekit/livekit/releases/download/v${SERVER_VERSION}/livekit_${SERVER_VERSION}_linux_amd64.tar.gz -Lo - | tar -C $DESTDIR/usr/bin -xzf - livekit-server
|
2024-10-04 04:44:53 +08:00
|
|
|
curl https://github.com/livekit/livekit-cli/releases/download/v${CLI_VERSION}/lk_${CLI_VERSION}_linux_amd64.tar.gz -Lo - | tar -C $DESTDIR/usr/bin -xzf - lk
|
2023-11-28 00:49:05 +08:00
|
|
|
|
|
|
|
fpm -s dir -C $DESTDIR -n $PACKAGE \
|
|
|
|
--version $VERSION --epoch 2 \
|
|
|
|
--before-install before-install.sh \
|
|
|
|
--after-install after-install.sh \
|
|
|
|
--before-remove before-remove.sh \
|
|
|
|
--after-remove after-remove.sh \
|
|
|
|
--description "BigBlueButton build of LiveKit Server" \
|
|
|
|
$DIRECTORIES \
|
|
|
|
$OPTS
|