mirror of
https://github.com/YunoHost-Apps/limesurvey_ynh.git
synced 2024-09-03 19:36:32 +02:00
[fix] Use github link for source file
- Fix https://github.com/YunoHost-Apps/limesurvey_ynh/issues/17 - Here get a specific commit (specific command action for plugin)
This commit is contained in:
parent
3a5de2c49d
commit
d065dbbb32
4 changed files with 22 additions and 22 deletions
6
app.src
6
app.src
|
@ -1,3 +1,3 @@
|
||||||
SOURCE_URL=https://www.limesurvey.org/stable-release?download=1994:limesurvey2622%20170203targz
|
SOURCE_URL=https://github.com/LimeSurvey/LimeSurvey/archive/a46075a10b6244c850ee11dcf283d38bdd7d8ad5.tar.gz
|
||||||
SOURCE_SUM=04aef224292ebacbfdf5c92cedc94de2f5900688bde33481a8908b15023df933
|
SOURCE_SUM=b06778cd6747e4106953810d5aefe9f12d968a3910ce48159bcbb2fe5a61d486
|
||||||
SOURCE_FILE=limesurvey2.62.2+170203.tar.gz
|
SOURCE_FILE=limesurvey_2.6.2.1.tar.gz
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "LimeSurvey",
|
"name": "LimeSurvey",
|
||||||
"id": "limesurvey",
|
"id": "limesurvey",
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"version": "2.62.2",
|
"version": "2.62.2.1",
|
||||||
"description": {
|
"description": {
|
||||||
"en": "LimeSurvey is used to create advanced poll.",
|
"en": "LimeSurvey is used to create advanced poll.",
|
||||||
"fr": "LimeSurvey est un outil de création et diffusion de sondage en ligne."
|
"fr": "LimeSurvey est un outil de création et diffusion de sondage en ligne."
|
||||||
|
|
|
@ -7,14 +7,14 @@ ynh_check_var () {
|
||||||
test -n "$1" || ynh_die "$2"
|
test -n "$1" || ynh_die "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
ynh_exit_properly () {
|
ynh_exit_properly () {
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
if [ "$exit_code" -eq 0 ]; then
|
if [ "$exit_code" -eq 0 ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
trap '' EXIT
|
trap '' EXIT
|
||||||
set +eu
|
set +eu
|
||||||
echo -e "\e[91m \e[1m"
|
echo -e "\e[91m \e[1m"
|
||||||
err "$app script has encountered an error."
|
err "$app script has encountered an error."
|
||||||
|
|
||||||
if type -t CLEAN_SETUP > /dev/null; then
|
if type -t CLEAN_SETUP > /dev/null; then
|
||||||
|
@ -89,7 +89,7 @@ ynh_local_path_available () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Save listed var in YunoHost app settings
|
# Save listed var in YunoHost app settings
|
||||||
# usage: ynh_save_args VARNAME1 [VARNAME2 [...]]
|
# usage: ynh_save_args VARNAME1 [VARNAME2 [...]]
|
||||||
ynh_save_args () {
|
ynh_save_args () {
|
||||||
for var in $@;
|
for var in $@;
|
||||||
|
@ -113,7 +113,7 @@ ynh_mysql_generate_db () {
|
||||||
|
|
||||||
export db_pwd=$(ynh_string_random) # Generate a random password
|
export db_pwd=$(ynh_string_random) # Generate a random password
|
||||||
ynh_check_var "$db_pwd" "db_pwd empty"
|
ynh_check_var "$db_pwd" "db_pwd empty"
|
||||||
|
|
||||||
ynh_mysql_create_db "$db_name" "$db_user" "$db_pwd" # Create the database
|
ynh_mysql_create_db "$db_name" "$db_user" "$db_pwd" # Create the database
|
||||||
|
|
||||||
ynh_app_setting_set $app mysqlpwd $db_pwd # Store the password in the app's config
|
ynh_app_setting_set $app mysqlpwd $db_pwd # Store the password in the app's config
|
||||||
|
@ -161,9 +161,9 @@ ynh_setup_source () {
|
||||||
fi
|
fi
|
||||||
echo "$SOURCE_SUM $SOURCE_FILE" |$SUM_PRG -c --status \
|
echo "$SOURCE_SUM $SOURCE_FILE" |$SUM_PRG -c --status \
|
||||||
|| ynh_die "Corrupt source"
|
|| ynh_die "Corrupt source"
|
||||||
|
|
||||||
sudo mkdir -p "$DEST"
|
sudo mkdir -p "$DEST"
|
||||||
sudo chown $AS_USER: "$DEST"
|
sudo chown $AS_USER: "$DEST"
|
||||||
if [ "$(echo ${SOURCE_FILE##*.})" == "gz" ]; then
|
if [ "$(echo ${SOURCE_FILE##*.})" == "gz" ]; then
|
||||||
ynh_exec_as "$AS_USER" tar xf $SOURCE_FILE -C "$DEST" --strip-components 1
|
ynh_exec_as "$AS_USER" tar xf $SOURCE_FILE -C "$DEST" --strip-components 1
|
||||||
elif [ "$(echo ${SOURCE_FILE##*.})" == "bz2" ]; then
|
elif [ "$(echo ${SOURCE_FILE##*.})" == "bz2" ]; then
|
||||||
|
@ -171,18 +171,18 @@ ynh_setup_source () {
|
||||||
elif [ "$(echo ${SOURCE_FILE##*.})" == "zip" ]; then
|
elif [ "$(echo ${SOURCE_FILE##*.})" == "zip" ]; then
|
||||||
mkdir -p "/tmp/$SOURCE_FILE"
|
mkdir -p "/tmp/$SOURCE_FILE"
|
||||||
ynh_exec_as "$AS_USER" unzip -q $SOURCE_FILE -d "/tmp/$SOURCE_FILE"
|
ynh_exec_as "$AS_USER" unzip -q $SOURCE_FILE -d "/tmp/$SOURCE_FILE"
|
||||||
ynh_exec_as "$AS_USER" mv "/tmp/$SOURCE_FILE"/./. "$DEST"
|
ynh_exec_as "$AS_USER" mv "/tmp/$SOURCE_FILE"/./. "$DEST"
|
||||||
rmdir "$/tmp/$SOURCE_FILE"
|
rmdir "$/tmp/$SOURCE_FILE"
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply patches
|
# Apply patches
|
||||||
if [ -f ${PKG_DIR}/patches/$SOURCE_ID-*.patch ]; then
|
if [ -f ${PKG_DIR}/patches/$SOURCE_ID-*.patch ]; then
|
||||||
(cd "$DEST" \
|
(cd "$DEST" \
|
||||||
&& for p in ${PKG_DIR}/patches/$SOURCE_ID-*.patch; do \
|
&& for p in ${PKG_DIR}/patches/$SOURCE_ID-*.patch; do \
|
||||||
ynh_exec_as "$AS_USER" patch -p1 < $p; done) \
|
ynh_exec_as "$AS_USER" patch -p1 < $p; done) \
|
||||||
|| ynh_die "Unable to apply patches"
|
|| ynh_die "Unable to apply patches"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -324,13 +324,13 @@ Homepage: {{ project_url }}
|
||||||
Standards-Version: 3.9.2
|
Standards-Version: 3.9.2
|
||||||
|
|
||||||
Package: {{ dep_app }}-ynh-deps
|
Package: {{ dep_app }}-ynh-deps
|
||||||
Version: {{ version }}
|
Version: {{ version }}
|
||||||
Depends: {{ dependencies }}
|
Depends: {{ dependencies }}
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Description: meta package for {{ app }} (YunoHost app) dependencies
|
Description: meta package for {{ app }} (YunoHost app) dependencies
|
||||||
This meta-package is only responsible of installing its dependencies.
|
This meta-package is only responsible of installing its dependencies.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ynh_configure app-ynh-deps.control ./$dep_app-ynh-deps.control
|
ynh_configure app-ynh-deps.control ./$dep_app-ynh-deps.control
|
||||||
ynh_package_install_from_equivs ./$dep_app-ynh-deps.control \
|
ynh_package_install_from_equivs ./$dep_app-ynh-deps.control \
|
||||||
|| ynh_die "Unable to install dependencies"
|
|| ynh_die "Unable to install dependencies"
|
||||||
|
@ -387,11 +387,11 @@ ynh_configure_php_fpm () {
|
||||||
finalphpconf=/etc/php5/fpm/pool.d/$app.conf
|
finalphpconf=/etc/php5/fpm/pool.d/$app.conf
|
||||||
ynh_configure php-fpm.conf /etc/php5/fpm/pool.d/$app.conf
|
ynh_configure php-fpm.conf /etc/php5/fpm/pool.d/$app.conf
|
||||||
sudo chown root: $finalphpconf
|
sudo chown root: $finalphpconf
|
||||||
|
|
||||||
finalphpini=/etc/php5/fpm/conf.d/20-$app.ini
|
finalphpini=/etc/php5/fpm/conf.d/20-$app.ini
|
||||||
sudo cp ../conf/php-fpm.ini $finalphpini
|
sudo cp ../conf/php-fpm.ini $finalphpini
|
||||||
sudo chown root: $finalphpini
|
sudo chown root: $finalphpini
|
||||||
|
|
||||||
sudo service php5-fpm reload
|
sudo service php5-fpm reload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,10 @@ ynh_mysql_generate_db "$user" "$app"
|
||||||
ynh_system_user_create "$user" "$local_path"
|
ynh_system_user_create "$user" "$local_path"
|
||||||
|
|
||||||
ynh_setup_source "$local_path" "$user"
|
ynh_setup_source "$local_path" "$user"
|
||||||
|
|
||||||
ynh_configure config.php "$local_path/application/config/config.php"
|
ynh_configure config.php "$local_path/application/config/config.php"
|
||||||
|
|
||||||
# Fill LimeSurvey database
|
# Fill LimeSurvey database @todo replace by command action from limesurvey
|
||||||
sed "s/\`prefix_/\`$prefix/g" $local_path/installer/sql/create-mysql.sql > ./structure.sql
|
sed "s/\`prefix_/\`$prefix/g" $local_path/installer/sql/create-mysql.sql > ./structure.sql
|
||||||
mysql -u $db_user -p$db_pwd $db_user < ./structure.sql
|
mysql -u $db_user -p$db_pwd $db_user < ./structure.sql
|
||||||
ynh_configure data.sql ./data.sql
|
ynh_configure data.sql ./data.sql
|
||||||
|
@ -53,10 +53,10 @@ set -x
|
||||||
ynh_set_default_perm $local_path
|
ynh_set_default_perm $local_path
|
||||||
sudo chmod -R u+w $local_path/tmp
|
sudo chmod -R u+w $local_path/tmp
|
||||||
sudo chmod -R u+w $local_path/upload
|
sudo chmod -R u+w $local_path/upload
|
||||||
sudo chmod -R u+w $local_path/application/config/
|
#~ sudo chmod -R u+w $local_path/application/config/
|
||||||
|
|
||||||
sudo yunohost app addaccess $app -u $admin
|
sudo yunohost app addaccess $app -u $admin
|
||||||
ynh_sso_access "/index.php?r=admin,/index.php?r=plugins,/scripts"
|
ynh_sso_access "/index.php?r=admin"
|
||||||
|
|
||||||
ynh_configure_php_fpm
|
ynh_configure_php_fpm
|
||||||
ynh_configure_nginx
|
ynh_configure_nginx
|
||||||
|
|
Loading…
Add table
Reference in a new issue