2021-08-13 18:53:18 +08:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
|
|
|
TARGET=`basename $(pwd)`
|
|
|
|
|
|
|
|
|
|
|
|
PACKAGE=$(echo $TARGET | cut -d'_' -f1)
|
|
|
|
VERSION=$(echo $TARGET | cut -d'_' -f2)
|
|
|
|
DISTRO=$(echo $TARGET | cut -d'_' -f3)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Clean up directories
|
|
|
|
rm -rf staging
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create directory for fpm to process
|
2022-03-06 11:51:27 +08:00
|
|
|
DIRS="/usr/share/bigbluebutton/nginx /usr/local/bigbluebutton/bbb-webhooks"
|
2021-08-13 18:53:18 +08:00
|
|
|
for dir in $DIRS; do
|
|
|
|
mkdir -p staging$dir
|
|
|
|
done
|
|
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
mkdir -p staging/usr/local/bigbluebutton/bbb-webhooks
|
|
|
|
|
2024-01-09 22:19:04 +08:00
|
|
|
find -maxdepth 1 ! -path . ! -name staging ! -name .git $(printf "! -name %s " $(cat .build-files)) -exec cp -r {} staging/usr/local/bigbluebutton/bbb-webhooks/ \;
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
pushd .
|
|
|
|
cd staging/usr/local/bigbluebutton/bbb-webhooks/
|
2024-01-09 22:19:04 +08:00
|
|
|
npm ci --omit=dev
|
2021-08-13 18:53:18 +08:00
|
|
|
popd
|
|
|
|
|
2022-03-06 11:51:27 +08:00
|
|
|
cp webhooks.nginx staging/usr/share/bigbluebutton/nginx/webhooks.nginx
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
mkdir -p staging/usr/lib/systemd/system
|
|
|
|
cp bbb-webhooks.service staging/usr/lib/systemd/system
|
|
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
. ./opts-$DISTRO.sh
|
|
|
|
|
|
|
|
fpm -s dir -C ./staging -n $PACKAGE \
|
|
|
|
--version $VERSION --epoch $EPOCH \
|
|
|
|
--after-install after-install.sh \
|
|
|
|
--before-install before-install.sh \
|
|
|
|
--before-remove before-remove.sh \
|
|
|
|
--description "BigBlueButton Webhooks" \
|
|
|
|
$DIRECTORIES \
|
2022-04-26 03:04:38 +08:00
|
|
|
$OPTS \
|
2023-09-02 18:49:29 +08:00
|
|
|
-d 'nodejs (>= 18)' -d 'nodejs (<< 20)'
|