diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-06-27 02:24:56 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-06-27 02:32:42 +0200 |
commit | c68b5fa8266ef43cdf2074b92cc2703f693cf502 (patch) | |
tree | a480ce455b0d14a8d9812ef86de448ba523f51d8 /community/nextcloud | |
parent | 8d1bb84e6067f6e1d6fe9a04ea1108228a443177 (diff) | |
download | aports-c68b5fa8266ef43cdf2074b92cc2703f693cf502.tar.bz2 aports-c68b5fa8266ef43cdf2074b92cc2703f693cf502.tar.xz |
community/nextcloud: move docs to separate subpackage
And patch help page to use placeholder text when docs are not installed.
Diffstat (limited to 'community/nextcloud')
-rw-r--r-- | community/nextcloud/APKBUILD | 15 | ||||
-rw-r--r-- | community/nextcloud/use-external-docs-if-local-not-avail.patch | 65 |
2 files changed, 79 insertions, 1 deletions
diff --git a/community/nextcloud/APKBUILD b/community/nextcloud/APKBUILD index 47795ee3ca..d9f9263908 100644 --- a/community/nextcloud/APKBUILD +++ b/community/nextcloud/APKBUILD @@ -13,7 +13,7 @@ _php_mods="-ctype -curl -dom -gd -fileinfo -iconv -json -mbstring -openssl depends="ca-certificates $_php ${_php_mods//-/$_php-}" makedepends="xmlstarlet" install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-upgrade" -subpackages="$pkgname-initscript $pkgname-mysql $pkgname-pgsql $pkgname-sqlite +subpackages="$pkgname-doc $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 @@ -21,6 +21,7 @@ source="https://download.nextcloud.com/server/releases/$pkgname-$pkgver.zip disable-integrity-check-as-default.patch app-encryption-info-add-mcrypt.patch iconv-ascii-translit-not-supported.patch + use-external-docs-if-local-not-avail.patch $pkgname-config.php $pkgname.logrotate $pkgname.confd @@ -109,6 +110,9 @@ package() { rm -r ./$wwwdir/config ln -s /$confdir ./$wwwdir/config + mkdir -p ./usr/share/doc/$pkgname + mv ./$wwwdir/core/doc ./usr/share/doc/$pkgname/core + install -m 660 -o nextcloud -g www-data \ "$srcdir"/$pkgname-config.php ./$confdir/config.php @@ -124,6 +128,14 @@ package() { find . -name .github -type d -prune -exec rm -r {} \; } +doc() { + default_doc + + local target="$subpkgdir"/usr/share/webapps/$pkgname/core/doc + mkdir -p "${target%/*}" + ln -s ../../../doc/$pkgname/core "$target" +} + initscript() { pkgdesc="Init script that runs Nextcloud with php-fpm" depends="$pkgname $_php-fpm" @@ -210,6 +222,7 @@ ec3921d4d463ed82be0be073af8064048a20f638424d1d39ab46db4252036e87ef2614570be91a5c 04783385ca35be9e8b895e91294b082cd2a1f50c4e17dc195901885ecd421db9a6fe45360d7eac623873ae4efad80b92f31ebde59f4ed76d832c8cac450dac85 disable-integrity-check-as-default.patch 8d3cb1436aa79f1ac0a7b4b3370fcfb5c50dbe811e631cabcb8170fb80da5967a88a15bc39cd04eaccffb3177bdf90fcba2a512e28e034e16d6bc9b445d2d137 app-encryption-info-add-mcrypt.patch 9bd1cdb73928d8e746286a8ededf79262835caee8fdb4a18e117535ed95784b5a0b04fad55c720084dd8ae1ed4fe123be55b41d3100c9bb0333af485084bc4b1 iconv-ascii-translit-not-supported.patch +478f5cd7c5d30380ea619d3e8ec623217a06a09b27534266f00297545c7d276b068c5d984673eebc5676e8bac7f45112549498944ce3fa678ac8a69541d7c430 use-external-docs-if-local-not-avail.patch 89c941e2719629ee633421c4c75b55026c1a0a6b255e7f1f2c14612c10325045051b16dc5f17975af4a2a34ec187008de2eb15a53ac4cd06d26a5cbbd79fb73a nextcloud-config.php f224d72799ee5819979089eb58978225454223bee597c938681a4f6279eb49297fe9250ac54ccf8bcb33ae262bce43d085affb77723492ee662263710d4008c9 nextcloud.logrotate 35cf156839215113b5d8fb8842b4c1e19a50be3c16be7048879fdd808674e4875dbacf3e2dd884fd182258595b7a137d7d3c2dc602a7ff5613c8b65fae0abe67 nextcloud.confd diff --git a/community/nextcloud/use-external-docs-if-local-not-avail.patch b/community/nextcloud/use-external-docs-if-local-not-avail.patch new file mode 100644 index 0000000000..19145b5ce1 --- /dev/null +++ b/community/nextcloud/use-external-docs-if-local-not-avail.patch @@ -0,0 +1,65 @@ +From: Jakub Jirutka <jakub@jirutka.cz> +Date: Tue, 27 Jun 2017 02:07:00 +0200 +Subject: [PATCH] Show link to external docs if local is not installed + +--- a/settings/help.php ++++ b/settings/help.php +@@ -34,22 +34,36 @@ + OC_Util::addStyle( "settings", "settings" ); + \OC::$server->getNavigationManager()->setActiveEntry('help'); + ++$localDocs = true; + + if(isset($_GET['mode']) and $_GET['mode'] === 'admin') { +- $url=\OCP\Util::linkToAbsolute( 'core', 'doc/admin/index.html' ); ++ if (file_exists(\OC::$SERVERROOT . '/core/doc/admin/index.html')) { ++ $url=\OCP\Util::linkToAbsolute( 'core', 'doc/admin/index.html' ); ++ } else { ++ $url=\OC::$server->query(\OCP\Defaults::class)->buildDocLinkToKey('admin-manual'); ++ $localDocs=false; ++ } + $style1=''; + $style2=' active'; + }else{ + $url=\OCP\Util::linkToAbsolute( 'core', 'doc/user/index.html' ); ++ if (file_exists( \OC::$SERVERROOT . '/core/doc/user/index.html' )) { ++ $url=\OCP\Util::linkToAbsolute( 'core', 'doc/user/index.html' ); ++ } else { ++ $url=\OC::$server->query(\OCP\Defaults::class)->buildDocLinkToKey('user-manual'); ++ $localDocs=false; ++ } + $style1=' active'; + $style2=''; + } + ++ + $url1=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=user'; + $url2=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=admin'; + + $tmpl = new OC_Template( "settings", "help", "user" ); + $tmpl->assign( "admin", OC_User::isAdminUser(OC_User::getUser())); ++$tmpl->assign( "localDocs", $localDocs ); + $tmpl->assign( "url", $url ); + $tmpl->assign( "url1", $url1 ); + $tmpl->assign( "url2", $url2 ); + +--- a/settings/templates/help.php ++++ b/settings/templates/help.php +@@ -42,6 +42,17 @@ + </div> + + <div id="app-content" class="help-includes"> ++<?php if ($_['localDocs']) { ?> + <iframe src="<?php print_unescaped($_['url']); ?>" class="help-iframe"> + </iframe> ++<?php } else { ?> ++ <div class="section"> ++ <h2>Local documentation is not installed</h2> ++ <p>Please use ++ <a href="<?php print_unescaped($_['url']); ?>" target="_blank" rel="noreferrer"> ++ <?php p($l->t('online documentation')); ?> ↗ ++ </a> ++ </p> ++ </div> ++<?php } ?> + </div> |