mirror of
https://github.com/YunoHost-Apps/piwigo_ynh.git
synced 2024-09-03 20:06:03 +02:00
Fix symbolic links to /home/yunohost.app
This commit is contained in:
parent
86d4bc2833
commit
c8a7c4f7f8
4 changed files with 18 additions and 37 deletions
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Piwigo - a PHP based photo gallery |
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org |
|
||||
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
|
||||
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | This program is free software; you can redistribute it and/or modify |
|
||||
// | it under the terms of the GNU General Public License as published by |
|
||||
// | the Free Software Foundation |
|
||||
// | |
|
||||
// | This program is distributed in the hope that it will be useful, but |
|
||||
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||
// | General Public License for more details. |
|
||||
// | |
|
||||
// | You should have received a copy of the GNU General Public License |
|
||||
// | along with this program; if not, write to the Free Software |
|
||||
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
||||
// | USA. |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
// Recursive call
|
||||
$url = '../';
|
||||
header( 'Request-URI: '.$url );
|
||||
header( 'Content-Location: '.$url );
|
||||
header( 'Location: '.$url );
|
||||
exit();
|
||||
?>
|
|
@ -8,14 +8,21 @@ VERSION="2.8.5"
|
|||
# Remote URL to fetch application source archive
|
||||
APPLICATION_SOURCE_URL="http://piwigo.org/download/dlcounter.php?code=${VERSION}"
|
||||
|
||||
#
|
||||
# Common helpers
|
||||
#
|
||||
|
||||
# Download and extract application sources to the given directory
|
||||
# usage: extract_application_to DESTDIR
|
||||
extract_application() {
|
||||
local DESTDIR=$1
|
||||
archive="${DESTDIR}/application.zip"
|
||||
TMPDIR=$(mktemp -d)
|
||||
chmod 755 $TMPDIR
|
||||
archive="${TMPDIR}/application.zip"
|
||||
wget -q -O "$archive" "$APPLICATION_SOURCE_URL" \
|
||||
|| ynh_die "Unable to download application archive"
|
||||
sudo unzip -qq "$archive" -d "$DESTDIR" \
|
||||
unzip -qq "$archive" -d "$TMPDIR" \
|
||||
|| ynh_die "Unable to extract application archive"
|
||||
rm "$archive"
|
||||
sudo rsync -a "$TMPDIR"/*/* "$DESTDIR"
|
||||
}
|
|
@ -3,6 +3,8 @@
|
|||
# Exit on command errors and treat unset variables as an error
|
||||
set -eu
|
||||
|
||||
shopt -s extglob # sets extended pattern matching options in the bash shell
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
# Source local helpers
|
||||
|
@ -38,16 +40,17 @@ extract_application ..
|
|||
|
||||
# Copy source files
|
||||
src_path=/var/www/$app
|
||||
sudo mkdir -p $src_path/upload
|
||||
sudo cp -a ../piwigo/. $src_path
|
||||
sudo mkdir $src_path
|
||||
sudo cp -a ../!(upload|galleries) $src_path
|
||||
|
||||
datapath=/home/yunohost.app/$app
|
||||
sudo mkdir -p $datapath
|
||||
sudo mkdir -p $datapath/galleries
|
||||
sudo mkdir -p $datapath/upload
|
||||
|
||||
sudo ln -sd $datapath/galleries $src_path/galleries
|
||||
sudo cp -a ../galleries/* $src_path/galleries/
|
||||
sudo ln -sd $datapath/upload $src_path/upload
|
||||
sudo cp ../conf/index.php $src_path/galleries/index.php
|
||||
|
||||
sudo cp -R ../plugins/Ldap_Login $src_path/plugins/Ldap_Login
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@ extract_application ..
|
|||
# Copy source files
|
||||
src_path=/var/www/$app
|
||||
sudo mkdir -p $src_path
|
||||
sudo cp -Raf ../piwigo/!(upload) $src_path
|
||||
sudo cp -Raf ../!(upload|galleries) $src_path
|
||||
sudo cp -Rap ../galleries/* $src_path/galleries/
|
||||
|
||||
datapath=/home/yunohost.app/$app
|
||||
|
||||
|
|
Loading…
Reference in a new issue