aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-06-22 21:32:12 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-06-22 21:39:02 +0200
commita4bfa375739e0b009392cb6aac06b59ff998d0f6 (patch)
tree4a5936ce43057e2f45765465a789e1d65139453d /community
parentbc58a96854e35c9936dd313f084dd8f18bd83a57 (diff)
downloadaports-a4bfa375739e0b009392cb6aac06b59ff998d0f6.tar.bz2
aports-a4bfa375739e0b009392cb6aac06b59ff998d0f6.tar.xz
community/nextcloud: improve abuild
Diffstat (limited to 'community')
-rw-r--r--community/nextcloud/APKBUILD135
-rw-r--r--community/nextcloud/nextcloud.logrotate2
2 files changed, 66 insertions, 71 deletions
diff --git a/community/nextcloud/APKBUILD b/community/nextcloud/APKBUILD
index 84a7f5f441..4ba53f4099 100644
--- a/community/nextcloud/APKBUILD
+++ b/community/nextcloud/APKBUILD
@@ -7,69 +7,59 @@ url="http://nextcloud.com"
arch="noarch"
license="AGPL"
_php=php7
-depends="$_php $_php-ctype $_php-curl $_php-dom $_php-gd $_php-fileinfo
- $_php-iconv $_php-json $_php-mbstring $_php-openssl $_php-posix
- $_php-session $_php-simplexml $_php-xml $_php-xmlreader
- $_php-xmlwriter $_php-zlib $_php-zip
- "
-makedepends="$depends_dev"
-options="!check"
-subpackages="$pkgname-doc $pkgname-initscript $pkgname-activity $pkgname-encryption
- $pkgname-firstrunwizard $pkgname-gallery $pkgname-ldap
- $pkgname-logreader $pkgname-mysql $pkgname-notifications
- $pkgname-password_policy $pkgname-pdfviewer $pkgname-pgsql
- $pkgname-sqlite $pkgname-texteditor $pkgname-videoplayer
- "
-
+_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"
+subpackages="$pkgname-doc $pkgname-initscript ${_apps//-/$pkgname-}"
source="https://download.nextcloud.com/server/releases/$pkgname-$pkgver.zip
nextcloud10-dont-chmod-config.patch
- nextcloud.logrotate
+ $pkgname-config.php
+ $pkgname.logrotate
$pkgname.confd
- fpm-pool.conf
- "
+ fpm-pool.conf"
+options="!check"
pkgusers="nextcloud"
pkggroups="www-data"
builddir="$srcdir"/$pkgname
-_ncbasedir="/var/lib/$pkgname"
-_ncdatadir="$_ncbasedir/data"
-_ncwwwdir="/usr/share/webapps/$pkgname"
-_ncappsdir="$_ncbasedir/apps"
-_ncconfdir="/etc/$pkgname"
-
-build() {
- cd "$builddir"
- return 0
-}
+_basedir="var/lib/$pkgname"
+_appsdir="$_basedir/apps"
package() {
- cd "$builddir"
- for dir in ${_ncconfdir} ${_ncdatadir} ${_ncwwwdir}; do
- mkdir -p "$pkgdir"$dir
- done
- rm -rf config data
- mv * "$pkgdir"${_ncwwwdir}
- chmod +x "$pkgdir"${_ncwwwdir}/occ
- ln -s $_ncconfdir "$pkgdir"${_ncwwwdir}/config
- install -m664 .htaccess "$pkgdir"${_ncwwwdir}/.htaccess
- install -m664 .user.ini "$pkgdir"${_ncwwwdir}/.user.ini
- install -m664 ../../${pkgname}-config.php "$pkgdir"/etc/$pkgname/config.php
- mv "$pkgdir"$_ncwwwdir/apps "$pkgdir"$_ncbasedir
- ln -s $_ncappsdir "$pkgdir"$_ncwwwdir/apps
- install -m775 -g www-data -d "$pkgdir"/var/log/nextcloud
- install -m644 -D "$srcdir"/nextcloud.logrotate "$pkgdir"/etc/logrotate.d/nextcloud
- for dir in ${_ncconfdir} ${_ncdatadir} ${_ncappsdir}; do
- chown -R :www-data "$pkgdir"$dir
- chmod -R 770 "$pkgdir"$dir
- done
-}
-
-doc() {
- pkgdesc="Nextcloud documentation"
- depends="$pkgname"
- mkdir -p "$subpkgdir"/usr/share/doc/nextcloud/core
- mv "$pkgdir"/usr/share/webapps/nextcloud/core/doc \
- "$subpkgdir"/usr/share/doc/nextcloud/core
+ local datadir="$_basedir/data"
+ local wwwdir="usr/share/webapps/$pkgname"
+ local confdir="etc/$pkgname"
+
+ mkdir -p "$pkgdir"
+ cd "$pkgdir"
+
+ mkdir -p ./${wwwdir%/*}
+ cp -a "$builddir" ./$wwwdir
+
+ rm -r ./$wwwdir/config
+ chmod +x ./$wwwdir/occ
+ chmod 664 ./$wwwdir/.htaccess \
+ ./$wwwdir/.user.ini
+
+ install -d -m 770 -g www-data ./$confdir ./$datadir
+
+ install -m664 -g www-data "$srcdir"/$pkgname-config.php ./$confdir/config.php
+ ln -s /$confdir ./$wwwdir/config
+
+ mkdir -p ./${_appsdir%/*}
+ mv "$wwwdir"/apps ./$_appsdir
+ chgrp -R www-data ./$_appsdir
+ chmod -R 770 ./$_appsdir
+ ln -s /$_appsdir ./$wwwdir/apps
+
+ install -m644 -D "$srcdir"/$pkgname.logrotate ./etc/logrotate.d/$pkgname
+ install -m775 -g www-data -d ./var/log/$pkgname
+
+ mkdir -p ./usr/share/doc/$pkgname
+ mv ./$wwwdir/core/doc ./usr/share/doc/$pkgname/core
}
initscript() {
@@ -92,31 +82,19 @@ initscript() {
pgsql() {
pkgdesc="Nextcloud PostgreSQL support"
depends="$pkgname $_php-pgsql $_php-pdo_pgsql"
- mkdir -p "$subpkgdir"${_ncwwwdir}
+ mkdir -p "$subpkgdir"
}
sqlite() {
pkgdesc="Nextcloud SQLite support"
depends="$pkgname $_php-sqlite3 $_php-pdo_sqlite"
- mkdir -p "$subpkgdir"${_ncwwwdir}
+ mkdir -p "$subpkgdir"
}
mysql() {
pkgdesc="Nextcloud MySQL support"
depends="$pkgname $_php-pdo_mysql"
- mkdir -p "$subpkgdir"${_ncwwwdir}
-}
-
-_mv_app() {
- mkdir -p "$subpkgdir"${_ncappsdir}
- if [ "$1" = "pkg" ]; then
- mv "$pkgdir"${_ncappsdir}/$2 "$subpkgdir"${_ncappsdir}
- elif [ "$1" = "src" ]; then
- local appname="${subpkgname#$pkgname-}"
- mv "$srcdir"/$2 "$subpkgdir"${_ncappsdir}/$appname
- fi
- chown -R :www-data "$subpkgdir"${_ncappsdir}
- chmod 770 "$subpkgdir"${_ncappsdir}
+ mkdir -p "$subpkgdir"
}
activity() {
@@ -186,8 +164,25 @@ videoplayer() {
_mv_app pkg files_videoplayer
}
+_mv_app() {
+ local from="$1"
+ local dirname="$2"
+ local appname="${subpkgname#$pkgname-}"
+
+ mkdir -p "$subpkgdir"/$_appsdir
+
+ case "$from" in
+ pkg) mv "$pkgdir"/$_appsdir/$dirname "$subpkgdir"/$_appsdir/;;
+ src) mv "$srcdir"/$dirname "$subpkgdir"/$_appsdir/$appname;;
+ esac
+
+ chown -R :www-data "$subpkgdir"/$_appsdir
+ chmod 770 "$subpkgdir"/$_appsdir
+}
+
sha512sums="0e409eedbcc0f4e1652085c3e384db373858b0cc116c70361a4d066a08afbd6e75792332f95d08773cbed78c1520532886268249d514f2da70acb3ba120420d5 nextcloud-12.0.0.zip
a12a73a38bc009d3307ce97bb32fc62ac93e125a77a3d36b31c9d2212953fa17bd5c31f819e0759a0645b1c285817b067143b0b9c3673ce4ab3043fae426a67c nextcloud10-dont-chmod-config.patch
-80b94b04507502fa80f3473e4ce8041c2e1f832da8a44408f2f1beda4319dddfc55c9e79d80e8e5a5bfecb770820109870f888d2a3eed9ab5981abcd89f0a812 nextcloud.logrotate
+dca5ba4d6e09e762fd1b14e8b253eed0cd26ec28ae7f413b149e64dcdd7409c68ae08a8a38c531ba874d38ebe6a6b70e190a05509260143d9305d66a68eae10a nextcloud-config.php
+f224d72799ee5819979089eb58978225454223bee597c938681a4f6279eb49297fe9250ac54ccf8bcb33ae262bce43d085affb77723492ee662263710d4008c9 nextcloud.logrotate
35cf156839215113b5d8fb8842b4c1e19a50be3c16be7048879fdd808674e4875dbacf3e2dd884fd182258595b7a137d7d3c2dc602a7ff5613c8b65fae0abe67 nextcloud.confd
b5cdccdffb35e868ec1acb15ec2849cc1c2a00f6064ad21eb591b9694e84df4576f03248f5e814000a48c38096a2a1588dfc79be66691415f2f4ef3b4105d032 fpm-pool.conf"
diff --git a/community/nextcloud/nextcloud.logrotate b/community/nextcloud/nextcloud.logrotate
index 9962b3f1af..c5981ccb88 100644
--- a/community/nextcloud/nextcloud.logrotate
+++ b/community/nextcloud/nextcloud.logrotate
@@ -1,4 +1,4 @@
-/var/log/nextcloud/nextcloud.log {
+/var/log/nextcloud/*.log {
daily
rotate 7
compress