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
|
|
|
|
DIRS="/usr/local/bigbluebutton/core \
|
|
|
|
/etc/logrotate.d \
|
|
|
|
/var/bigbluebutton/recording/status/ended \
|
|
|
|
/var/bigbluebutton/captions/inbox \
|
|
|
|
/var/bigbluebutton/recording/status"
|
|
|
|
for dir in $DIRS; do
|
|
|
|
mkdir -p staging$dir
|
|
|
|
done
|
|
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
mkdir -p staging/var/log/bigbluebutton
|
|
|
|
cp -r scripts lib Gemfile Gemfile.lock staging/usr/local/bigbluebutton/core
|
|
|
|
|
2022-03-24 03:50:26 +08:00
|
|
|
pushd staging/usr/local/bigbluebutton/core
|
2022-03-30 00:52:12 +08:00
|
|
|
bundle config set --local deployment true
|
2022-03-29 23:28:02 +08:00
|
|
|
bundle install
|
|
|
|
# Remove unneeded files to reduce package size
|
|
|
|
bundle clean
|
|
|
|
rm -r vendor/bundle/ruby/*/cache
|
|
|
|
find vendor/bundle -name '*.o' -delete
|
2024-05-28 22:24:27 +08:00
|
|
|
chmod -R a+rX .
|
2024-05-16 02:36:11 +08:00
|
|
|
find vendor/bundle/ruby/*/gems/resque-*/lib/resque/server/public -type f -name "*.png" -execdir chmod 0644 {} \;
|
|
|
|
find vendor/bundle/ruby/*/gems/resque-*/bin -type f -execdir chmod 0755 {} \;
|
2022-03-24 03:50:26 +08:00
|
|
|
popd
|
2021-08-13 18:53:18 +08:00
|
|
|
|
2022-03-24 03:50:26 +08:00
|
|
|
cp Rakefile staging/usr/local/bigbluebutton/core
|
2021-08-13 18:53:18 +08:00
|
|
|
cp bbb-record-core.logrotate staging/etc/logrotate.d
|
|
|
|
|
2022-03-29 23:28:02 +08:00
|
|
|
SYSTEMDSYSTEMUNITDIR=$(pkg-config --variable systemdsystemunitdir systemd)
|
|
|
|
mkdir -p "staging${SYSTEMDSYSTEMUNITDIR}"
|
|
|
|
cp systemd/* "staging${SYSTEMDSYSTEMUNITDIR}"
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
if [ -f "staging/usr/local/bigbluebutton/core/scripts/basic_stats.nginx" ]; then \
|
2022-03-06 11:51:27 +08:00
|
|
|
mkdir -p staging/usr/share/bigbluebutton/nginx; \
|
|
|
|
mv staging/usr/local/bigbluebutton/core/scripts/basic_stats.nginx staging/usr/share/bigbluebutton/nginx; \
|
2021-08-13 18:53:18 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
##
|
|
|
|
|
|
|
|
. ./opts-$DISTRO.sh
|
|
|
|
|
|
|
|
fpm -s dir -C ./staging -n $PACKAGE \
|
|
|
|
--version $VERSION --epoch $EPOCH \
|
|
|
|
--before-install before-install.sh \
|
|
|
|
--after-install after-install.sh \
|
|
|
|
--before-remove before-remove.sh \
|
|
|
|
--description "BigBlueButton record and playback" \
|
|
|
|
$DIRECTORIES \
|
2023-04-27 04:26:51 +08:00
|
|
|
$OPTS
|