2019-06-06 06:04:22 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# dependencies used by the app
|
2022-02-11 00:47:00 +01:00
|
|
|
pkg_dependencies="openjdk-8-jre-headless|openjdk-11-jre-headless debconf|debconf-2.0 procps uuid-runtime lua-ldap"
|
2019-06-06 06:04:22 +02:00
|
|
|
|
2022-06-09 01:19:53 +02:00
|
|
|
ynh_app_dependencies="prosody"
|
|
|
|
|
2022-04-14 21:12:00 +02:00
|
|
|
if [ $YNH_ARCH == "armhf" ]
|
|
|
|
then
|
2022-04-15 00:22:14 +02:00
|
|
|
pkg_dependencies_arm="automake autoconf build-essential libtool git maven m4"
|
|
|
|
pkg_dependencies="$pkg_dependencies $pkg_dependencies_arm"
|
|
|
|
|
|
|
|
pkg_extra_depedencies_arm="openjdk-8-jre openjdk-8-jre-headless openjdk-8-jdk openjdk-8-jdk-headless"
|
2022-04-14 21:12:00 +02:00
|
|
|
fi
|
2019-06-06 06:04:22 +02:00
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2019-08-25 03:40:54 +02:00
|
|
|
ynh_version_gt ()
|
|
|
|
{
|
|
|
|
dpkg --compare-versions "$1" gt "$2"
|
|
|
|
}
|
|
|
|
|
2022-04-14 20:39:43 +02:00
|
|
|
ynh_jniwrapper_armhf ()
|
|
|
|
{
|
2022-04-14 20:48:01 +02:00
|
|
|
|
2022-04-14 20:39:43 +02:00
|
|
|
# set openjdk-8 as default
|
2022-04-14 21:23:31 +02:00
|
|
|
# update-alternatives --set java /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java
|
2022-04-14 20:39:43 +02:00
|
|
|
tempdir="$(mktemp -d)"
|
|
|
|
|
|
|
|
# prepare jniwrapper compilation
|
|
|
|
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-armhf
|
|
|
|
|
|
|
|
declare -A packages_arm
|
|
|
|
packages_arm[jitsi-sctp]="jitsi-sctp"
|
2022-04-15 00:07:38 +02:00
|
|
|
packages_arm[usrsctp]="jitsi-sctp/usrsctp/usrsctp"
|
2022-04-14 20:39:43 +02:00
|
|
|
|
2022-04-14 21:50:51 +02:00
|
|
|
for package_arm in "${!packages_arm[@]}"
|
2022-04-14 20:39:43 +02:00
|
|
|
do
|
2022-04-14 21:50:51 +02:00
|
|
|
ynh_setup_source --dest_dir="$tempdir/${packages_arm[$package_arm]}" --source_id=$package_arm
|
2022-04-14 20:39:43 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# needed to make compile works
|
|
|
|
if [ ! -d "$tempdir/jitsi-sctp/jniwrapper/native/src/main/resources/lib/linux-arm/" ]
|
|
|
|
then
|
|
|
|
mkdir -p $tempdir/jitsi-sctp/jniwrapper/native/src/main/resources/lib/linux-arm/
|
|
|
|
fi
|
|
|
|
|
|
|
|
pushd "$tempdir/jitsi-sctp"
|
|
|
|
mvn package -DbuildSctp -DbuildNativeWrapper -DdeployNewJnilib -DskipTests
|
|
|
|
mvn package
|
|
|
|
popd
|
|
|
|
|
2022-04-15 14:38:55 +02:00
|
|
|
# rm official jniwrapper to copy
|
2022-04-15 15:06:38 +02:00
|
|
|
original_jniwrapper=$(ls $final_path/jitsi-videobridge/lib/jniwrapper-native-*.jar)
|
2022-04-15 14:38:55 +02:00
|
|
|
ynh_secure_remove --file="$original_jniwrapper"
|
|
|
|
|
2022-04-14 20:39:43 +02:00
|
|
|
mv "$tempdir/jitsi-sctp/jniwrapper/native/target/jniwrapper-native-1.0-SNAPSHOT.jar" "$final_path/jitsi-videobridge/lib/"
|
|
|
|
|
2022-04-15 02:41:42 +02:00
|
|
|
chmod 640 "$final_path/jitsi-videobridge/lib/jniwrapper-native-1.0-SNAPSHOT.jar"
|
|
|
|
chown -R $app:$app "$final_path/jitsi-videobridge/lib/jniwrapper-native-1.0-SNAPSHOT.jar"
|
|
|
|
|
2022-04-14 20:39:43 +02:00
|
|
|
ynh_secure_remove --file="$tempdir"
|
|
|
|
}
|
|
|
|
|
2019-06-06 06:04:22 +02:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|