git: 053deaf42fd2 - main - www/nextcloud: Add occ wrapper
Bernard Spil
brnrd at FreeBSD.org
Sun Sep 12 12:58:53 UTC 2021
The branch main has been updated by brnrd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=053deaf42fd2b9034fc52402296098e023f77fdd
commit 053deaf42fd2b9034fc52402296098e023f77fdd
Author: Bernard Spil <brnrd at FreeBSD.org>
AuthorDate: 2021-09-12 12:58:09 +0000
Commit: Bernard Spil <brnrd at FreeBSD.org>
CommitDate: 2021-09-12 12:58:09 +0000
www/nextcloud: Add occ wrapper
---
www/nextcloud/Makefile | 4 +++-
www/nextcloud/files/occ.in | 13 +++++++++++++
www/nextcloud/files/pkg-message.in | 5 ++---
www/nextcloud/pkg-plist | 1 +
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/www/nextcloud/Makefile b/www/nextcloud/Makefile
index f812e213ba58..d698c562901a 100644
--- a/www/nextcloud/Makefile
+++ b/www/nextcloud/Makefile
@@ -1,5 +1,6 @@
PORTNAME= nextcloud
PORTVERSION= 22.1.1
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= https://download.nextcloud.com/server/releases/
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}
@@ -21,7 +22,7 @@ NEXTCLOUD_GROUPNAME?= ${WWWGRP}
WRKSRC= ${WRKDIR}/${PORTNAME}
NO_BUILD= yes
NO_ARCH= yes
-SUB_FILES= config.sample.php pkg-message plist.post
+SUB_FILES= config.sample.php occ pkg-message plist.post
SUB_LIST= NEXTCLOUD_USERNAME=${NEXTCLOUD_USERNAME} \
NEXTCLOUD_GROUPNAME=${NEXTCLOUD_GROUPNAME}
PLIST_SUB= ${SUB_LIST}
@@ -81,5 +82,6 @@ do-install:
-e '/^\.\/config\/config\.sample\.php/d' \
-e 's,^\.,${WWWDIR_REL},' >> ${TMPPLIST}
${CAT} ${WRKDIR}/plist.post >> ${TMPPLIST}
+ ${INSTALL_SCRIPT} ${WRKDIR}/occ ${STAGEDIR}${LOCALBASE}/bin/occ
.include <bsd.port.mk>
diff --git a/www/nextcloud/files/occ.in b/www/nextcloud/files/occ.in
new file mode 100644
index 000000000000..dbf4550b8c6b
--- /dev/null
+++ b/www/nextcloud/files/occ.in
@@ -0,0 +1,13 @@
+#/bin/sh
+
+args=
+for arg in "$@" ; do
+ if [ "${arg#* }" != "${arg}" ] ; then
+ args="${args} '${arg}'"
+ else
+ args="${args} ${arg}"
+ fi
+done
+
+cd %%WWWDIR%%
+su -m %%NEXTCLOUD_USERNAME%% -c "%%LOCALBASE%%/bin/php %%WWWDIR%%/occ ${args}"
diff --git a/www/nextcloud/files/pkg-message.in b/www/nextcloud/files/pkg-message.in
index 1e835e22317f..ee8ba0865fcb 100644
--- a/www/nextcloud/files/pkg-message.in
+++ b/www/nextcloud/files/pkg-message.in
@@ -36,14 +36,13 @@ EOM
After a version migration you should upgrade your nextcloud instance
using command line:
- cd %%WWWDIR%%
- su -m www -c "php ./occ upgrade"
+ occ upgrade
Merge any changes to %%WWWDIR%%/.htaccess.dist into .htaccess (above the
'#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####' divider if it exists)
and update the dynamic part of the file using the commandline:
- su -m www -c "php ./occ maintenance:update:htaccess"
+ occ maintenance:update:htaccess
EOM
}
]
diff --git a/www/nextcloud/pkg-plist b/www/nextcloud/pkg-plist
index 7b8a705bcc95..2de20e1b633a 100644
--- a/www/nextcloud/pkg-plist
+++ b/www/nextcloud/pkg-plist
@@ -1,3 +1,4 @@
+bin/occ
@sample(,%%NEXTCLOUD_GROUPNAME%%,644) %%WWWDIR%%/.htaccess.dist %%WWWDIR%%/.htaccess
@(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,664) %%WWWDIR%%/.user.ini
@sample %%WWWDIR%%/config/config.sample.php %%WWWDIR%%/config/config.php
More information about the dev-commits-ports-all
mailing list