bigbluebutton-Github/build/packages-template/bbb-pads/build.sh
Daniel Schreiber fc33fa599d Fix: File permissions in packages should not depend on umask of build system
If the build system for packages has a umask of `0077`, cloned
repositories will have no permissions for group and other. As the build
scripts for some packages just copy from clone git repos, this will
preserve the permissions in the package and prevent the following
services from startup:

* `bbb-html5`
* `etherpad`
* `bbb-pads`
* `bbb-export-annotations`
* `bbb-rap-*`

This patch grants everyone read permissions to the code in the packages.
2024-05-28 16:24:27 +02:00

45 lines
964 B
Bash
Executable File

#!/bin/bash -ex
TARGET=`basename $(pwd)`
PACKAGE=$(echo $TARGET | cut -d'_' -f1)
VERSION=$(echo $TARGET | cut -d'_' -f2)
DISTRO=$(echo $TARGET | cut -d'_' -f3)
TAG=$(echo $TARGET | cut -d'_' -f4)
#
# Clean up directories
rm -rf staging
#
# package
mkdir -p staging/usr/local/bigbluebutton/bbb-pads
find -maxdepth 1 ! -path . ! -name staging $(printf "! -name %s " $(cat .build-files)) -exec cp -r {} staging/usr/local/bigbluebutton/bbb-pads/ \;
pushd .
cd staging/usr/local/bigbluebutton/bbb-pads/
npm install --production
chmod -R a+rX .
popd
mkdir -p staging/usr/lib/systemd/system
cp bbb-pads.service staging/usr/lib/systemd/system
##
. ./opts-$DISTRO.sh
#
# Build RPM package
fpm -s dir -C ./staging -n $PACKAGE \
--version $VERSION --epoch $EPOCH \
--after-install after-install.sh \
--before-remove before-remove.sh \
--description "BigBlueButton Pads" \
$DIRECTORIES \
$OPTS \
-d 'nodejs (>= 18)' -d 'nodejs (<< 20)'