diff --git a/.fmf/version b/.fmf/version deleted file mode 100644 index d00491f..0000000 --- a/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/.gitignore b/.gitignore index 099c403..4983141 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -/nextcloud-*.tar.bz2 -/nextcloud -*.pkgtmp +/nextcloud-10.0.3.tar.bz2 +/nextcloud-10.0.4.tar.bz2 diff --git a/0000-disable-update-version-check.patch b/0000-disable-update-version-check.patch deleted file mode 100644 index 4a77733..0000000 --- a/0000-disable-update-version-check.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/lib/private/Updater.php b/lib/private/Updater.php -index 5a14bb17507..38dcb55db7f 100644 ---- a/lib/private/Updater.php -+++ b/lib/private/Updater.php -@@ -174,10 +174,13 @@ - $this->config->setAppValue('core', 'vendor', $currentVendor); - } - -+ /* -+ Fedora package: -+ Remove updater version check, we know that updates across more than one -+ version are possible -+ */ - if ($currentVendor === 'nextcloud') { -- return isset($allowedPreviousVersions[$currentVendor][$majorMinor]) -- && (version_compare($oldVersion, $newVersion, '<=') -- || $this->config->getSystemValueBool('debug', false)); -+ return true; - } - - // Check if the instance can be migrated diff --git a/0001-mangle-shebang.patch b/0001-mangle-shebang.patch deleted file mode 100644 index 5755104..0000000 --- a/0001-mangle-shebang.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -Naur a/occ b/occ ---- a/occ 2020-10-24 10:37:44.000000000 +0200 -+++ b/occ 2020-11-10 19:39:56.523178958 +0100 -@@ -1,4 +1,4 @@ --#!/usr/bin/env php -+#!/usr/bin/php - diff --git a/README-PACKAGING.md b/README-PACKAGING.md deleted file mode 100644 index 4dfa735..0000000 --- a/README-PACKAGING.md +++ /dev/null @@ -1,16 +0,0 @@ -# Packaging Notes - -Nextcloud has a fairly quick release cadence. Luckily they follow a strick system of alph-beta-rc-final releases and differences between major versions aren't huge so this rarely causes problems. -## Versions/Branches/Modules/Releases -### Upstream versioning -Upstream uses semantic versioning `major.minor.bugfix` for their version numbers. Contrary to what one might expect, they generally only push releases to their `stable` release channel after the first bugfix release `x.y.1`. -### In Fedora -`rawhide` generally contains whatever the latest non-rc release upstream is, including the `x.y.0` initial releases of a new major version. -Fedora releases stay on whatever major version they inherited from `rawhide` at branching as much as possible. Since nextcloud's and Fedora's release schedule don't entirely sync up, this means that occasionally a Fedora release might ship a `x.y.0` or EOL'd version of nextcloud for a brief time, but this is the best tradeoff between keeping Fedora in sync with upstream and minimizing disruptions within one Fedora release. Users who are unhappy with that can choose modules to work around that. -Module streams `nextcloud-X` ship the current release of major version `X`. Module stream `nextcloud-stable` should be rebased to a new major version only after the `x.y.1` bugfix release, in keeping with what upstream considers it's stable branch. -### Security fixes -Upstream is very conscientious with publishing and fixing CVEs discovered in their code. They generally backport fixes to all but very minor vulnerabilities to all supported versions, so it is generally safe not to change major versions within one Fedora release, even if a vulnerability has been discovered. Impacted users can always choose to upgrade via modules. -## Tarballs -Release tarballs are located at https://download.nextcloud.com/server/releases while prerelease tarballs are located ata https://download.nextcloud.com/server/prereleases/ . It generally takes about a day after the release annoucement for tarballs to actually appear in those directories. -## Bundled dependencies -Nextcloud ships a lot of bundled composer libraries, but these are easy to unbundle. The repos `utils` directory contains a script `get-composer-requires.py` that will output all required libraries/versions as well as if they're already available in the Fedora repositories or need to be added, by scanning the `composer.json` files shipped with the nextcloud sources. diff --git a/README.md b/README.md deleted file mode 100644 index e294b77..0000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -### Installation, setup & updating - -Nextcloud requires some additional steps after installation/upgrade that are not part of the package update process. After installation/update, visiting your install's website will automatically trigger the internal Nextcloud updater which will take care of these steps. For more details, see this package's documentation files. - -### Other versions - -[modular nextcloud package Fedora and CentOS/RHEL](https://src.fedoraproject.org/modules/nextcloud) is over - -https://fedoraproject.org/wiki/Changes/RetireModularity - -Once Fedora Linux 38 reaches end of life, we will retire the Fedora instance of Module Build Service. diff --git a/changelog b/changelog deleted file mode 100644 index 554cf42..0000000 --- a/changelog +++ /dev/null @@ -1,126 +0,0 @@ -* Tue Jul 6 2021 Christopher Engelhard - 22.0.0-1 -- Update to 22.0.0 - -* Wed Jun 30 2021 Christopher Engelhard - 21.0.2-1 -- Update to 21.0.2, fixes RHBZ 1977202 / CVE-2021-22915 -- Include php-fpm config in httpd subpackage -- Set php memory limit to 512MB (RHBZ 1933529) -- Add Referrer-policy no-referrer to nginx config (RHBZ 1933530) - -* Wed Feb 24 2021 Christopher Engelhard - 21.0.0-2 -- Drop dependency on php-imap. Fixes RHBZ #1933023 - -* Wed Feb 24 2021 Christopher Engelhard - 21.0.0-1 -- Update to 21.0.0 - -* Sat Feb 20 2021 Christopher Engelhard - 20.0.7-1 -- Update to 20.0.7 - -* Tue Jan 26 2021 Fedora Release Engineering - 20.0.5-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Sat Jan 16 2021 Christopher Engelhard - 20.0.5-1 -- Update to 20.0.5 - -* Mon Dec 28 2020 Christopher Engelhard - 20.0.4-2 -- Remove duplicate dependencies on database drivers -- Remove syslinux related stuff, as these are included in - the syslinux policy -- Add Provides: for bundled libraries - -* Thu Dec 17 2020 Christopher Engelhard - 20.0.4-1 -- Update to 20.0.4 - -* Thu Dec 10 2020 Christopher Engelhard - 20.0.3-1 -- Update to 20.0.3 - -* Thu Nov 19 2020 Christopher Engelhard - 20.0.2-1 -- Update to 20.0.2 - -* Sat Nov 14 2020 Christopher Engelhard - 20.0.2-0.1.rc1 -- Update to 20.0.2RC1 - -* Wed Nov 11 2020 Christopher Engelhard - 20.0.1-3 -- Remove CentOS/RHEL 7 support from spec file - -* Tue Nov 10 2020 Christopher Engelhard - 20.0.1-2 -- Add dependencies on php-cli (for occ) and php-process (for posix) -- Remove unneeded BR on php-cli -- Add patch to allow updates across more than one major version - -* Mon Oct 26 2020 Christopher Engelhard - 20.0.1-1 -- Update to Nextcloud 20.0.1 - -* Sun Oct 11 2020 Christopher Engelhard - 20.0.0-1 -- Update to Nextcloud 20.0.0 - -* Tue Jul 28 2020 Fedora Release Engineering - 19.0.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Sun Jun 28 2020 Ivan Chavero - 19.0.0-1 -- Update to Nextcloud 19.0.0 -- Update licenses - -* Thu Apr 30 2020 Ivan Chavero - 18.0.4-1 -- Update to Nextcloud 18.0.4 - -* Sat Feb 08 2020 Ivan Chavero - 18.0.0-1 -- Refactor spec file -- Update to Nextcoud 18.0.0 - -* Wed Jan 29 2020 Fedora Release Engineering - 10.0.4-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Jul 25 2019 Fedora Release Engineering - 10.0.4-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Fri Feb 01 2019 Fedora Release Engineering - 10.0.4-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Wed Jan 9 2019 Remi Collet - 10.0.4-6 -- drop dependency on php-password-compat #1658730 -- allow php-smbclient 1.0.0 #1663672 -- allow doctrine/dbal 2.x - -* Fri Jul 13 2018 Fedora Release Engineering - 10.0.4-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Thu Feb 08 2018 Fedora Release Engineering - 10.0.4-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 10.0.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Mar 25 2017 Shawn Iwinski - 10.0.4-2 -- Add max versions to dependencies to limit each to 1 major version -- Update some dependencies to use php-composer(*) instead of package names -- Prepare for php-composer(google/apiclient) version 2 and new version 1 package - -* Tue Feb 28 2017 James Hogarth - 10.0.4-1 -- update to 10.0.4 -- Add migration from owncloud documentation -- Add systemd timer for background jobs - -* Wed Feb 08 2017 James Hogarth - 10.0.3-1 -- update to 10.0.3 - -* Thu Oct 06 2016 James Hogarth - 10.0.1-1 -- update to 10.0.1 - -* Mon Aug 01 2016 James Hogarth - 9.0.53-5 -- Use lua to have a common srpm between epel7 and fedora - -* Fri Jul 29 2016 James Hogarth - 9.0.53-4 -- Don't unbundle javascript on EPEL7 due to versioning issues - -* Fri Jul 29 2016 James Hogarth - 9.0.53-3 -- Unbundle javascript libraries from core where possible - -* Tue Jul 26 2016 James Hogarth - 9.0.53-2 -- Update the autoloader to use the path from the approved package - -* Tue Jul 19 2016 James Hogarth - 9.0.53-1 -- New release 9.0.53 - -* Thu Jul 14 2016 James Hogarth - 9.0.52-1 -- Initial nextcloud build diff --git a/gating.yml b/gating.yml deleted file mode 100644 index 47751e9..0000000 --- a/gating.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- !Policy -product_versions: - - fedora-* - decision_context: bodhi_update_push_testing - subject_type: koji_build - rules: - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} ---- !Policy -product_versions: - - fedora-* - decision_context: bodhi_update_push_stable - subject_type: koji_build - rules: - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpmdeplint.functional} - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis} - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional} diff --git a/nextcloud-10.0.3-dont-check-php-version.patch b/nextcloud-10.0.3-dont-check-php-version.patch new file mode 100644 index 0000000..77bd1ef --- /dev/null +++ b/nextcloud-10.0.3-dont-check-php-version.patch @@ -0,0 +1,94 @@ +diff --git a/console.php b/console.php +index b2724db..149c265 100644 +--- a/console.php ++++ b/console.php +@@ -31,22 +31,6 @@ use Symfony\Component\Console\Output\ConsoleOutput; + + define('OC_CONSOLE', 1); + +-// Show warning if a PHP version below 5.4.0 is used, this has to happen here +-// because base.php will already use 5.4 syntax. +-if (version_compare(PHP_VERSION, '5.4.0') === -1) { +- echo 'This version of Nextcloud requires at least PHP 5.4.0'.PHP_EOL; +- echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'.PHP_EOL; +- return; +-} +- +-// Show warning if PHP 7.1 is used as Nextcloud is not compatible with PHP 7.1 for now +-// @see https://github.com/nextcloud/docker-ci/issues/10 +-if (version_compare(PHP_VERSION, '7.1.0') !== -1) { +- echo 'This version of Nextcloud is not compatible with PHP 7.1.
'; +- echo 'You are currently running ' . PHP_VERSION . '.'; +- return; +-} +- + function exceptionHandler($exception) { + echo "An unhandled exception has been thrown:" . PHP_EOL; + echo $exception; +diff --git a/cron.php b/cron.php +index 4473dba..7a4e1a6 100644 +--- a/cron.php ++++ b/cron.php +@@ -30,20 +30,6 @@ + * + */ + +-// Show warning if a PHP version below 5.4.0 is used +-if (version_compare(PHP_VERSION, '5.4.0') === -1) { +- echo 'This version of Nextcloud requires at least PHP 5.4.0
'; +- echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'; +- return; +-} +- +-// Show warning if PHP 7.1 is used as Nextcloud is not compatible with PHP 7.1 for now +-// @see https://github.com/nextcloud/docker-ci/issues/10 +-if (version_compare(PHP_VERSION, '7.1.0') !== -1) { +- echo 'This version of Nextcloud is not compatible with PHP 7.1.
'; +- echo 'You are currently running ' . PHP_VERSION . '.'; +- return; +-} + + try { + +diff --git a/index.php b/index.php +index e72d38c..29920d7 100644 +--- a/index.php ++++ b/index.php +@@ -25,22 +25,6 @@ + * + */ + +-// Show warning if a PHP version below 5.4.0 is used, this has to happen here +-// because base.php will already use 5.4 syntax. +-if (version_compare(PHP_VERSION, '5.4.0') === -1) { +- echo 'This version of Nextcloud requires at least PHP 5.4.0
'; +- echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'; +- return; +-} +- +-// Show warning if PHP 7.1 is used as Nextcloud is not compatible with PHP 7.1 for now +-// @see https://github.com/nextcloud/docker-ci/issues/10 +-if (version_compare(PHP_VERSION, '7.1.0') !== -1) { +- echo 'This version of Nextcloud is not compatible with PHP 7.1.
'; +- echo 'You are currently running ' . PHP_VERSION . '.'; +- return; +-} +- + try { + + require_once __DIR__ . '/lib/base.php'; +diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php +index 86b9b76..ac42177 100644 +--- a/settings/Controller/CheckSetupController.php ++++ b/settings/Controller/CheckSetupController.php +@@ -212,9 +212,7 @@ class CheckSetupController extends Controller { + * @return bool + */ + protected function isPhpOutdated() { +- if (version_compare(PHP_VERSION, '5.5.0') === -1) { +- return true; +- } ++ // PHP supported in distribution + return false; + } + diff --git a/nextcloud-10.0.4-correct-cli-upgrade.patch b/nextcloud-10.0.4-correct-cli-upgrade.patch new file mode 100644 index 0000000..3a52aaa --- /dev/null +++ b/nextcloud-10.0.4-correct-cli-upgrade.patch @@ -0,0 +1,43 @@ +diff --git a/core/templates/update.admin.php b/core/templates/update.admin.php +index 87f9396..368a533 100644 +--- a/core/templates/update.admin.php ++++ b/core/templates/update.admin.php +@@ -37,7 +37,7 @@ + +
+ t('To avoid timeouts with larger installations, you can instead run the following command from your installation directory:')) ?> +-
./occ upgrade
++
sudo -u apache php /usr/share/nextcloud/occ upgrade
+
+ + +diff --git a/core/templates/update.use-cli.php b/core/templates/update.use-cli.php +index 52d40cd..945d4d9 100644 +--- a/core/templates/update.use-cli.php ++++ b/core/templates/update.use-cli.php +@@ -7,8 +7,10 @@ + } else { + p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); + } ?>

