aboutsummaryrefslogtreecommitdiffstats
path: root/community/nextcloud
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-03-28 13:54:43 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-03-28 18:38:20 +0200
commit4272e802a1be191657becb739e6a248c1d0411a7 (patch)
treea07a25b7c99d7da326957a88173ba49583cf6b2a /community/nextcloud
parent3e272105092cd9804a5a022a188db929ebf440da (diff)
downloadaports-4272e802a1be191657becb739e6a248c1d0411a7.tar.bz2
aports-4272e802a1be191657becb739e6a248c1d0411a7.tar.xz
community/*: move php5 and dependent pkgs from main
There two main reasons for this change: * Active support of PHP 5.x ended on January 2017, security support will end on December 2018. Packages in the main repository should be supported for at least 2 years, this means until first quarter of 2019 for the upcoming v3.6. * php7 and its extensions are currently in the community repository, so we can't use single abuild for both php5-* and php7-* packages (as we do for Python and Lua packages). This change was suggested by @vakartel, approved by @ncopa, @kaniini, and @jirutka.
Diffstat (limited to 'community/nextcloud')
-rw-r--r--community/nextcloud/APKBUILD161
-rw-r--r--community/nextcloud/nextcloud-config.php5
-rw-r--r--community/nextcloud/nextcloud10-dont-chmod-config.patch12
3 files changed, 178 insertions, 0 deletions
diff --git a/community/nextcloud/APKBUILD b/community/nextcloud/APKBUILD
new file mode 100644
index 0000000000..f974d65e68
--- /dev/null
+++ b/community/nextcloud/APKBUILD
@@ -0,0 +1,161 @@
+# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
+pkgname=nextcloud
+pkgver=11.0.2
+pkgrel=2
+pkgdesc="A safe home for all your data"
+url="http://nextcloud.com"
+arch="noarch"
+license="AGPL"
+_php=php5
+depends="$_php ${_php}-ctype ${_php}-curl ${_php}-dom ${_php}-gd ${_php}-iconv
+ ${_php}-json ${_php}-openssl ${_php}-xml ${_php}-xmlreader
+ ${_php}-zlib ${_php}-zip
+ "
+depends_dev=
+makedepends="$depends_dev"
+install=
+options="!check"
+subpackages="$pkgname-doc $pkgname-activity $pkgname-firstrunwizard $pkgname-gallery
+ $pkgname-mysql $pkgname-notifications $pkgname-pdfviewer $pkgname-pgsql
+ $pkgname-sqlite $pkgname-templateeditor $pkgname-texteditor
+ $pkgname-videoplayer"
+
+source="https://download.nextcloud.com/server/releases/$pkgname-$pkgver.zip
+ nextcloud10-dont-chmod-config.patch
+ "
+pkggroups="www-data"
+
+builddir="$srcdir"/$pkgname
+
+_ncbasedir="/var/lib/$pkgname"
+_ncdatadir="$_ncbasedir/data"
+_ncwwwdir="/usr/share/webapps/$pkgname"
+_ncappsdir="$_ncbasedir/apps"
+_ncconfdir="/etc/$pkgname"
+
+
+prepare() {
+ cd "$builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg "Applying patch $i"; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$builddir"
+ return 0
+}
+
+package() {
+ cd "$builddir"
+ for dir in ${_ncconfdir} ${_ncdatadir} ${_ncwwwdir}; do
+ mkdir -p "$pkgdir"$dir || return 1
+ done
+ rm -rf config data
+ mv * "$pkgdir"${_ncwwwdir} || return 1
+ chmod +x "$pkgdir"${_ncwwwdir}/occ || return 1
+ ln -s $_ncconfdir "$pkgdir"${_ncwwwdir}/config || return 1
+ install -m664 .htaccess "$pkgdir"${_ncwwwdir}/.htaccess || return 1
+ install -m664 .user.ini "$pkgdir"${_ncwwwdir}/.user.ini || return 1
+ install -m664 ../../${pkgname}-config.php "$pkgdir"/etc/$pkgname/config.php || return 1
+ mv "$pkgdir"$_ncwwwdir/apps "$pkgdir"$_ncbasedir || return 1
+ ln -s $_ncappsdir "$pkgdir"$_ncwwwdir/apps || return 1
+ install -m775 -g www-data -d "$pkgdir"/var/log/nextcloud
+ for dir in ${_ncconfdir} ${_ncdatadir} ${_ncappsdir}; do
+ chown -R :www-data "$pkgdir"$dir || return 1
+ chmod -R 770 "$pkgdir"$dir || return 1
+ done
+}
+
+doc() {
+ pkgdesc="Nextcloud documentation"
+ depends="nextcloud"
+ mkdir -p "$subpkgdir"/usr/share/doc/nextcloud/core
+ mv "$pkgdir"/usr/share/webapps/nextcloud/core/doc \
+ "$subpkgdir"/usr/share/doc/nextcloud/core
+}
+
+pgsql() {
+ pkgdesc="Nextcloud PostgreSQL support"
+ depends="nextcloud ${_php}-pgsql ${_php}-pdo_pgsql ${_php}-pear-mdb2-driver-pgsql"
+ mkdir -p "$subpkgdir"${_ncwwwdir}
+}
+
+sqlite() {
+ pkgdesc="Nextcloud SQLite support"
+ depends="nextcloud ${_php}-sqlite3 ${_php}-pdo_sqlite"
+ mkdir -p "$subpkgdir"${_ncwwwdir}
+}
+
+mysql() {
+ pkgdesc="Nextcloud MySQL support"
+ depends="nextcloud ${_php}-mysql ${_php}-pdo_mysql ${_php}-pear-mdb2-driver-mysql"
+ mkdir -p "$subpkgdir"${_ncwwwdir}
+}
+
+_mv_app() {
+ mkdir -p "$subpkgdir"${_ncappsdir} || return 1
+ if [ "$1" = "pkg" ]; then
+ mv "$pkgdir"${_ncappsdir}/$2 "$subpkgdir"${_ncappsdir} || return 1
+ elif [ "$1" = "src" ]; then
+ local appname="${subpkgname#$pkgname-}"
+ mv "$srcdir"/$2 "$subpkgdir"${_ncappsdir}/$appname || return 1
+ fi
+ chown -R :www-data "$subpkgdir"${_ncappsdir} || return 1
+ chmod 770 "$subpkgdir"${_ncappsdir} || return 1
+}
+
+activity() {
+ pkgdesc="Nextcloud Activity app"
+ depends="$pkgname"
+ _mv_app pkg activity
+}
+
+firstrunwizard() {
+ pkgdesc="Nextcloud Firstrunwizard app"
+ depends="$pkgname"
+ _mv_app pkg firstrunwizard
+}
+
+gallery() {
+ pkgdesc="Nextcloud integrated gallery application"
+ depends="nextcloud"
+ _mv_app pkg gallery
+}
+
+notifications() {
+ pkgdesc="Nextcloud Email notification support"
+ depends="$pkgname"
+ _mv_app pkg notifications
+}
+
+
+templateeditor() {
+ pkgdesc="Nextcloud Email template editor app"
+ depends="$pkgname"
+ _mv_app pkg templateeditor
+}
+
+pdfviewer() {
+ pkgdesc="Nextcloud integrated PDF viewer"
+ depends="nextcloud"
+ _mv_app pkg files_pdfviewer
+}
+
+texteditor() {
+ pkgdesc="Nextcloud integrated text editor"
+ depends="nextcloud"
+ _mv_app pkg files_texteditor
+}
+
+videoplayer() {
+ pkgdesc="Nextcloud integrated video viewer"
+ depends="nextcloud"
+ provides="$pkgname-videoviewer"
+ _mv_app pkg files_videoplayer
+}
+
+sha512sums="1e36dc0f67d3d7eb4d5dd4759a2537b6e999984c0bb67e05aeb0091ad72ffe07e970125956346a91e7229154524ebbcd508cf7cd0fb52fd4a8c2f71cf35eebf3 nextcloud-11.0.2.zip
+a12a73a38bc009d3307ce97bb32fc62ac93e125a77a3d36b31c9d2212953fa17bd5c31f819e0759a0645b1c285817b067143b0b9c3673ce4ab3043fae426a67c nextcloud10-dont-chmod-config.patch"
diff --git a/community/nextcloud/nextcloud-config.php b/community/nextcloud/nextcloud-config.php
new file mode 100644
index 0000000000..957df795f3
--- /dev/null
+++ b/community/nextcloud/nextcloud-config.php
@@ -0,0 +1,5 @@
+<?php
+$CONFIG = array (
+ 'datadirectory' => '/var/lib/nextcloud/data',
+ 'logfile' => '/var/log/nextcloud/nextcloud.log'
+);
diff --git a/community/nextcloud/nextcloud10-dont-chmod-config.patch b/community/nextcloud/nextcloud10-dont-chmod-config.patch
new file mode 100644
index 0000000000..fac1313848
--- /dev/null
+++ b/community/nextcloud/nextcloud10-dont-chmod-config.patch
@@ -0,0 +1,12 @@
+--- a/lib/private/Config.php
++++ b/lib/private/Config.php
+@@ -229,9 +229,6 @@
+ touch ($this->configFilePath);
+ $filePointer = fopen($this->configFilePath, 'r+');
+
+- // Prevent others not to read the config
+- chmod($this->configFilePath, 0640);
+-
+ // File does not exist, this can happen when doing a fresh install
+ if(!is_resource ($filePointer)) {
+ // TODO fix this via DI once it is very clear that this doesn't cause side effects due to initialization order