diff --git a/manifest.json b/manifest.json index 779dc26..7e0d1ad 100644 --- a/manifest.json +++ b/manifest.json @@ -53,6 +53,16 @@ }, "default": true }, + { + "name": "export", + "type": "string", + "ask": { + "en": "Use AbiWord (~260 Mo) or LibreOffice (~400 Mo) (more stable) to expand export possibilities (PDF, doc)?", + "fr": "Utiliser AbiWord (~260 Mo) ou LibreOffice (~400 Mo) (plus stable) pour étendre les possibilités d'export (PDF, doc) ?" + }, + "choices" : ["none", "abiword", "libreoffice"], + "default" : "none" + }, { "name": "language", "type": "string", diff --git a/scripts/_common.sh b/scripts/_common.sh index 5075c93..0e39512 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,6 +9,12 @@ pkg_dependencies="postgresql postgresql-contrib apt-transport-https" nodejs_version=12 +# Dependencies for AbiWord +abiword_app_depencencies="abiword" + +# Dependencies for LibreOffice +libreoffice_app_dependencies="unoconv libreoffice-writer" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index b416a8c..95fe93b 100644 --- a/scripts/install +++ b/scripts/install @@ -128,7 +128,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # INSTALL ETHERPAD #================================================= -ynh_script_progression --message="Installing Etherpad..." --weight=90 +ynh_script_progression --message="Installing Etherpad..." --weight=60 chown -R $app: $final_path @@ -147,6 +147,19 @@ cp ../conf/settings.json $final_path/settings.json ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/settings.json" ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/settings.json" +if [ "$export" = "abiword" ] +then + # Get AbiWord binary path + abiword_path=`which abiword` + # Set the path of abiword into Etherpad config + ynh_replace_string --match_string="\"abiword\" : null" --replace_string="\"abiword\" : \"$abiword_path\"" --target_file="$final_path/settings.json" +elif [ "$export" = "libreoffice" ] +then + # Get soffice binary path + soffice_path=`which soffice` + # Set the path of soffice into Etherpad config + ynh_replace_string --match_string="\"soffice\" : null" --replace_string="\"soffice\" : \"$soffice_path\"" --target_file="$final_path/settings.json" +fi cp ../conf/credentials.json $final_path/credentials.json