+- t('For help, see the documentation.', [link_to_docs('admin-cli-upgrade')])); ?>

++ ++sudo -u apache php /usr/share/nextcloud/occ upgrade ++ ++

+ + + +diff --git a/updater/index.php b/updater/index.php +index 017ca70..085c250 100644 +--- a/updater/index.php ++++ b/updater/index.php +@@ -1830,7 +1830,7 @@ if(strpos($updaterUrl, 'index.php') === false) { + var el = document.getElementById('step-maintenance-mode') + .getElementsByClassName('output')[0]; + if (keepActive) { +- el.innerHTML = 'Maintenance mode will kept active.
Now trigger the migration via command line: ./occ upgrade
'; ++ el.innerHTML = 'Maintenance mode will kept active.
Now trigger the migration via command line: sudo -u apache php /usr/share/nextcloud/occ upgrade
'; + successStep('step-maintenance-mode'); + currentStep('step-done'); + performStep(11, performStepCallbacks[11]); diff --git a/nextcloud-463e2ea-php71-backport.patch b/nextcloud-463e2ea-php71-backport.patch new file mode 100644 index 0000000..1a24d73 --- /dev/null +++ b/nextcloud-463e2ea-php71-backport.patch @@ -0,0 +1,22 @@ +From 463e2ea15d6fb71b96363d60c7e4bdc2c020eddf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20M=C3=BCller?= +Date: Mon, 4 Jul 2016 13:47:03 +0200 +Subject: [PATCH] Initialize array elements properly + +--- + lib/private/App/InfoParser.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php +index c158e5c..843ed02 100644 +--- a/lib/private/App/InfoParser.php ++++ b/lib/private/App/InfoParser.php +@@ -141,7 +141,7 @@ function xmlToArray($xml) { + $totalElement = count($xml->{$element}); + + if (!isset($array[$element])) { +- $array[$element] = ""; ++ $array[$element] = $totalElement > 1 ? [] : ""; + } + /** @var \SimpleXMLElement $node */ + // Has attributes diff --git a/nextcloud-9.1.0-amazon-autoloader.patch b/nextcloud-9.1.0-amazon-autoloader.patch new file mode 100644 index 0000000..d30bf1b --- /dev/null +++ b/nextcloud-9.1.0-amazon-autoloader.patch @@ -0,0 +1,15 @@ +diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php +index 4bb4312..85e04a3 100644 +--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php ++++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php +@@ -35,10 +35,6 @@ + + namespace OCA\Files_External\Lib\Storage; + +-set_include_path(get_include_path() . PATH_SEPARATOR . +- \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); +-require 'aws-autoloader.php'; +- + use Aws\S3\S3Client; + use Aws\S3\Exception\S3Exception; + use Icewind\Streams\IteratorDirectory; diff --git a/nextcloud-9.1.0-default_integrity_check_disabled.patch b/nextcloud-9.1.0-default_integrity_check_disabled.patch new file mode 100644 index 0000000..03834da --- /dev/null +++ b/nextcloud-9.1.0-default_integrity_check_disabled.patch @@ -0,0 +1,13 @@ +diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php +index d4038f8..7901a2c 100644 +--- a/lib/private/IntegrityCheck/Checker.php ++++ b/lib/private/IntegrityCheck/Checker.php +@@ -109,7 +109,7 @@ class Checker { + * too prominent. So please do not add it to config.sample.php. + */ + if ($this->config !== null) { +- $isIntegrityCheckDisabled = $this->config->getSystemValue('integrity.check.disabled', false); ++ $isIntegrityCheckDisabled = $this->config->getSystemValue('integrity.check.disabled', true); + } else { + $isIntegrityCheckDisabled = false; + } diff --git a/nextcloud-9.1.0-dont_update_htacess.patch b/nextcloud-9.1.0-dont_update_htacess.patch new file mode 100644 index 0000000..c23e530 --- /dev/null +++ b/nextcloud-9.1.0-dont_update_htacess.patch @@ -0,0 +1,106 @@ +diff --git a/core/Command/Maintenance/UpdateHtaccess.php b/core/Command/Maintenance/UpdateHtaccess.php +deleted file mode 100644 +index 2185078..0000000 +--- a/core/Command/Maintenance/UpdateHtaccess.php ++++ /dev/null +@@ -1,45 +0,0 @@ +- +- * +- * @license AGPL-3.0 +- * +- * This code is free software: you can redistribute it and/or modify +- * it under the terms of the GNU Affero General Public License, version 3, +- * as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU Affero General Public License for more details. +- * +- * You should have received a copy of the GNU Affero General Public License, version 3, +- * along with this program. If not, see +- * +- */ +-namespace OC\Core\Command\Maintenance; +- +-use InvalidArgumentException; +-use OC\Setup; +-use OCP\IConfig; +-use Symfony\Component\Console\Command\Command; +-use Symfony\Component\Console\Input\InputInterface; +-use Symfony\Component\Console\Input\InputOption; +-use Symfony\Component\Console\Output\OutputInterface; +- +-class UpdateHtaccess extends Command { +- +- protected function configure() { +- $this +- ->setName('maintenance:update:htaccess') +- ->setDescription('Updates the .htaccess file'); +- } +- +- protected function execute(InputInterface $input, OutputInterface $output) { +- \OC\Setup::updateHtaccess(); +- $output->writeln('.htaccess has been updated'); +- return 0; +- } +-} +diff --git a/core/register_command.php b/core/register_command.php +index 6f20769..09535fe 100644 +--- a/core/register_command.php ++++ b/core/register_command.php +@@ -60,7 +60,7 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) { + $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager())); + $application->add(new OC\Core\Command\App\GetPath()); + $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager())); +- ++ + $application->add(new OC\Core\Command\TwoFactorAuth\Enable( + \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager() + )); +@@ -126,7 +126,6 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) { + new \OC\Repair(\OC\Repair::getRepairSteps(), \OC::$server->getEventDispatcher()), \OC::$server->getConfig(), + \OC::$server->getEventDispatcher())); + $application->add(new OC\Core\Command\Maintenance\SingleUser(\OC::$server->getConfig())); +- $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess()); + + $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger())); + +diff --git a/lib/private/Setup.php b/lib/private/Setup.php +index 3b3a57c..cd56795 100644 +--- a/lib/private/Setup.php ++++ b/lib/private/Setup.php +@@ -379,10 +379,6 @@ class Setup { + // out that this is indeed an ownCloud data directory + file_put_contents($config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/.ocdata', ''); + +- // Update .htaccess files +- Setup::updateHtaccess(); +- Setup::protectDataDirectory(); +- + //try to write logtimezone + if (date_default_timezone_get()) { + $config->setSystemValue('logtimezone', date_default_timezone_get()); +diff --git a/lib/private/Updater.php b/lib/private/Updater.php +index 609e965..85d4869 100644 +--- a/lib/private/Updater.php ++++ b/lib/private/Updater.php +@@ -237,14 +237,6 @@ class Updater extends BasicEmitter { + throw new \Exception('Updates between multiple major versions and downgrades are unsupported.'); + } + +- // Update .htaccess files +- try { +- Setup::updateHtaccess(); +- Setup::protectDataDirectory(); +- } catch (\Exception $e) { +- throw new \Exception($e->getMessage()); +- } +- + // create empty file in data dir, so we can later find + // out that this is indeed an ownCloud data directory + // (in case it didn't exist before) diff --git a/nextcloud-9.1.0-dropbox-autoloader.patch b/nextcloud-9.1.0-dropbox-autoloader.patch new file mode 100644 index 0000000..58ae094 --- /dev/null +++ b/nextcloud-9.1.0-dropbox-autoloader.patch @@ -0,0 +1,25 @@ +diff --git a/apps/files_external/ajax/oauth1.php b/apps/files_external/ajax/oauth1.php +index e363e6c..d2aefbc 100644 +--- a/apps/files_external/ajax/oauth1.php ++++ b/apps/files_external/ajax/oauth1.php +@@ -23,7 +23,6 @@ + * along with this program. If not, see + * + */ +-require_once __DIR__ . '/../3rdparty/Dropbox/autoload.php'; + + OCP\JSON::checkAppEnabled('files_external'); + OCP\JSON::checkLoggedIn(); +diff --git a/apps/files_external/lib/Lib/Storage/Dropbox.php b/apps/files_external/lib/Lib/Storage/Dropbox.php +index f0f62f9..1b20a62 100644 +--- a/apps/files_external/lib/Lib/Storage/Dropbox.php ++++ b/apps/files_external/lib/Lib/Storage/Dropbox.php +@@ -34,8 +34,6 @@ use Icewind\Streams\IteratorDirectory; + use Icewind\Streams\RetryWrapper; + use OCP\Files\StorageNotAvailableException; + +-require_once __DIR__ . '/../../../3rdparty/Dropbox/autoload.php'; +- + class Dropbox extends \OC\Files\Storage\Common { + + private $dropbox; diff --git a/nextcloud-9.1.0-google-autoloader.patch b/nextcloud-9.1.0-google-autoloader.patch new file mode 100644 index 0000000..db2ad48 --- /dev/null +++ b/nextcloud-9.1.0-google-autoloader.patch @@ -0,0 +1,37 @@ +diff --git a/apps/files_external/ajax/oauth2.php b/apps/files_external/ajax/oauth2.php +index 2d1fae2..d8dac91 100644 +--- a/apps/files_external/ajax/oauth2.php ++++ b/apps/files_external/ajax/oauth2.php +@@ -26,9 +26,6 @@ + * along with this program. If not, see + * + */ +-set_include_path(get_include_path().PATH_SEPARATOR. +- \OC_App::getAppPath('files_external').'/3rdparty/google-api-php-client/src'); +-require_once 'Google/autoload.php'; + + OCP\JSON::checkAppEnabled('files_external'); + OCP\JSON::checkLoggedIn(); +diff --git a/apps/files_external/lib/Lib/Storage/Google.php b/apps/files_external/lib/Lib/Storage/Google.php +index 0b617aa..d40ac36 100644 +--- a/apps/files_external/lib/Lib/Storage/Google.php ++++ b/apps/files_external/lib/Lib/Storage/Google.php +@@ -38,10 +38,6 @@ use GuzzleHttp\Exception\RequestException; + use Icewind\Streams\IteratorDirectory; + use Icewind\Streams\RetryWrapper; + +-set_include_path(get_include_path().PATH_SEPARATOR. +- \OC_App::getAppPath('files_external').'/3rdparty/google-api-php-client/src'); +-require_once 'Google/autoload.php'; +- + class Google extends \OC\Files\Storage\Common { + + private $client; +@@ -462,7 +458,6 @@ class Google extends \OC\Files\Storage\Common { + $response = $client->get($downloadUrl, [ + 'headers' => $httpRequest->getRequestHeaders(), + 'stream' => true, +- 'verify' => realpath(__DIR__ . '/../../../3rdparty/google-api-php-client/src/Google/IO/cacerts.pem'), + ]); + } catch (RequestException $e) { + if(!is_null($e->getResponse())) { diff --git a/nextcloud-README.fedora b/nextcloud-README.fedora index 748b6cf..b64fc8d 100644 --- a/nextcloud-README.fedora +++ b/nextcloud-README.fedora @@ -12,7 +12,7 @@ If not, make sure your webserver is running properly. Webserver --------- -Currently nextcloud in Fedora/EPEL supports httpd (Apache) and nginx. You must install +Currently nextcloud in Fedora supports httpd (Apache) and nginx. You must install at least one webserver subpackage (nextcloud-). These packages include additional configuration files for the webservers. Remote access is disabled by default on httpd. To enable access from any host for Apache **AFTER** you @@ -67,7 +67,7 @@ ownership and SELinux context attributes. Logging ------- As specified by the configuration file, nextcloud sends messages to the system -logger, which means in a standard Fedora/EPEL configuration it will log to the +logger, which means in a standard Fedora configuration it will log to the systemd journal: try "journalctl -b -t Nextcloud". You can also change the loglevel or switch to the built-in log mechanism of nextcloud. @@ -115,4 +115,4 @@ systemctl enable --now nextcloud-cron.timer Migration from owncloud ----------------------- -For detailed instructions on this please read MIGRATION.distro +For detailed instructions on this please read MIGRATION.fedora diff --git a/nextcloud-b129d5d-php71-backport.patch b/nextcloud-b129d5d-php71-backport.patch new file mode 100644 index 0000000..734b51c --- /dev/null +++ b/nextcloud-b129d5d-php71-backport.patch @@ -0,0 +1,13 @@ +diff --git a/settings/Controller/SecuritySettingsController.php b/settings/Controller/SecuritySettingsController.php +index 88b2803..5c6f174 100644 +--- a/settings/Controller/SecuritySettingsController.php ++++ b/settings/Controller/SecuritySettingsController.php +@@ -60,7 +60,7 @@ protected function returnSuccess() { + * @return array + */ + public function trustedDomains($newTrustedDomain) { +- $trustedDomains = $this->config->getSystemValue('trusted_domains'); ++ $trustedDomains = $this->config->getSystemValue('trusted_domains', []); + $trustedDomains[] = $newTrustedDomain; + $this->config->setSystemValue('trusted_domains', $trustedDomains); + diff --git a/nextcloud-config.php b/nextcloud-config.php index 3bec0f6..96aa36e 100644 --- a/nextcloud-config.php +++ b/nextcloud-config.php @@ -1,5 +1,5 @@ "syslog", "datadirectory" => "/var/lib/nextcloud/data", "updatechecker" => false, @@ -9,15 +9,18 @@ $CONFIG = [ "preview_libreoffice_path" => '/usr/bin/libreoffice', - "apps_paths" => [ - [ 'path'=> '/usr/share/nextcloud/apps', + "apps_paths" => array( + 0 => + array ( + 'path'=> '/usr/share/nextcloud/apps', 'url' => '/apps', 'writable' => false, - ], - [ + ), + 1 => + array ( 'path' => '/var/lib/nextcloud/apps', 'url' => '/apps-appstore', 'writable' => true, - ], - ], -]; + ), + ), +); diff --git a/nextcloud-default-nginx.conf b/nextcloud-default-nginx.conf index 7151521..77d3efe 100644 --- a/nextcloud-default-nginx.conf +++ b/nextcloud-default-nginx.conf @@ -12,7 +12,6 @@ add_header X-Robots-Tag none; add_header X-Download-Options noopen; add_header X-Permitted-Cross-Domain-Policies none; - add_header Referrer-Policy no-referrer always; # set max upload size diff --git a/nextcloud-defaults.inc b/nextcloud-defaults.inc index fef3ec6..c5d4478 100644 --- a/nextcloud-defaults.inc +++ b/nextcloud-defaults.inc @@ -1,8 +1,73 @@ -# The contents of the default Nextcloud .htaccess file are appended to this -# file during build. Some directives may be irrelevant to the Fedora/EPEL -# ecosystem but are NOT omitted. +# These are based on the .htaccess file shipped by ownCloud, with +# appropriate adjustments for distribution packaging. Some directives +# that are irrelevant to the Fedora/EPEL ecosystem are omitted. This +# file contains directives that should be applied within the /nextcloud +# filesystem; directives that should be applied site-wide when +# ownCloud is installed are placed directly in nextcloud.conf. # # DO NOT EDIT THIS FILE DIRECTLY. To override any element of the -# packaged Nextcloud configuration, create a new /etc/httpd/conf.d/ -# file which will be read later than this one. +# packaged ownCloud configuration, create a new /etc/httpd/conf.d/ +# file which will be read later than 'nextcloud.conf'. +AllowOverride None + +ErrorDocument 403 /nextcloud/core/templates/403.php +ErrorDocument 404 /nextcloud/core/templates/404.php + + + + + SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1 + RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION + + + + + + php_value upload_max_filesize 10G + php_value post_max_size 10G + php_value memory_limit 512M + php_value mbstring.func_overload 0 + php_value always_populate_raw_post_data -1 + php_value default_charset 'UTF-8' + php_value output_buffering off + + SetEnv htaccessWorking true + + + + + php_value upload_max_filesize 10G + php_value post_max_size 10G + php_value memory_limit 512M + php_value mbstring.func_overload 0 + php_value always_populate_raw_post_data -1 + php_value default_charset 'UTF-8' + php_value output_buffering off + + SetEnv htaccessWorking true + + + +# The rewrites for legacy caldav and carddav URLs are omitted here +# because they do not work with Fedora's ownCloud directory layout. +# See https://github.com/nextcloud/core/issues/243#issuecomment-75426453 + + RewriteEngine on + RewriteBase /nextcloud/ + RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + RewriteRule ^remote/(.*) remote.php [QSA,L] + + +AddDefaultCharset utf-8 +Options -Indexes + + + ModPagespeed Off + + + + + Header set Cache-Control "max-age=7200, public" + + diff --git a/nextcloud-el7-php-fpm.conf b/nextcloud-el7-php-fpm.conf new file mode 100644 index 0000000..54473ec --- /dev/null +++ b/nextcloud-el7-php-fpm.conf @@ -0,0 +1,24 @@ +[nextcloud] +user = apache +group = apache +listen = /run/php-fpm/nextcloud.sock +listen.allowed_clients = 127.0.0.1 +pm = dynamic +pm.max_children = 50 +pm.start_servers = 5 +pm.min_spare_servers = 5 +pm.max_spare_servers = 35 +slowlog = /var/log/php-fpm/nextcloud-slow.log +php_admin_value[error_log] = /var/log/php-fpm/nextcloud-error.log +php_admin_flag[log_errors] = on +php_value[session.save_handler] = files +php_value[session.save_path] = /var/lib/php/session +php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache +php_value[upload_max_filesize] = 10G +php_value[post_max_size] = 10G +env[HOSTNAME] = $HOSTNAME +env[PATH] = /usr/local/bin:/usr/bin:/bin +env[TMP] = /tmp +env[TMPDIR] = /tmp +env[TEMP] = /tmp + diff --git a/nextcloud-fedora-autoloader.php b/nextcloud-fedora-autoloader.php new file mode 100644 index 0000000..a125728 --- /dev/null +++ b/nextcloud-fedora-autoloader.php @@ -0,0 +1,70 @@ +register(); +} + +// For PEAR components +$fedoraClassLoader->setUseIncludePath(true); + +// Dependencies from 3rdparty composer.json +// "guzzlehttp/guzzle" +require_once $vendor . '/GuzzleHttp/autoload.php'; +// "sabre/dav" +require_once $vendor . '/Sabre/DAV/autoload.php'; +// "doctrine/dbal" +require_once $vendor . '/Doctrine/DBAL/autoload.php'; +// mcnetic/zipstreamer" +require_once $vendor . '/ZipStreamer/autoload.php'; +// "phpeclib/phpseclib" +require_once $vendor . '/phpseclib/autoload.php'; +// "rackspace/php-opencloud" +require_once $vendor . '/OpenCloud/autoload.php'; +// "jeremeamia/superclosure" +require_once $vendor . '/SuperClosure/autoload.php'; +// "bantu/ini-get-wrapper" +require_once $vendor . '/bantu/IniGetWrapper/IniGetWrapper.php'; +// "natxet/CssMin" +require_once $vendor . '/natxet/CssMin/autoload.php'; +// "punic/punic" +require_once $vendor . '/Punic/autoload.php'; +// "patchwork/utf8" +require_once $vendor . '/Patchwork/autoload.php'; +// "symfony/console" +require_once $vendor . '/Symfony/Component/Console/autoload.php'; +// "symfony/event-dispatcher" +require_once $vendor . '/Symfony/Component/EventDispatcher/autoload.php'; +// "symfony/routing" +require_once $vendor . '/Symfony/Component/Routing/autoload.php'; +// "symfony/process" +require_once $vendor . '/Symfony/Component/Process/autoload.php'; +// "pimple/pimple" +require_once $vendor . '/Pimple/autoload.php'; +// "ircmaxell/password-compat" +if (file_exists($vendor . '/password_compat/password.php')) { + require_once $vendor . '/password_compat/password.php'; +} +// "nikic/php-parser" +require_once $vendor . '/PhpParser/autoload.php'; +// "icewind/Streams" +require_once $vendor . '/Icewind/Streams/autoload.php'; +// "swiftmailer/swiftmailer +require_once $vendor . '/Swift/swift_required.php'; +// "league/flysystem" +require_once $vendor . '/League/Flysystem/autoload.php'; +// "interfasys/lognormalizer" +require_once $vendor . '/InterfaSys/LogNormalizer/autoload.php'; +// "deepdiver1975/TarSTreamer" +require_once $vendor . '/ownCloud/TarStreamer/autoload.php'; +// "patchwork/jsqueeze" +require_once $vendor . '/Patchwork/JSqueeze.php'; +// "symfony/polyfill-php{55,56,70}" +require_once $vendor . '/Symfony/Polyfill/autoload.php'; +// "lukasreschke/id3parser": "^0.0.1" +require_once $vendor . '/ID3Parser/autoload.php'; diff --git a/nextcloud-httpd.conf b/nextcloud-httpd.conf index 12c121e..5a4ce55 100644 --- a/nextcloud-httpd.conf +++ b/nextcloud-httpd.conf @@ -16,14 +16,9 @@ Alias /nextcloud /usr/share/nextcloud # Allows compliant CalDAV / CardDAV clients to be configured using only # the domain name. For more details see # http://tools.ietf.org/html/rfc6764 -# Nextcloud 29 checks specifically for trailing slash in dav 301 redirects -# https://github.com/nextcloud/server/issues/45033#issuecomment-2079306503 - -Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav/ -Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav/ -Redirect 301 /.well-known/webdav /nextcloud/remote.php/dav/ -Redirect 301 /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger -Redirect 301 /.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo +Redirect 301 /.well-known/carddav /nextcloud/remote.php/carddav +Redirect 301 /.well-known/caldav /nextcloud/remote.php/caldav +Redirect 301 /.well-known/webdav /nextcloud/remote.php/webdav Include conf.d/nextcloud-auth-local.inc diff --git a/nextcloud-integritycheck-exclusion.patch b/nextcloud-integritycheck-exclusion.patch deleted file mode 100644 index eeb7ee5..0000000 --- a/nextcloud-integritycheck-exclusion.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9f38c6300712a23ccdc75e140143a1c461e15705 Mon Sep 17 00:00:00 2001 -From: Andrew Bauer -Date: Mon, 24 Jun 2024 10:11:23 -0500 -Subject: [PATCH] silence integrity check for excluded files - ---- - lib/private/IntegrityCheck/Checker.php | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php -index a6de3cf6030d7..3974483601b08 100644 ---- a/lib/private/IntegrityCheck/Checker.php -+++ b/lib/private/IntegrityCheck/Checker.php -@@ -337,7 +337,20 @@ private function verify(string $signaturePath, string $basePath, string $certifi - $differencesB = array_diff_assoc($currentInstanceHashes, $expectedHashes); - $differences = array_unique(array_merge($differencesA, $differencesB)); - $differenceArray = []; -+ -+ # Nasty hack to silence the integrity checker for files patched during the build process or files we simply don't care about -+ $excludedFilenames = [ -+//sedplaceholder ]; -+ - foreach ($differences as $filename => $hash) { -+ -+ # Skip if the file in question matches our exclusion list -+ foreach ($excludedFilenames as $excludedFilename) { -+ if (strpos($filename, $excludedFilename)!==false) { -+ break 2; -+ } -+ } -+ - // Check if file should not exist in the new signature table - if (!array_key_exists($filename, $expectedHashes)) { - $differenceArray['EXTRA_FILE'][$filename]['expected'] = ''; diff --git a/nextcloud-php-fpm.conf b/nextcloud-php-fpm.conf index a551def..8314e6c 100644 --- a/nextcloud-php-fpm.conf +++ b/nextcloud-php-fpm.conf @@ -15,10 +15,8 @@ php_admin_flag[log_errors] = on php_value[session.save_handler] = files php_value[session.save_path] = /var/lib/php/session php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache -php_value[memory_limit] = 512M php_value[upload_max_filesize] = 10G php_value[post_max_size] = 10G -php_value[output_buffering] = false env[HOSTNAME] = $HOSTNAME env[PATH] = /usr/local/bin:/usr/bin:/bin env[TMP] = /tmp diff --git a/nextcloud-php.ini b/nextcloud-php.ini deleted file mode 100644 index 008bcab..0000000 --- a/nextcloud-php.ini +++ /dev/null @@ -1 +0,0 @@ -apc.enable_cli=1 diff --git a/nextcloud-systemd-timer.service b/nextcloud-systemd-timer.service index a7efaae..ccff38f 100644 --- a/nextcloud-systemd-timer.service +++ b/nextcloud-systemd-timer.service @@ -2,10 +2,7 @@ Description=Cron for nextcloud background jobs [Service] -# https://docs.nextcloud.com/server/25/admin_manual/configuration_server/background_jobs_configuration.html#systemd Type=oneshot -User=apache -KillMode=process ExecStart=/usr/bin/php -f /usr/share/nextcloud/cron.php - +User=apache diff --git a/nextcloud.spec b/nextcloud.spec index 2b4260b..fcb8a3e 100644 --- a/nextcloud.spec +++ b/nextcloud.spec @@ -1,107 +1,419 @@ -%if 0%{?fedora} -%global distro fedora -%else -%global distro epel -%endif - Name: nextcloud -Version: 34.0.3 -Release: %autorelease +Version: 10.0.4 +Release: 6%{?dist} Summary: Private file sync and share server -# Automatically converted from old format: AGPLv3+ and MIT and BSD and ASL 2.0 and WTFPL and CC-BY-SA and GPLv3+ and Adobe - review is highly recommended. -License: AGPL-3.0-or-later AND LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD AND Apache-2.0 AND WTFPL AND LicenseRef-Callaway-CC-BY-SA AND GPL-3.0-or-later AND Adobe-2006 + +License: AGPLv3+ and MIT and BSD and ASL 2.0 and WTFPL and CC-BY-SA and GPLv3+ and Adobe URL: http://nextcloud.com + Source0: https://download.nextcloud.com/server/releases/%{name}-%{version}.tar.bz2 -# basic nextcloud config.php, nextcloud's -# initial setup will fill out other settings appropriately -Source1: %{name}-config.php -# Systemd timer for background jobs -Source2: %{name}-systemd-timer.service -Source3: %{name}-systemd-timer.timer -# httpd config files -Source100: %{name}-httpd.conf -Source101: %{name}-access-httpd.conf.avail -Source102: %{name}-auth-any.inc -Source103: %{name}-auth-local.inc -Source104: %{name}-auth-none.inc -Source105: %{name}-defaults.inc -# nginx/php-fpm config files -Source200: %{name}-default-nginx.conf -Source201: %{name}-conf-nginx.conf -Source202: %{name}-php-fpm.conf -Source203: %{name}-php.ini -# packaging notes and doc -Source300: %{name}-README.fedora -Source301: %{name}-mysql.txt -Source302: %{name}-postgresql.txt -Source303: %{name}-MIGRATION.fedora +Source1: %{name}-httpd.conf +Source2: %{name}-access-httpd.conf.avail -# Remove updater version check, we know that updates across more than one -# version are possible -Patch0: 0000-disable-update-version-check.patch -# Add the ability to exclude files we specify from the nextcloud integrity checker -Patch1: nextcloud-integritycheck-exclusion.patch +Source200: %{name}-default-nginx.conf +Source201: %{name}-conf-nginx.conf +Source202: %{name}-php-fpm.conf +Source203: %{name}-el7-php-fpm.conf + +# Config snippets +Source100: %{name}-auth-any.inc +Source101: %{name}-auth-local.inc +Source102: %{name}-auth-none.inc +Source103: %{name}-defaults.inc +# packaging notes and doc +Source3: %{name}-README.fedora +Source4: %{name}-mysql.txt +Source5: %{name}-postgresql.txt +Source6: %{name}-MIGRATION.fedora +# config.php containing just settings we want to specify, nextcloud's +# initial setup will fill out other settings appropriately +Source7: %{name}-config.php + +# Our autoloader for core +Source8: %{name}-fedora-autoloader.php + +# Systemd timer for background jobs +Source10: %{name}-systemd-timer.service +Source11: %{name}-systemd-timer.timer + +# Stop OC from trying to do stuff to .htaccess files. Just calm down, OC. +# Distributors are on the case. +Patch1: %{name}-9.1.0-dont_update_htacess.patch + +# Remove explicit load of dropbox +Patch2: %{name}-9.1.0-dropbox-autoloader.patch + +# Remove explicit load of google +Patch3: %{name}-9.1.0-google-autoloader.patch + +# Remove explicit load of aws +Patch4: %{name}-9.1.0-amazon-autoloader.patch + +# Disable the integrity checking whilst a better way to deal with it is found +Patch5: %{name}-9.1.0-default_integrity_check_disabled.patch + +# Apply the backport patches to support PHP7.1 and don't complain +Patch6: %{name}-463e2ea-php71-backport.patch +Patch7: %{name}-b129d5d-php71-backport.patch +Patch8: %{name}-10.0.3-dont-check-php-version.patch + +# Direct the admin to the correct cli command for upgrades +Patch9: %{name}-10.0.4-correct-cli-upgrade.patch BuildArch: noarch -# Set this to the minimum supported php version Nextcloud will run on -# Exists to prevent accidental building on distros with outdated php's -BuildRequires: php(language) >= 8.2 -BuildRequires: systemd-rpm-macros -BuildRequires: sed - -# Auto-generate Provides from bundled php-composer libraries -BuildRequires: composer-generators +# For the systemd macros +%{?systemd_requires} +BuildRequires: systemd # expand pear macros on install BuildRequires: php-pear -# Require one webserver and database backend +# For sanity %%check +BuildRequires: php-cli +BuildRequires: php-composer(sabre/dav) >= 3.0.9 +BuildRequires: php-composer(sabre/dav) < 4.0 +BuildRequires: php-composer(doctrine/dbal) >= 2.5.4 +BuildRequires: php-composer(doctrine/dbal) < 3 +BuildRequires: php-composer(mcnetic/zipstreamer) >= 1.0 +BuildRequires: php-composer(mcnetic/zipstreamer) < 2.0 +BuildRequires: php-composer(phpseclib/phpseclib) >= 2.0 +BuildRequires: php-composer(phpseclib/phpseclib) < 3.0 +BuildRequires: php-composer(rackspace/php-opencloud) >= 1.9.2 +BuildRequires: php-composer(rackspace/php-opencloud) < 2.0 +BuildRequires: php-composer(jeremeamia/superclosure) >= 2.1.0 +BuildRequires: php-composer(jeremeamia/superclosure) < 3.0 +BuildRequires: php-composer(bantu/ini-get-wrapper) >= 1.0.1 +BuildRequires: php-composer(bantu/ini-get-wrapper) < 2.0 +BuildRequires: php-composer(natxet/CssMin) >= 3.0.4 +BuildRequires: php-composer(natxet/CssMin) < 4.0 +BuildRequires: php-composer(punic/punic) >= 1.6.3 +BuildRequires: php-composer(punic/punic) < 2.0 +%if 0%{?el7} +BuildRequires: php-pear(Archive_Tar) >= 1.3 +BuildRequires: php-pear(Archive_Tar) < 2.0 +%else +BuildRequires: php-composer(pear/archive_tar) >= 1.4.1 +BuildRequires: php-composer(pear/archive_tar) < 2.0 +%endif +BuildRequires: php-composer(patchwork/utf8) >= 1.2.6 +BuildRequires: php-composer(patchwork/utf8) < 2.0 +BuildRequires: php-composer(symfony/console) >= 2.8.3 +BuildRequires: php-composer(symfony/console) < 3.0.0 +BuildRequires: php-composer(symfony/event-dispatcher) >= 2.8.3 +BuildRequires: php-composer(symfony/event-dispatcher) < 3.0.0 +BuildRequires: php-composer(symfony/routing) >= 2.8.1 +BuildRequires: php-composer(symfony/routing) < 3.0.0 +BuildRequires: php-composer(symfony/process) >= 2.8.1 +BuildRequires: php-composer(symfony/process) < 3.0.0 +BuildRequires: php-composer(pimple/pimple) >= 3.0.2 +BuildRequires: php-composer(pimple/pimple) < 4.0 +%if 0%{?fedora} < 18 && 0%{?rhel} < 8 +BuildRequires: php-composer(ircmaxell/password-compat) >= 1.0.0 +BuildRequires: php-composer(ircmaxell/password-compat) < 2.0 +%endif +BuildRequires: php-composer(nikic/php-parser) >= 1.4.1 +BuildRequires: php-composer(nikic/php-parser) < 2.0 +BuildRequires: php-composer(icewind/streams) >= 0.4.1 +BuildRequires: php-composer(icewind/streams) < 1.0 +BuildRequires: php-composer(swiftmailer/swiftmailer) >= 5.4.1 +BuildRequires: php-composer(swiftmailer/swiftmailer) < 6.0 +BuildRequires: php-composer(guzzlehttp/guzzle) >= 5.3.0 +BuildRequires: php-composer(guzzlehttp/guzzle) < 6.0 +BuildRequires: php-composer(league/flysystem) >= 1.0.20 +BuildRequires: php-composer(league/flysystem) < 2.0 +%if 0%{?el7} +BuildRequires: php-pear(Console_Getopt) > 1.3 +BuildRequires: php-pear(Console_Getopt) < 2.0 +BuildRequires: php-pear(PEAR) > 1.9 +%else +BuildRequires: php-composer(pear/pear-core-minimal) >= 1.10.1 +%endif +BuildRequires: php-composer(interfasys/lognormalizer) >= 1.0 +BuildRequires: php-composer(interfasys/lognormalizer) < 2.0 +BuildRequires: php-composer(owncloud/tarstreamer) >= 0.1 +BuildRequires: php-composer(owncloud/tarstreamer) < 1.0 +BuildRequires: php-composer(patchwork/jsqueeze) >= 2.0 +BuildRequires: php-composer(patchwork/jsqueeze) < 3.0 +BuildRequires: php-composer(symfony/polyfill-php70) >= 1.0 +BuildRequires: php-composer(symfony/polyfill-php70) < 2.0 +BuildRequires: php-composer(symfony/polyfill-php55) >= 1.0 +BuildRequires: php-composer(symfony/polyfill-php55) < 2.0 +BuildRequires: php-composer(symfony/polyfill-php56) >= 1.0 +BuildRequires: php-composer(symfony/polyfill-php56) < 2.0 +BuildRequires: php-composer(lukasreschke/id3parser) >= 0.0.1 +BuildRequires: php-composer(lukasreschke/id3parser) < 1.0.0 +BuildRequires: php-composer(icewind/smb) >= 1.1.0 +BuildRequires: php-composer(icewind/smb) < 2.0 +BuildRequires: php-pecl(smbclient) >= 0.8.0 +BuildRequires: php-pecl(smbclient) < 2 +BuildRequires: php-composer(google/apiclient) >= 1.1.7 +# Note: 1.1.8 has BC breaks +BuildRequires: php-composer(google/apiclient) < 1.1.8 +BuildRequires: php-composer(aws/aws-sdk-php) >= 2.7.5 +BuildRequires: php-composer(aws/aws-sdk-php) < 3.0.0 +BuildRequires: php-composer(symfony/yaml) >= 2.6.0 +BuildRequires: php-composer(symfony/yaml) < 3.0.0 +BuildRequires: php-pear(pear.dropbox-php.com/Dropbox) +BuildRequires: php-composer(onelogin/php-saml) >= 2.9.0 +BuildRequires: php-composer(onelogin/php-saml) < 3.0 + Requires: %{name}-webserver = %{version}-%{release} Requires: %{name}-database = %{version}-%{release} -Requires: php-bcmath -# Require php CLI for occ command -Requires: php-cli + # Core PHP libs/extensions required by OC core Requires: php-curl Requires: php-dom Requires: php-exif Requires: php-fileinfo -Requires: php-filter Requires: php-gd -Requires: php-gmp Requires: php-iconv -Requires: php-intl Requires: php-json Requires: php-ldap Requires: php-mbstring Requires: php-openssl Requires: php-pcre Requires: php-pdo -Requires: php-pecl-apcu -Requires: php-pecl-imagick -Requires: php-pecl-memcached -Requires: (php-pecl-redis6 or php-pecl-redis5) -Requires: php-process Requires: php-session Requires: php-simplexml -Requires: php-smbclient -Requires: php-spl -Recommends: php-sodium -Requires: php-opcache Requires: php-xmlwriter +Requires: php-spl Requires: php-zip -# For systemd support during install/uninstall -%{?systemd_requires} -# Fedora dropped legacy CA cert bundle symlinks -# See https://fedoraproject.org/wiki/Changes/dropingOfCertPemFile -Requires: %{_sysconfdir}/pki/ca-trust/extracted/pem/tls-ca-bundle.pem +Requires: php-filter -# jquery-ui-multiselect bundled via user_ldap app -Provides: bundled(jquery-ui-multiselect) = 1.13 -# zxcvbn bundled via core -Provides: bundled(zxcvbn) = 4.4.2 +### External PHP libs required by OC core + + +# "doctrine/dbal": "2.5.4" +# pulls in doctrine/common as a strict requires +# which pulls in doctrine/{annotations,inflector,cache,collections,lexer} as strict requires +Requires: php-composer(doctrine/dbal) >= 2.5.4 +Requires: php-composer(doctrine/dbal) < 3 + +#"mcnetic/zipstreamer": "^1.0" +Requires: php-composer(mcnetic/zipstreamer) >= 1.0 +Requires: php-composer(mcnetic/zipstreamer) < 2.0 + +# "phpseclib/phpseclib": "2.0.0" +Requires: php-composer(phpseclib/phpseclib) >= 2.0 +Requires: php-composer(phpseclib/phpseclib) < 3.0 + +#Requires: php-composer(rackspace/php-opencloud) >= 1.9.2 +# pulls in guzzle/http as a strict requires +# guzzle/http package include common, parser and stream too +Requires: php-composer(rackspace/php-opencloud) >= 1.9.2 +Requires: php-composer(rackspace/php-opencloud) < 2.0 + +# "jeremeamia/superclosure": "2.1.0" +Requires: php-composer(jeremeamia/superclosure) >= 2.1.0 +Requires: php-composer(jeremeamia/superclosure) < 3.0 + +# "bantu/ini-get-wrapper": "v1.0.1" +Requires: php-composer(bantu/ini-get-wrapper) >= 1.0.1 +Requires: php-composer(bantu/ini-get-wrapper) < 2.0 + +# "natxet/CssMin": "dev-master" +Requires: php-composer(natxet/CssMin) >= 3.0.4 +Requires: php-composer(natxet/CssMin) < 4.0 + +# "punic/punic": "1.6.3" +Requires: php-composer(punic/punic) >= 1.6.3 +Requires: php-composer(punic/punic) < 2.0 + +# "pear/archive_tar": "1.4.1" +# archive_tar is in base el7 and doesn't have the fedora php-composer provides +%if 0%{?el7} +Requires: php-pear(Archive_Tar) >= 1.3 +Requires: php-pear(Archive_Tar) < 2.0 +%else +Requires: php-composer(pear/archive_tar) >= 1.4.1 +Requires: php-composer(pear/archive_tar) < 2.0 +%endif + +# "patchwork/utf8": "1.2.6" +Requires: php-composer(patchwork/utf8) >= 1.2.6 +Requires: php-composer(patchwork/utf8) < 2.0 + +# "symfony/console": "2.8.3" +Requires: php-composer(symfony/console) >= 2.8.3 +Requires: php-composer(symfony/console) < 3.0.0 +# "symfony/event-dispatcher": "2.8.3" +Requires: php-composer(symfony/event-dispatcher) >= 2.8.3 +Requires: php-composer(symfony/event-dispatcher) < 3.0.0 +# "symfony/routing": "2.8.1" +Requires: php-composer(symfony/routing) >= 2.8.1 +Requires: php-composer(symfony/routing) < 3.0.0 +# "symfony/process": "2.8.1" +Requires: php-composer(symfony/process) >= 2.8.1 +Requires: php-composer(symfony/process) < 3.0.0 + +# "pimple/pimple": "3.0.2" +Requires: php-composer(pimple/pimple) >= 3.0.2 +Requires: php-composer(pimple/pimple) < 4.0 + +%if 0%{?fedora} < 18 && 0%{?rhel} < 8 +# "ircmaxell/password-compat": "1.0.*" +Requires: php-composer(ircmaxell/password-compat) >= 1.0.0 +Requires: php-composer(ircmaxell/password-compat) < 2.0 +%endif + +# "nikic/php-parser": "1.4.1" +Requires: php-composer(nikic/php-parser) >= 1.4.1 +Requires: php-composer(nikic/php-parser) < 2.0 + +# "icewind/Streams": "0.4.1" +Requires: php-composer(icewind/streams) >= 0.4.1 +Requires: php-composer(icewind/streams) < 1.0 + +# "swiftmailer/swiftmailer": "@stable" +# Version 5.4.1 for autoloader in /usr/share/php +Requires: php-composer(swiftmailer/swiftmailer) >= 5.4.1 +Requires: php-composer(swiftmailer/swiftmailer) < 6.0 + +# "guzzlehttp/guzzle": "5.3.0" +# pulls in guzzlehttp/ringphp as strict requires +# ringphp pulls in guzzlehttp/streams and react/promise as strict requires +Requires: php-composer(guzzlehttp/guzzle) >= 5.3.0 +Requires: php-composer(guzzlehttp/guzzle) < 6.0 + +# "league/flysystem": "1.0.20" +Requires: php-composer(league/flysystem) >= 1.0.20 +Requires: php-composer(league/flysystem) < 2.0 + + +# "pear/pear-core-minimal": "v1.10.1" +# this includes pear/console_getopt and pear/PEAR +%if 0%{?el7} +Requires: php-pear(Console_Getopt) > 1.3 +Requires: php-pear(Console_Getopt) < 2.0 +Requires: php-pear(PEAR) > 1.9 +%else +Requires: php-composer(pear/pear-core-minimal) >= 1.10.1 +%endif + +# "interfasys/lognormalizer": "v1.0" +Requires: php-composer(interfasys/lognormalizer) >= 1.0 +Requires: php-composer(interfasys/lognormalizer) < 2.0 + +# "deepdiver1975/TarStreamer": "v0.1.0" +# Despite the difference in name this is correct +# https://github.com/owncloud/3rdparty/tree/master/deepdiver1975/tarstreamer +Requires: php-composer(owncloud/tarstreamer) >= 0.1 +Requires: php-composer(owncloud/tarstreamer) < 1.0 + +# "patchwork/jsqueeze": "^2.0" +Requires: php-composer(patchwork/jsqueeze) >= 2.0 +Requires: php-composer(patchwork/jsqueeze) < 3.0 + +# "sabre/dav" : "3.0.9" +# pulls in sabre event, http and vobject, xml, uri as strict requires +Requires: php-composer(sabre/dav) >= 3.0.9 +Requires: php-composer(sabre/dav) < 4.0 + +# symfony/polyfill-mbstring is not in composer.json but is in the 3rdparty folder +# we don't need it though as we ship mbstring itself + +# "symfony/polyfill-php70": "^1.0", +# pulls in s strict requires of paragonie/random_compat +Requires: php-composer(symfony/polyfill-php70) >= 1.0 +Requires: php-composer(symfony/polyfill-php70) < 2.0 +# "symfony/polyfill-php55": "^1.0", +Requires: php-composer(symfony/polyfill-php55) >= 1.0 +Requires: php-composer(symfony/polyfill-php55) < 2.0 +# "symfony/polyfill-php56": "^1.0" +Requires: php-composer(symfony/polyfill-php56) >= 1.0 +Requires: php-composer(symfony/polyfill-php56) < 2.0 + +# "lukasreschke/id3parser": "^0.0.1" +Requires: php-composer(lukasreschke/id3parser) >= 0.0.1 +Requires: php-composer(lukasreschke/id3parser) < 1.0.0 + +### For dependencies of apps/files_external + +## SMB/CIFS external storage stuff + +#"icewind/smb": "1.1.0" +# note that streams is a dep but already required by core anyway +Requires: php-composer(icewind/smb) >= 1.1.0 +Requires: php-composer(icewind/smb) < 2.0 +# This makes smb external storage usable in performance +# and doesn't break things like encryption due to timeouts +Requires: php-pecl(smbclient) >= 0.8.0 +Requires: php-pecl(smbclient) < 2 + + +# Requiring so that the shipped external smb storage works +# The net command is needed and enabling smb tests for smbclient command +Requires: samba-common-tools +Requires: samba-client + +## Note these next bits are not listed in composer but manually dropped in place + +## Dropbox external storage +Requires: php-pear(pear.dropbox-php.com/Dropbox) + +## Google Drive external storage +## Note: 1.1.8 has BC breaks +Requires: php-composer(google/apiclient) >= 1.1.7 +Requires: php-composer(google/apiclient) < 1.1.8 + +## AWS S3 external storage +Requires: php-composer(aws/aws-sdk-php) >= 2.7.0 +Requires: php-composer(aws/aws-sdk-php) < 3.0.0 + +## For dependency of apps/gallery +# "symfony/yaml": "~2.6" +Requires: php-composer(symfony/yaml) >= 2.6.0 +Requires: php-composer(symfony/yaml) < 3.0.0 + +## For dependency of app/user_saml +# "onelogin/php-saml": "^2.9" +Requires: php-composer(onelogin/php-saml) >= 2.9.0 +Requires: php-composer(onelogin/php-saml) < 3.0.0 + +# Need to label the httpd rw stuff correctly until base selinux policy updated +Requires(post): %{_sbindir}/semanage +Requires(postun): %{_sbindir}/semanage + +# Bundled javascript libraries in core vendor +# State of javascript in fedora right now is too painful to unbundle +Provides: bundled(js-base64) = 0.3.0 +Provides: bundled(js-blueimp-md5) = 1.1.0 +Provides: bundled(js-bootstrap/tooltip) = 3.3.6 +Provides: bundled(js-clipboard) = 1.5.12 +Provides: bundled(js-davclient) +Provides: bundled(js-es6-promise) = 2.3.0 +Provides: bundled(js-handlebars) = 1.3.0 +Provides: bundled(js-jcrop) = 0.9.12 +Provides: bundled(js-jquery-ui) = 1.10 +Provides: bundled(js-jsTimezoneDetect) = 1.0.6 +Provides: bundled(js-moment) = 2.10.3 +Provides: bundled(js-select2) = 3.4.8 +Provides: bundled(js-snapjs) = 2.0.0 +Provides: bundled(js-strengthify) = 0.5.1 +Provides: bundled(js-zxcvbn) = gitf2a8cda13d +Provides: bundled(js-jquery) = 2.1.4 +Provides: bundled(js-jquery-migrate) = 1.4.0 +Provides: bundled(js-backbone) = 1.2.3 +Provides: bundled(js-underscore) = 1.8.3 +# bundled from files_pdfviewer +Provides: bundled(js-pdfjs) = 1.1.469 +# bundled from files_theming +Provides: bundled(js-jscolor) = 2.0.4 +# bundled from federatedfilesharing +Provides: bundled(js-gs-share) +# bundled from files_texteditor +Provides: bundled(js-ace) +# bundled from user_ldap +Provides: bundled(js-jquery-multiselect) = 1.13 +# bundled from gallery +Provides: bundled(js-bigshot) +Provides: bundled(js-commonmark) = 0.22.0 +Provides: bundled(js-dompurify) = 0.7.0 +Provides: bundled(js-eventsource-polyfill) = 0.9.7 +Provides: bundled(js-jquery-touchevents) = 1.0.1 +Provides: bundled(js-jqueryui-touch-punch) = 0.2.3 %description NextCloud gives you universal access to your files through a web interface or @@ -112,33 +424,39 @@ applications and plugins. %package httpd -Summary: Httpd integration for NextCloud -Provides: %{name}-webserver = %{version}-%{release} -Requires: %{name} = %{version}-%{release} +Summary: Httpd integration for NextCloud + +Provides: %{name}-webserver = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + # PHP dependencies -Requires: php-fpm httpd +Requires: php %description httpd %{summary}. %package nginx -Summary: Nginx integration for NextCloud -Provides: %{name}-webserver = %{version}-%{release} -Requires: %{name} = %{version}-%{release} +Summary: Nginx integration for NextCloud + +Provides: %{name}-webserver = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + # PHP dependencies -Requires: php-fpm nginx +Requires: php-fpm nginx %description nginx %{summary}. %package mysql -Summary: MySQL database support for NextCloud -Provides: %{name}-database = %{version}-%{release} -Requires: %{name} = %{version}-%{release} +Summary: MySQL database support for NextCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + # From getSupportedDatabases, mysql => pdo, mysql -Requires: php-mysqlnd +Requires: php-pdo_mysql %description mysql This package ensures the necessary dependencies are in place for NextCloud to @@ -150,13 +468,14 @@ If you want the database to be on the same system as NextCloud itself, you must also install and enable a MySQL / MariaDB server package. See README.mysql for more details. - %package postgresql -Summary: PostgreSQL database support for NextCloud -Provides: %{name}-database = %{version}-%{release} -Requires: %{name} = %{version}-%{release} +Summary: PostgreSQL database support for NextCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + # From getSupportedDatabases, pgsql => function, pg_connect -Requires: php-pgsql +Requires: php-pgsql %description postgresql This package ensures the necessary dependencies are in place for NextCloud to @@ -170,101 +489,238 @@ for more details. %package sqlite -Summary: SQLite 3 database support for NextCloud -Provides: %{name}-database = %{version}-%{release} -Requires: %{name} = %{version}-%{release} +Summary: SQLite 3 database support for NextCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} # From getSupportedDatabases, pgsql => class, SQLite3 +Requires: php-sqlite3 php-pcre %description sqlite This package ensures the necessary dependencies are in place for NextCloud to work with an SQLite 3 database stored on the local system. + %prep %autosetup -n %{name} -p1 -# Fix php shebang in occ -sed -ri 's\^#!/usr/bin/env php$\#!%{_bindir}/php\' occ - # patch backup files and .git stuff -find . -name \*.orig -type f -delete -print -find . -name .gitignore -type f -delete -print +find . -name \*.orig -type f -exec rm {} \; -print +find . -name .gitignore -type f -exec rm {} \; -print find . -name .github -type d -prune -exec rm -r {} \; -print -# fix CLI upgrade advice on splash screen -if ! file=$(grep -l 'occ upgrade' dist/*.map); then - echo "Could not find the occ upgrade instructions in dist/*.map" - exit 1 -fi -echo "Updating occ upgrade instructions in $file" -sed -i -e 's#\./\(occ upgrade\)#sudo -u apache php /usr/share/nextcloud/\1#' $file - # prepare package doc -cp %{SOURCE300} README.%{distro} -cp %{SOURCE301} README.mysql -cp %{SOURCE302} README.postgresql -cp %{SOURCE303} MIGRATION.%{distro} +cp %{SOURCE3} README.fedora +cp %{SOURCE4} README.mysql +cp %{SOURCE5} README.postgresql +cp %{SOURCE6} MIGRATION.fedora -# point the reader to the correct README filename -sed -i 's/distro/%{distro}/g' README.%{distro} +mv 3rdparty/composer.json 3rdparty_composer.json +mv apps/files_external/3rdparty/composer.json files_external_composer.json +mv apps/gallery/composer.json gallery_composer.json +mv apps/user_saml/3rdparty/composer.json user_saml_composer.json -# Locate license files and put them sensibly in place -# get rid of all composer licenses -find -wholename "*/composer/LICENSE" -exec mv {} composer-LICENSE \; +# Explicitly remove the bundled libraries we're aware of +pushd 3rdparty +rm -r doctrine/{annotations,cache,collections,common,dbal,inflector,lexer} +rm -r mcnetic/zipstreamer +rm -r phpseclib/phpseclib +rm -r rackspace/php-opencloud guzzle/{http,common,parser,stream} +rm -r jeremeamia/SuperClosure +rm -r bantu/ini-get-wrapper +rm -r natxet/CssMin +rm -r punic/punic +rm -r pear/archive_tar +rm -r patchwork/utf8 +rm -r symfony/console +rm -r symfony/event-dispatcher +rm -r symfony/routing +rm -r symfony/process +rm -r pimple/pimple +rm -r ircmaxell/password-compat +rm -r nikic/php-parser +rm -r icewind/streams +rm -r swiftmailer/swiftmailer +rm -r guzzlehttp/{guzzle,ringphp,streams} react/promise +rm -r league/flysystem +rm -r pear/{pear-core-minimal,console_getopt,pear_exception} +rm -r interfasys/lognormalizer +rm -r deepdiver1975/tarstreamer +rm -r patchwork/jsqueeze +rm -r sabre/{dav,event,http,vobject,uri,xml} +rm -r symfony/polyfill-{php55,php56,php70,mbstring,util} +rm -r paragonie/random_compat +rm -r lukasreschke/id3parser +rm README.md -# Deal with licenses automatically -find . -mindepth 2 \( -name '*LICENSE*' -o -name '*LICENCE*' \) | { while read a ; do mv "$a" $(echo $a | sed "s_^./__" | tr "/ " "__" )-LICENSE ; done ; } -find . -mindepth 2 -name '*COPYING*' | { while read a ; do mv "$a" $(echo $a | sed "s_^./__" | tr "/ " "__" )-COPYING ; done ; } +# remove composer stuff +rm -r composer* -# case-sensitive list of partial matches to exclude from the nextcloud integrity checker -# include readme, license, other docs, and any files we move or patch during the build -excludedFilenames=" -README -readme -LICENSE -LICENCE -license -copying -COPYING -AUTHORS -htaccess -gitignore -user.ini -update.admin.php -Updater.php -occ -Checker.php -" +# clean up any empty directories +find -type d -empty -delete -# nextcloud source files use tabs rather than spaces, ew -tabs=" " -cr=" -" +# remove extraneous files now we've cleaned up +rm "LICENSE INFO" patches.txt -# Add quotes, commas, and escaped newlines -for f in $excludedFilenames; do - formattedlist="$formattedlist$tabs'$f',\\$cr" +# add our Fedora autoloader +cp %{SOURCE8} ./autoload.php + +# Set the vendor directory to macro based datadir in our autoloader +sed -i "s,##DATADIR##,%{_datadir}," autoload.php +popd + + +# remove files_external bundled libraries +rm -r apps/files_external/3rdparty/{icewind,Dropbox,google-api-php-client,aws-sdk-php,composer*} + +# create autoloader, from composer.json, "require": { +# "icewind/smb": "1.0.4", +# "icewind/streams": "0.2" +# include stuff required directly but not in composer too +cat << 'EOF' | tee apps/files_external/3rdparty/autoload.php +> %{SOURCE105} +find -name '.tx' -print0 | xargs -0 rm -rf +find -name '.bower.json' -print0 | xargs -0 rm -rf + +find . -size 0 -type f -delete + +# let's not ship upstream's 'updatenotification' app, which has zero chance of working and +# a big chance of blowing things up +rm -dr apps/updatenotification +# also remove the actual updater +rm -r updater + +# Locate license files and put them sensibly in place +mv apps/files_pdfviewer/vendor/pdfjs/LICENSE js-pdfjs-LICENSE +mv apps/files_pdfviewer/vendor/pdfjs/web/cmaps/LICENSE js-pdfjs-cmaps-LICENSE +mv apps/files_retention/LICENSE files_retention-LICENSE +mv apps/gallery/COPYING gallery-LICENSE +mv apps/gallery/js/vendor/bigshot/LICENSE.txt js-bigshot-LICENSE +mv apps/gallery/js/vendor/commonmark/LICENSE js-commonmark-LICENSE +mv apps/gallery/js/vendor/dompurify/LICENSE js-dompurify-LICENSE +mv apps/gallery/js/vendor/eventsource-polyfill/LICENSE js-eventsource-polyfill-LICENSE +mv apps/notifications/COPYING notifications-LICENSE +mv apps/password_policy/LICENSE password_policy-LICENSE +mv apps/serverinfo/COPYING serverinfo-LICENSE +mv apps/survey_client/COPYING survey_client-LICENSE +mv apps/theming/js/3rdparty/jscolor/LICENSE.txt js-jscolor-LICENSE +mv apps/user_ldap/vendor/ui-multiselect/MIT-LICENSE js-jqueryui-multiselect-LICENSE +mv COPYING-AGPL nextcloud-LICENSE +mv core/fonts/LICENSE.txt fonts-LICENSE +mv core/vendor/backbone/LICENSE js-backbone-LICENSE +mv core/vendor/base64/LICENSE js-base64-LICENSE +mv core/vendor/davclient.js/LICENSE js-davclient-LICENSE +mv core/vendor/es6-promise/LICENSE js-es6-promise-LICENSE +mv core/vendor/jcrop/MIT-LICENSE.txt js-jcrop-LICENSE +mv core/vendor/jquery/MIT-LICENSE.txt js-jquery-LICENSE +mv core/vendor/jquery-ui/MIT-LICENSE.txt js-jquery-ui-LICENSE +mv core/vendor/jsTimezoneDetect/LICENCE.txt js-jsTimezoneDetect-LICENSE +mv core/vendor/moment/LICENSE js-moment-LICENSE +mv core/vendor/select2/LICENSE js-select2-LICENSE +mv core/vendor/strengthify/LICENSE js-strengthify-LICENSE +mv core/vendor/underscore/LICENSE js-underscore-LICENSE +mv core/vendor/zxcvbn/LICENSE.txt js-zxcvbn-LICENSE +mv lib/composer/composer/LICENSE composer-LICENSE %check +# files_external checks +nb=$(ls %{buildroot}%{_datadir}/%{name}/apps/files_external/3rdparty | wc -l) +if [ $nb -gt 1 ]; then + false apps/files_external/3rdparty must only have autoload.php +fi + +if grep -r 3rdparty %{buildroot}%{_datadir}/%{name}/apps/files_external \ + | grep -v 3rdparty/autoload.php | grep -v signature.json; then + false App files_external needs to be adapted +fi + +php %{buildroot}%{_datadir}/%{name}/apps/files_external/3rdparty/autoload.php + +# gallery checks +nb=$(ls %{buildroot}%{_datadir}/%{name}/apps/gallery/vendor | wc -l) +if [ $nb -gt 1 ]; then + false apps/gallery/vendor must only have autoload.php +fi + +php %{buildroot}%{_datadir}/%{name}/apps/gallery/vendor/autoload.php + +# user_saml checks +nb=$(ls %{buildroot}%{_datadir}/%{name}/apps/user_saml/3rdparty/vendor | wc -l) +if [ $nb -gt 1 ]; then + false apps/user_saml/3rdparty/vendor must only have autoload.php +fi + +php %{buildroot}%{_datadir}/%{name}/apps/user_saml/3rdparty/vendor/autoload.php + +# core checks +nb=$(ls %{buildroot}%{_datadir}/%{name}/3rdparty | wc -l) +if [ $nb -gt 1 ]; then + false core 3rdparty must only have autoload.php +fi + +php %{buildroot}%{_datadir}/%{name}/3rdparty/autoload.php + +# There should not be an composer.json files remaining +nb=$(find -name 'composer.*' | wc -l) +if [ $nb -gt 0 ] + then + false found unexpected composer.json files +fi + # Make sure there are no license files left over -: Check for leftover license files -find . -mindepth 2 \( -name '*LICENSE*' -o -name '*LICENCE*' -o -name '*COPYING*' \) nb=$( find . -mindepth 2 \( -name '*LICENSE*' -o -name '*LICENCE*' -o -name '*COPYING*' \) | wc -l ) if [ $nb -gt 0 ] then - false Found unexpected licenses to verify + false found unexpected licenses to verify fi %build # Nothing to build + %install install -dm 755 %{buildroot}%{_datadir}/%{name} @@ -280,28 +736,25 @@ for d in $(find . -mindepth 1 -maxdepth 1 -type d | grep -v config); do cp -a "$d" %{buildroot}%{_datadir}/%{name} done -for f in {*.php,*.html,robots.txt}; do +for f in {*.php,*.xml,*.html,occ,robots.txt}; do install -pm 644 "$f" %{buildroot}%{_datadir}/%{name} done -# occ should be executable -install -pm 755 occ %{buildroot}%{_datadir}/%{name} - # symlink config dir -ln -s ../../../%{_sysconfdir}/%{name} %{buildroot}%{_datadir}/%{name}/config +ln -sf %{_sysconfdir}/%{name} %{buildroot}%{_datadir}/%{name}/config # nextcloud looks for ca-bundle.crt in config dir -ln -s ../pki/ca-trust/extracted/pem/tls-ca-bundle.pem %{buildroot}%{_sysconfdir}/%{name}/ca-bundle.crt +ln -sf %{_sysconfdir}/pki/tls/certs/ca-bundle.crt %{buildroot}%{_sysconfdir}/%{name}/ca-bundle.crt # set default config -install -pm 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/config.php +install -pm 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/%{name}/config.php # httpd config -install -Dpm 644 %{SOURCE100} \ +install -Dpm 644 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf -install -Dpm 644 %{SOURCE101} \ +install -Dpm 644 %{SOURCE2} \ %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}-access.conf.avail -install -Dpm 644 %{SOURCE102} %{SOURCE103} %{SOURCE104} %{SOURCE105} \ +install -Dpm 644 %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} \ %{buildroot}%{_sysconfdir}/httpd/conf.d/ # nginx config @@ -310,42 +763,37 @@ install -Dpm 644 %{SOURCE200} \ install -Dpm 644 %{SOURCE201} \ %{buildroot}%{_sysconfdir}/nginx/conf.d/%{name}.conf -# php-fpm config +%if 0%{?el7} +install -Dpm 644 %{SOURCE203} \ + %{buildroot}%{_sysconfdir}/php-fpm.d/%{name}.conf +%else install -Dpm 644 %{SOURCE202} \ %{buildroot}%{_sysconfdir}/php-fpm.d/%{name}.conf - -# php.ini config -install -Dpm 644 %{SOURCE203} \ - %{buildroot}%{_sysconfdir}/php.d/60-%{name}.ini +%endif # Install the systemd timer -install -Dpm 644 %{SOURCE2} %{buildroot}%{_unitdir}/nextcloud-cron.service -install -Dpm 644 %{SOURCE3} %{buildroot}%{_unitdir}/nextcloud-cron.timer - -# If there's a new installation activate the installation wizard -%post -INSTALLED=$(grep -c secret /etc/nextcloud/config.php) -if [ "${INSTALLED}" -eq "0" ]; then - echo "First time installation, enabling installation wizard" - touch %{_sysconfdir}/%{name}/CAN_INSTALL - chown apache:apache %{_sysconfdir}/%{name}/CAN_INSTALL -fi - -/usr/bin/systemctl restart php-fpm.service > /dev/null 2>&1 || : +install -Dpm 644 %{SOURCE10} %{buildroot}%{_unitdir}/nextcloud-cron.service +install -Dpm 644 %{SOURCE11} %{buildroot}%{_unitdir}/nextcloud-cron.timer %post httpd /usr/bin/systemctl reload httpd.service > /dev/null 2>&1 || : -/usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : %postun httpd if [ $1 -eq 0 ]; then /usr/bin/systemctl reload httpd.service > /dev/null 2>&1 || : - /usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : fi %post nginx -/usr/bin/systemctl reload nginx.service > /dev/null 2>&1 || : -/usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : +%if 0%{?el7} + # Work around missing php session directory for php-fpm in el7 bz#1338444 + if [ ! -d /var/lib/php/session ] + then + mkdir /var/lib/php/session + fi + /usr/bin/chown apache /var/lib/php/session +%endif + /usr/bin/systemctl reload nginx.service > /dev/null 2>&1 || : + /usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : %postun nginx if [ $1 -eq 0 ]; then @@ -353,28 +801,48 @@ if [ $1 -eq 0 ]; then /usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : fi +# the selinux policies only cover owncloud right now +# once this package is accepted pull request for selinux-policy to add +# these will be made +%post +semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}/config.php' 2>/dev/null || : +semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}' 2>/dev/null || : +semanage fcontext -a -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}(/.*)?' 2>/dev/null || : +restorecon -R %{_sysconfdir}/%{name} || : +restorecon -R %{_localstatedir}/lib/%{name} || : + +%postun +if [ $1 -eq 0 ] ; then +semanage fcontext -d -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}/config.php' 2>/dev/null || : +semanage fcontext -d -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}' 2>/dev/null || : +semanage fcontext -d -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}(/.*)?' 2>/dev/null || : +fi + %files -%doc AUTHORS README.%{distro} MIGRATION.%{distro} config/config.sample.php +%doc AUTHORS README.fedora MIGRATION.fedora config/config.sample.php +%doc *_composer.json + %license *-LICENSE + %dir %attr(-,apache,apache) %{_sysconfdir}/%{name} # contains sensitive data (dbpassword, passwordsalt) %config(noreplace) %attr(0600,apache,apache) %{_sysconfdir}/%{name}/config.php -%config(noreplace) %{_sysconfdir}/php.d/60-%{name}.ini # need the symlink in confdir but it's not config %{_sysconfdir}/%{name}/ca-bundle.crt + %{_datadir}/%{name} %dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name} # user data must not be world readable %dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/data %attr(-,apache,apache) %{_localstatedir}/lib/%{name}/apps + %{_unitdir}/nextcloud-cron.service %{_unitdir}/nextcloud-cron.timer %files httpd %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf %{_sysconfdir}/httpd/conf.d/%{name}-access.conf.avail -%{_sysconfdir}/httpd/conf.d/%{name}*.inc -%config(noreplace) %{_sysconfdir}/php-fpm.d/%{name}.conf +%{_sysconfdir}/httpd/conf.d/*.inc %files nginx %config(noreplace) %{_sysconfdir}/nginx/default.d/%{name}.conf @@ -389,4 +857,50 @@ fi %changelog -%autochangelog +* Wed Jan 9 2019 Remi Collet - 10.0.4-6 +- drop dependency on php-password-compat #1658730 +- allow php-smbclient 1.0.0 #1663672 +- allow doctrine/dbal 2.x + +* Fri Jul 13 2018 Fedora Release Engineering - 10.0.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Feb 08 2018 Fedora Release Engineering - 10.0.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 10.0.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Mar 25 2017 Shawn Iwinski - 10.0.4-2 +- Add max versions to dependencies to limit each to 1 major version +- Update some dependencies to use php-composer(*) instead of package names +- Prepare for php-composer(google/apiclient) version 2 and new version 1 package + +* Tue Feb 28 2017 James Hogarth - 10.0.4-1 +- update to 10.0.4 +- Add migration from owncloud documentation +- Add systemd timer for background jobs + +* Wed Feb 08 2017 James Hogarth - 10.0.3-1 +- update to 10.0.3 + +* Thu Oct 06 2016 James Hogarth - 10.0.1-1 +- update to 10.0.1 + +* Mon Aug 01 2016 James Hogarth - 9.0.53-5 +- Use lua to have a common srpm between epel7 and fedora + +* Fri Jul 29 2016 James Hogarth - 9.0.53-4 +- Don't unbundle javascript on EPEL7 due to versioning issues + +* Fri Jul 29 2016 James Hogarth - 9.0.53-3 +- Unbundle javascript libraries from core where possible + +* Tue Jul 26 2016 James Hogarth - 9.0.53-2 +- Update the autoloader to use the path from the approved package + +* Tue Jul 19 2016 James Hogarth - 9.0.53-1 +- New release 9.0.53 + +* Thu Jul 14 2016 James Hogarth - 9.0.52-1 +- Initial nextcloud build diff --git a/plans/base.fmf b/plans/base.fmf deleted file mode 100644 index 58299cc..0000000 --- a/plans/base.fmf +++ /dev/null @@ -1,12 +0,0 @@ -summary: Basic occ functionality -discover: - how: fmf - url: https://src.fedoraproject.org/tests/nextcloud -prepare: - how: install - package: nextcloud -environment: - PACKAGES: nextcloud - VERSION: 20.0.2 RC1 -execute: - how: tmt diff --git a/sources b/sources index 95997de..307a663 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nextcloud-34.0.3.tar.bz2) = 3463dbbdeae5275a0791b115cf86aed41c5a138fdd19bb32ec12837a6698106b6f172e24fb1264a2d4e20b2b805bcf7841b2338e4e02f1fd5394fbed830cc695 +SHA512 (nextcloud-10.0.4.tar.bz2) = 4bb7a760b56088780eee7be83dd4c645703095f8bf11818f3d4cbf52c6636637d8724c3d972df068c54b0d98836ae29cd7c206e6fb5845ee646aeacc098e701d diff --git a/utils/get-bundled-versions.py b/utils/get-bundled-versions.py deleted file mode 100755 index 40fb247..0000000 --- a/utils/get-bundled-versions.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/env python - -import os -import json - -for root, dirs, files in os.walk("apps"): - for file in files: - if file == 'composer.lock': - with open(os.path.join(root, file)) as f: - lockdata = json.load(f) - try: - for i in lockdata['packages']: - print("Provides: bundled(php-composer(" + i['name'] + ")) = " + i['version'].strip('v')) - except KeyError: - pass - -for root, dirs, files in os.walk("3rdparty"): - for file in files: - if file == 'composer.lock': - with open(os.path.join(root, file)) as f: - lockdata = json.load(f) - try: - for i in lockdata['packages']: - print("Provides: bundled(php-composer(" + i['name'] + ")) = " + i['version'].strip('v')) - except KeyError: - pass diff --git a/utils/get-composer-requires.py b/utils/get-composer-requires.py deleted file mode 100755 index da48e8a..0000000 --- a/utils/get-composer-requires.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/env python - -import os -import json -import re -import subprocess -from colorama import Fore, Style - -defaultconstraint = 2 -excludes = ('php') -basedir = '..' -srcdir = os.path.join(basedir, 'nextcloud') -outdir = basedir -jsonfiles = ('3rdparty/composer.json', 'apps/files_external/3rdparty/composer.json') - -constraintmap = ('any', 'loose', 'strict', 'exact') - -def eval_version(version, constraint=3): - version = version.replace('v', '') - if version == '*': - constraint = 0 - version = '0' - elif version.startswith('^'): - constraint = 1 - version = version.strip('^') - elif version.startswith('~'): - constraint = 2 - version = version.strip('~') - - if re.search('[^.0-9]', version): - print('Unparseable version:', version) - version = '0.0.0' - constraint = 3 - - return version, constraint - -def get_requires(name, version, constraint): - splitver = version.split('.') - - if constraint == 0: - requires = 'php-composer(' + name + ')' - elif constraint == 1: - wipe = False - for i in range(0, len(splitver)): - if splitver[i] == '0' or wipe: - splitver[i] = '0' - else: - splitver[i] = str(int(splitver[i]) + 1) - wipe = True - requires = '(php-composer(' + name + ') >= ' + version + ' with php-composer(' + name + ') < ' + '.'.join(splitver) + ')' - elif constraint == 2: - splitver[-1] = '0' - splitver[-2] = str(int(splitver[-2]) + 1) - requires = '(php-composer(' + name + ') >= ' + version + ' with php-composer(' + name + ') < ' + '.'.join(splitver) + ')' - else: - requires = 'php-composer(' + name + ') = ' + version - return requires - -def repoquery(query): - stdout = subprocess.run(['dnf', 'repoquery', '-q', '--whatprovides', requires], stdout=subprocess.PIPE, universal_newlines=True, check = True).stdout - return stdout - -requirefile = open(os.path.join(outdir, 'require.pkgtmp'), 'w') -requirefile.write('# PHP composer dependencies\n') - -providefile = open(os.path.join(outdir, 'provide.pkgtmp'), 'w') -providefile.write('# Bundled libraries\n') - - -for file in jsonfiles: - requirefile.write(f"# From {file}\n") - providefile.write(f"# From {file}\n") - - with open(os.path.join(srcdir, file)) as f: - jsondata = json.load(f) - packages = jsondata['require'].items() - - print(f"\n{Style.BRIGHT}Parsing '{file}'...{Style.RESET_ALL}") - for name, verrange in packages: - if name in excludes: - print(f"{name} {verrange} -> in exclude list, skipping.") - continue - - version, constraint = eval_version(verrange, defaultconstraint) - - requires = get_requires(name, version, constraint) - package = repoquery(requires) - - color = Fore.GREEN - found = True - while len(package) == 0: - color = Fore.YELLOW - constraint -= 1 - if constraint < 0: - constraint = 0 - color = Fore.RED - package = 'none\n' - found = False - break - requires = get_requires(name, version, constraint) - package = repoquery(requires) - - print(f"{name} {verrange} -> {Style.BRIGHT}{color}{package.rstrip()}{Style.RESET_ALL} ({constraintmap[constraint]})") - - if found: - requirefile.write(f"Requires: {requires}\n") - else: - providefile.write(f"Provides: bundled(php-composer({name})) = {version}\n") -