From 9b9d112927d6cc895bc7847c127ff97630e2a5a5 Mon Sep 17 00:00:00 2001
From: Sunil Mohan Adapa
Date: Sun, 21 Dec 2014 17:24:11 +0530
Subject: [PATCH] Use package framework for installing ownCloud
---
actions/owncloud-setup | 8 --------
plinth/modules/owncloud/owncloud.py | 2 ++
plinth/modules/owncloud/templates/owncloud.html | 8 ++------
3 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/actions/owncloud-setup b/actions/owncloud-setup
index 3b82d0c9e..c221acd2e 100755
--- a/actions/owncloud-setup
+++ b/actions/owncloud-setup
@@ -58,14 +58,6 @@ done
if [ "$owncloud_enable" != "$owncloud_enable_cur" ] ; then
if $owncloud_enable ; then
- # Select postgresql as the backend database for OwnCloud, and
- # make sure its php support is enabled when owncloud is
- # installed.
- DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends \
- install -y postgresql php5-pgsql 2>&1 | logger -t owncloud-setup
- DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends \
- install -y owncloud 2>&1 | logger -t owncloud-setup
-
# Keep existing configuration if it exist
if [ ! -e /etc/owncloud/config.php ] ; then
# Set up postgresql database and user
diff --git a/plinth/modules/owncloud/owncloud.py b/plinth/modules/owncloud/owncloud.py
index 0fc143744..cd3402d8d 100644
--- a/plinth/modules/owncloud/owncloud.py
+++ b/plinth/modules/owncloud/owncloud.py
@@ -23,6 +23,7 @@ from gettext import gettext as _
from plinth import actions
from plinth import cfg
+from plinth import package
from plinth import service
@@ -47,6 +48,7 @@ def init():
@login_required
+@package.required('postgresql', 'php5-pgsql', 'owncloud')
def index(request):
"""Serve the ownCloud configuration page"""
status = get_status()
diff --git a/plinth/modules/owncloud/templates/owncloud.html b/plinth/modules/owncloud/templates/owncloud.html
index 663e1893f..f18dc211b 100644
--- a/plinth/modules/owncloud/templates/owncloud.html
+++ b/plinth/modules/owncloud/templates/owncloud.html
@@ -27,14 +27,10 @@
ownCloud
-
When enabled, the owncloud installation will be available
+
When enabled, the ownCloud installation will be available
from /owncloud path on the web server.
Visit this URL to set up the initial administration account for
- owncloud.
-
-
Note: Setting up owncloud for the first time might take
- 5 minutes or more, depending on download bandwidth from the
- Debian APT sources.