aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-06-25 01:42:19 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-06-25 02:42:48 +0200
commitedde9744d2bfbb742772710f4f9d07e2e184e947 (patch)
tree2ec23aea392efc803f318f77a76f8b3f3ae8fc69 /community
parentae8f222e196e992f376395f6bdb1d6581fb6c863 (diff)
downloadaports-edde9744d2bfbb742772710f4f9d07e2e184e947.tar.bz2
aports-edde9744d2bfbb742772710f4f9d07e2e184e947.tar.xz
community/nextcloud: move almost all apps to subpackages
Diffstat (limited to 'community')
-rw-r--r--community/nextcloud/APKBUILD147
-rw-r--r--community/nextcloud/app-encryption-info-add-mcrypt.patch14
-rw-r--r--community/nextcloud/nextcloud.post-upgrade28
3 files changed, 106 insertions, 83 deletions
diff --git a/community/nextcloud/APKBUILD b/community/nextcloud/APKBUILD
index 693dcdddc4..b3541c2a11 100644
--- a/community/nextcloud/APKBUILD
+++ b/community/nextcloud/APKBUILD
@@ -1,4 +1,5 @@
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=nextcloud
pkgver=12.0.0
pkgrel=2
@@ -10,14 +11,13 @@ _php=php7
_php_mods="-ctype -curl -dom -gd -fileinfo -iconv -json -mbstring -openssl
-posix -session -simplexml -xml -xmlreader -xmlwriter -zlib -zip"
depends="$_php ${_php_mods//-/$_php-}"
-_apps="-activity -encryption -firstrunwizard -gallery -ldap -logreader -mysql
- -notifications -password_policy -pdfviewer -pgsql -sqlite -texteditor
- -videoplayer"
install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-upgrade"
-subpackages="$pkgname-initscript ${_apps//-/$pkgname-}"
+subpackages="$pkgname-initscript $pkgname-mysql $pkgname-pgsql $pkgname-sqlite
+ $pkgname-default-apps:_default_apps"
source="https://download.nextcloud.com/server/releases/$pkgname-$pkgver.zip
nextcloud10-dont-chmod-config.patch
dont-update-htaccess.patch
+ app-encryption-info-add-mcrypt.patch
$pkgname-config.php
$pkgname.logrotate
$pkgname.confd
@@ -27,6 +27,44 @@ pkgusers="nextcloud"
pkggroups="www-data"
builddir="$srcdir"/$pkgname
+# List of bundled apps to separate into subpackages. Keep it in sync!
+# Note: Don't add "files" and "dav" here, these should be always installed.
+_apps="activity
+ admin_audit
+ comments
+ encryption
+ federatedfilesharing
+ federation
+ files_external
+ files_pdfviewer
+ files_sharing
+ files_texteditor
+ files_trashbin
+ files_versions
+ files_videoplayer
+ firstrunwizard
+ gallery
+ logreader
+ lookup_server_connector
+ nextcloud_announcements
+ notifications
+ oauth2
+ password_policy
+ provisioning_api
+ serverinfo
+ sharebymail
+ survey_client
+ systemtags
+ theming
+ twofactor_backupcodes
+ user_external
+ user_ldap
+ workflowengine
+ "
+for _i in $_apps; do
+ subpackages="$subpackages $pkgname-$_i:_package_app"
+done
+
# Directory for apps shipped with Nextcloud.
_appsdir="usr/share/webapps/$pkgname/apps"
@@ -112,89 +150,50 @@ mysql() {
mkdir -p "$subpkgdir"
}
-activity() {
- pkgdesc="Nextcloud Activity app"
- depends="$pkgname"
- _mv_app pkg activity
-}
-
-encryption() {
- pkgdesc="Nextcloud Encryption app"
- depends="$pkgname $_php-mcrypt"
- _mv_app pkg encryption
-}
-
-firstrunwizard() {
- pkgdesc="Nextcloud Firstrunwizard app"
- depends="$pkgname"
- _mv_app pkg firstrunwizard
-}
-
-gallery() {
- pkgdesc="Nextcloud Gallery app"
- depends="$pkgname"
- _mv_app pkg gallery
-}
-
-ldap() {
- pkgdesc="Nextcloud LDAP auth backend support"
- depends="$pkgname $_php-ldap"
- _mv_app pkg user_ldap
-}
-
-logreader() {
- pkgdesc="Nextcloud Log Reader app"
- depends="$pkgname"
- _mv_app pkg logreader
-}
-
-notifications() {
- pkgdesc="Nextcloud Email notification support"
- depends="$pkgname"
- _mv_app pkg notifications
-}
-
-password_policy() {
- pkgdesc="Nextcloud Password Policy app"
+_default_apps() {
+ pkgdesc="Nextcloud default apps"
depends="$pkgname"
- _mv_app pkg password_policy
-}
-pdfviewer() {
- pkgdesc="Nextcloud integrated PDF viewer"
- depends="$pkgname"
- _mv_app pkg files_pdfviewer
-}
+ local path; for path in "$pkgdir"/$_appsdir/*; do
+ if grep -q '<default_enable\s*/>' "$path"/appinfo/info.xml; then
+ depends="$depends $pkgname-${path##*/}"
+ fi
+ done
-texteditor() {
- pkgdesc="Nextcloud Text Editor app"
- depends="$pkgname"
- _mv_app pkg files_texteditor
-}
-
-videoplayer() {
- pkgdesc="Nextcloud Video Viewer app"
- depends="nextcloud"
- provides="$pkgname-videoviewer"
- _mv_app pkg files_videoplayer
+ mkdir -p "$subpkgdir"
}
-_mv_app() {
- local from="$1"
- local dirname="$2"
+_package_app() {
local appname="${subpkgname#$pkgname-}"
+ local appinfo="$pkgdir/$_appsdir/$appname/appinfo/info.xml"
+
+ local name=$(xmlstarlet sel -t -v 'info/name/text()' "$appinfo")
+ pkgdesc="Nextcloud ${name:-$appname} app"
+
+ local php_deps=$(xmlstarlet sel -t -v 'info/dependencies/lib/text()' "$appinfo" \
+ | xargs -r -n1 printf "$_php-%s\n")
+ depends="$pkgname $php_deps"
+
+ # XXX: Provides/replaces for backward compatibility with <12.0.0-r2.
+ case "$appname" in
+ files_pdfviewer | files_texteditor | files_videoplayer)
+ provides="$pkgname-${appname#files_}"
+ replaces="$provides"
+ ;;
+ user_ldap)
+ provides="$pkgname-ldap"
+ replaces="$provides"
+ ;;
+ esac
mkdir -p "$subpkgdir"/$_appsdir
-
- case "$from" in
- pkg) mv "$pkgdir"/$_appsdir/$dirname "$subpkgdir"/$_appsdir/;;
- src) mv "$srcdir"/$dirname "$subpkgdir"/$_appsdir/$appname;;
- esac
+ mv "$pkgdir"/$_appsdir/$appname "$subpkgdir"/$_appsdir/
}
sha512sums="0e409eedbcc0f4e1652085c3e384db373858b0cc116c70361a4d066a08afbd6e75792332f95d08773cbed78c1520532886268249d514f2da70acb3ba120420d5 nextcloud-12.0.0.zip
a12a73a38bc009d3307ce97bb32fc62ac93e125a77a3d36b31c9d2212953fa17bd5c31f819e0759a0645b1c285817b067143b0b9c3673ce4ab3043fae426a67c nextcloud10-dont-chmod-config.patch
ec3921d4d463ed82be0be073af8064048a20f638424d1d39ab46db4252036e87ef2614570be91a5cef0c25c6bcaaf1a2725d2468bdb4a0fbee2b504a4dd0fbc8 dont-update-htaccess.patch
+8d3cb1436aa79f1ac0a7b4b3370fcfb5c50dbe811e631cabcb8170fb80da5967a88a15bc39cd04eaccffb3177bdf90fcba2a512e28e034e16d6bc9b445d2d137 app-encryption-info-add-mcrypt.patch
9df8ea433d9fb5578a2de366106aa9004502a92557970ee48f9f3de92705a623a461eb410666f0e55d46023d0a324cd185a0b51957a1b72992779a0f7143d23d nextcloud-config.php
f224d72799ee5819979089eb58978225454223bee597c938681a4f6279eb49297fe9250ac54ccf8bcb33ae262bce43d085affb77723492ee662263710d4008c9 nextcloud.logrotate
35cf156839215113b5d8fb8842b4c1e19a50be3c16be7048879fdd808674e4875dbacf3e2dd884fd182258595b7a137d7d3c2dc602a7ff5613c8b65fae0abe67 nextcloud.confd
diff --git a/community/nextcloud/app-encryption-info-add-mcrypt.patch b/community/nextcloud/app-encryption-info-add-mcrypt.patch
new file mode 100644
index 0000000000..f115fdbead
--- /dev/null
+++ b/community/nextcloud/app-encryption-info-add-mcrypt.patch
@@ -0,0 +1,14 @@
+mcrypt is not required, but it's recommended to increase file encryption
+performance. We're adding it to info.xml just to simplify abuild (all app
+dependencies can be read in info.xml).
+
+--- a/apps/encryption/appinfo/info.xml
++++ b/apps/encryption/appinfo/info.xml
+@@ -24,6 +24,7 @@
+ </types>
+ <dependencies>
+ <lib>openssl</lib>
++ <lib>mcrypt</lib>
+ <nextcloud min-version="12" max-version="12" />
+ </dependencies>
+ <settings>
diff --git a/community/nextcloud/nextcloud.post-upgrade b/community/nextcloud/nextcloud.post-upgrade
index 657f17e0b1..95cf241ccc 100644
--- a/community/nextcloud/nextcloud.post-upgrade
+++ b/community/nextcloud/nextcloud.post-upgrade
@@ -2,18 +2,28 @@
ver_old="$2"
-if [ $(apk version -t "$ver_old" '12.0.0-r2') = '<' ] \
- && [ "$(ls -A /var/lib/nextcloud/apps)" ]
-then
+if [ $(apk version -t "$ver_old" '12.0.0-r2') = '<' ]; then
cat >&2 <<-EOF
*
- * Nextcloud's bundled apps have been moved from /var/lib/nextcloud/apps
- * to /usr/share/webapps/nextcloud/apps. Only apps installed from App Store
- * should be stored in /var/lib/nextcloud/apps.
+ * All Nextcloud's bundled apps (except "files" and "dav") have been moved to
+ * separate subpackages (e.g. nextcloud-activity). If you want to install
+ * all apps that are enabled by default at once, run:
*
- * It seems that you have installed some apps from App Store, so you have to
- * add /var/lib/nextcloud/apps to your apps_paths. Copy "apps_paths" key
- * from /etc/nextcloud/config.php.apk-new to your config.php.
+ * apk add nextcloud-default-apps
*
EOF
+
+ if [ "$(ls -A /var/lib/nextcloud/apps)" ]; then
+ cat >&2 <<-EOF
+ *
+ * Nextcloud's bundled apps have been moved from /var/lib/nextcloud/apps
+ * to /usr/share/webapps/nextcloud/apps. Only apps installed from App Store
+ * should be stored in /var/lib/nextcloud/apps.
+ *
+ * It seems that you have installed some apps from App Store, so you have to
+ * add /var/lib/nextcloud/apps to your apps_paths. Copy "apps_paths" key
+ * from /etc/nextcloud/config.php.apk-new to your config.php.
+ *
+ EOF
+ fi
fi