Index: www/nextcloud/Makefile =================================================================== --- www/nextcloud/Makefile +++ www/nextcloud/Makefile @@ -2,6 +2,7 @@ PORTNAME= nextcloud DISTVERSION= 14.0.1 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= https://download.nextcloud.com/server/releases/ PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX} @@ -22,7 +23,7 @@ WRKSRC= ${WRKDIR}/${PORTNAME} NO_BUILD= yes NO_ARCH= yes -SUB_FILES= pkg-message +SUB_FILES= config.sample.php pkg-message PLIST_SUB= NEXTCLOUD_USERNAME=${NEXTCLOUD_USERNAME} \ NEXTCLOUD_GROUPNAME=${NEXTCLOUD_GROUPNAME} @@ -67,15 +68,21 @@ . endif .endif +post-extract: + @${MV} ${WRKSRC}/config/config.sample.php ${WRKSRC}/config/config.documented.php + post-patch: - @${REINPLACE_CMD} -e 's|/var/www/${PORTNAME}|${WWWDIR}|' ${WRKSRC}/config/config.sample.php + @${REINPLACE_CMD} -e 's|/var/www/${PORTNAME}|${WWWDIR}|;s|/var/log/|/var/log/${PORTNAME}/|' \ + ${WRKSRC}/config/config.documented.php @${MV} ${WRKSRC}/apps ${WRKSRC}/apps-pkg do-install: @${MKDIR} -m 0755 ${STAGEDIR}${WWWDIR} @cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR} + @${INSTALL_SCRIPT} ${WRKDIR}/config.sample.php ${STAGEDIR}${WWWDIR}/config/config.sample.php @${RM} ${STAGEDIR}${WWWDIR}/updater/updater.phar @${MKDIR} ${STAGEDIR}${WWWDIR}/data @${MKDIR} ${STAGEDIR}${WWWDIR}/apps + @${MKDIR} ${STAGEDIR}/var/log/${PORTNAME} .include Index: www/nextcloud/files/config.sample.php.in =================================================================== --- /dev/null +++ www/nextcloud/files/config.sample.php.in @@ -0,0 +1,32 @@ + + array ( + 0 => + array ( + 'path' => '%%WWWDIR%%/apps', + 'url' => '/apps', + 'writable' => true, + ), + 1 => + array ( + 'path' => '%%WWWDIR%%/apps-pkg', + 'url' => '/apps-pkg', + 'writable' => false, + ), + ), + +/** Log-files belong in the appropriate location + */ + 'logfile' => '/var/log/nextcloud/nextcloud.log', +); Index: www/nextcloud/files/patch-config_config.documented.php =================================================================== --- www/nextcloud/files/patch-config_config.documented.php +++ www/nextcloud/files/patch-config_config.documented.php @@ -1,5 +1,5 @@ ---- config/config.sample.php.orig 2018-03-13 18:47:31 UTC -+++ config/config.sample.php +--- config/config.documented.php.orig 2018-03-13 18:47:31 UTC ++++ config/config.documented.php @@ -818,6 +818,11 @@ $CONFIG = array( 'url' => '/apps', 'writable' => true, Index: www/nextcloud/files/patch-config_config.sample.php =================================================================== --- www/nextcloud/files/patch-config_config.sample.php +++ www/nextcloud/files/patch-config_config.sample.php @@ -1,14 +0,0 @@ ---- config/config.sample.php.orig 2018-03-13 18:47:31 UTC -+++ config/config.sample.php -@@ -818,6 +818,11 @@ $CONFIG = array( - 'url' => '/apps', - 'writable' => true, - ), -+ array( -+ 'path'=> '/var/www/nextcloud/apps-pkg', -+ 'url' => '/apps-pkg', -+ 'writable' => false, -+ ), - ), - - /** Index: www/nextcloud/files/pkg-message.in =================================================================== --- www/nextcloud/files/pkg-message.in +++ www/nextcloud/files/pkg-message.in @@ -4,8 +4,8 @@ Please note that everything has been installed in %%WWWDIR%%. -You will probably want to add an alias to your httpd.conf file, something -like this: +You will probably want to add an alias to your httpd.conf file, +something like this: Alias /nextcloud %%WWWDIR%% AcceptPathInfo On @@ -19,6 +19,9 @@ The caching options require additional Nextcloud configuration, see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/caching_configuration.html +/!\ The FreeBSD package REQUIRES the apps_paths configuration as /!\ +/!\ seen in config/config.sample.php to function /!\ + *********************************************************************** * NEXTCLOUD VERSION UPGRADE * *********************************************************************** Index: www/nextcloud/pkg-plist =================================================================== --- www/nextcloud/pkg-plist +++ www/nextcloud/pkg-plist @@ -1,4 +1,4 @@ -@(root,%%NEXTCLOUD_GROUPNAME%%,644) %%WWWDIR%%/.htaccess +@(,%%NEXTCLOUD_GROUPNAME%%,644) %%WWWDIR%%/.htaccess @(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,664) %%WWWDIR%%/.user.ini %%WWWDIR%%/3rdparty/.drone.yml %%WWWDIR%%/3rdparty/.gitignore @@ -10630,12 +10630,9 @@ %%WWWDIR%%/apps-pkg/workflowengine/lib/Manager.php %%WWWDIR%%/apps-pkg/workflowengine/lib/Settings/Section.php %%WWWDIR%%/apps-pkg/workflowengine/templates/admin.php -@group %%NEXTCLOUD_GROUPNAME%% -%%WWWDIR%%/config/.htaccess -@owner %%NEXTCLOUD_USERNAME%% -%%WWWDIR%%/config/config.sample.php -@owner -@group +@(,%%NEXTCLOUD_GROUPNAME%%,644) %%WWWDIR%%/config/.htaccess +@sample(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,640) %%WWWDIR%%/config/config.sample.php %%WWWDIR%%/config/config.php +%%WWWDIR%%/config/config.documented.php %%WWWDIR%%/console.php %%WWWDIR%%/core/Application.php %%WWWDIR%%/core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php @@ -13299,6 +13296,9 @@ %%WWWDIR%%/version.php @dir %%WWWDIR%%/apps-pkg @dir %%WWWDIR%%/apps-pkg/gallery/documentation/wiki -@dir(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,) %%WWWDIR%%/apps -@dir(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,) %%WWWDIR%%/config -@dir(%%NEXTCLOUD_USERNAME%%,%%NEXTCLOUD_GROUPNAME%%,) %%WWWDIR%%/data +@owner %%NEXTCLOUD_USERNAME%% +@group %%NEXTCLOUD_GROUPNAME%% +@dir %%WWWDIR%%/apps +@dir %%WWWDIR%%/config +@dir %%WWWDIR%%/data +@dir /var/log/nextcloud