From ff9fe5be0e0ac74625e5ae1538a548eaabc0d5a8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 25 Mar 2017 08:26:56 +0100 Subject: pull latest changes from Fedora + cron on EL6 --- .gitignore | 2 + owncloud-8.2.3-correct-cli-upgrade-command.patch | 13 --- owncloud-9.1.4-correct-cli-upgrade.patch | 30 +++++ owncloud-README.fedora | 11 +- owncloud-systemd-timer.service | 8 ++ owncloud-systemd-timer.timer | 10 ++ owncloud.spec | 133 ++++++++++++++++++++--- 7 files changed, 176 insertions(+), 31 deletions(-) create mode 100644 .gitignore delete mode 100644 owncloud-8.2.3-correct-cli-upgrade-command.patch create mode 100644 owncloud-9.1.4-correct-cli-upgrade.patch create mode 100644 owncloud-systemd-timer.service create mode 100644 owncloud-systemd-timer.timer diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ddfb76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.tar.bz2 +*.src.rpm diff --git a/owncloud-8.2.3-correct-cli-upgrade-command.patch b/owncloud-8.2.3-correct-cli-upgrade-command.patch deleted file mode 100644 index 95779fd..0000000 --- a/owncloud-8.2.3-correct-cli-upgrade-command.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/core/templates/update.admin.php b/core/templates/update.admin.php -index fbd3025..b9b00ef 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/owncloud/occ upgrade
-
- - diff --git a/owncloud-9.1.4-correct-cli-upgrade.patch b/owncloud-9.1.4-correct-cli-upgrade.patch new file mode 100644 index 0000000..79a8593 --- /dev/null +++ b/owncloud-9.1.4-correct-cli-upgrade.patch @@ -0,0 +1,30 @@ +diff --git a/core/templates/update.admin.php b/core/templates/update.admin.php +index 24b2bee..1013892 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/owncloud-README.fedora b/owncloud-README.fedora index df97145..c9fffe5 100644 --- a/owncloud-README.fedora +++ b/owncloud-README.fedora @@ -51,7 +51,7 @@ you first access the server it will be just a small stub containing settings that differ in this package from the upstream defaults. After you first access ownCloud, the initial setup process will populate it with some more settings. Other settings that can be provided in this file are documented at: -https://doc.owncloud.org/server/8.2/admin_manual/configuration_server/config_sample_php_parameters.html +https://doc.owncloud.org/server/9.1/admin_manual/configuration_server/config_sample_php_parameters.html User Data --------- @@ -96,3 +96,12 @@ dnf install 'php-pecl(apcu)' For further information see http://owncloud.org/ and http://doc.owncloud.org/ + +Scheduling Background Jobs +-------------------------- +The default behaviour is to use the AJAX webcron, however this is fairly inefficient and does not scale very well. + +It's recommended to set the option "Cron" to use the system scheduler and to enable the included systemd timer. + +systemctl enable --now owncloud-cron.timer + diff --git a/owncloud-systemd-timer.service b/owncloud-systemd-timer.service new file mode 100644 index 0000000..1e18b1a --- /dev/null +++ b/owncloud-systemd-timer.service @@ -0,0 +1,8 @@ +[Unit] +Description=Cron for owncloud background jobs + +[Service] +Type=oneshot +ExecStart=/usr/bin/php -f /usr/share/owncloud/cron.php +User=apache + diff --git a/owncloud-systemd-timer.timer b/owncloud-systemd-timer.timer new file mode 100644 index 0000000..75aed99 --- /dev/null +++ b/owncloud-systemd-timer.timer @@ -0,0 +1,10 @@ +[Unit] +Description=This triggers the owncloud cron service + +[Timer] +OnBootSec=5min +OnUnitInactiveSec=15min + +[Install] +WantedBy=timers.target + diff --git a/owncloud.spec b/owncloud.spec index 1e72f2b..04dd266 100644 --- a/owncloud.spec +++ b/owncloud.spec @@ -7,9 +7,16 @@ # # Please preserve changelog entries # + +%if 0%{?fedora} < 19 && 0%{?rhel} < 7 +%global with_systemd 0 +%else +%global with_systemd 1 +%endif + Name: owncloud Version: 9.1.4 -Release: 2%{?dist} +Release: 5%{?dist} Summary: Private file sync and share server Group: Applications/Internet @@ -42,6 +49,10 @@ 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. Patch2: %{name}-9.1.0-dont_update_htacess.patch @@ -56,7 +67,7 @@ Patch4: %{name}-9.1.0-google-autoloader.patch Patch5: %{name}-9.1.0-amazon-autoloader.patch # Display the appropriate upgrade command for fedora/epel users bz#1321417 -Patch6: %{name}-8.2.3-correct-cli-upgrade-command.patch +Patch6: %{name}-9.1.4-correct-cli-upgrade.patch # Disable the integrity checking whilst a better way to deal with it is found Patch7: %{name}-9.1.0-default_integrity_check_disabled.patch @@ -76,6 +87,13 @@ Patch11: %{name}-9.1.1-work-arround-nss-issue.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +# For the systemd macros +%if %{with_systemd} +%{?systemd_requires} +BuildRequires: systemd +%else +Requires: crontabs +%endif # expand pear macros on install BuildRequires: php-pear @@ -90,41 +108,60 @@ 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-opencloud >= 1.9.2 +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 BuildRequires: php-composer(pear/archive_tar) >= 1.4.1 BuildRequires: php-composer(pear/archive_tar) < 2.0 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 BuildRequires: php-composer(symfony/event-dispatcher) >= 2.8.3 +BuildRequires: php-composer(symfony/event-dispatcher) < 3.0 BuildRequires: php-composer(symfony/routing) >= 2.8.1 +BuildRequires: php-composer(symfony/routing) < 3.0 BuildRequires: php-composer(symfony/process) >= 2.8.1 +BuildRequires: php-composer(symfony/process) < 3.0 BuildRequires: php-composer(pimple/pimple) >= 3.0.2 BuildRequires: php-composer(pimple/pimple) < 4.0 BuildRequires: php-composer(ircmaxell/password-compat) >= 1.0.0 +BuildRequires: php-composer(ircmaxell/password-compat) < 2.0 BuildRequires: php-composer(nikic/php-parser) >= 1.4.1 BuildRequires: php-composer(nikic/php-parser) < 2.0 BuildRequires: php-composer(icewind/streams) >= 0.5.2 +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 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(kriswallsmith/assetic) >= 1.3.2-3 BuildRequires: php-composer(kriswallsmith/assetic) < 2.0 -BuildRequires: php-composer(icewind/smb) >= 1.1.0 +BuildRequires: php-composer(icewind/smb) >= 1.1.0 +BuildRequires: php-composer(icewind/smb) < 2.0 %if 0%{?rhel} != 5 BuildRequires: php-pecl(smbclient) >= 0.8.0 %endif -BuildRequires: php-google-apiclient >= 1.0.3 -BuildRequires: php-aws-sdk >= 2.7.0 +BuildRequires: php-composer(google/apiclient) >= 1.1.4 +# Note: 1.1.8 has BC breaks +BuildRequires: php-composer(google/apiclient) < 1.1.8 +BuildRequires: php-composer(aws/aws-sdk-php) >= 2.7.0 +BuildRequires: php-composer(aws/aws-sdk-php) < 3.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) @@ -180,19 +217,24 @@ 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-opencloud >= 1.9.2 +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" Requires: php-composer(pear/archive_tar) >= 1.4.1 @@ -204,12 +246,16 @@ 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 # "symfony/event-dispatcher": "2.8.3" Requires: php-composer(symfony/event-dispatcher) >= 2.8.3 +Requires: php-composer(symfony/event-dispatcher) < 3.0 # "symfony/routing": "2.8.1" Requires: php-composer(symfony/routing) >= 2.8.1 +Requires: php-composer(symfony/routing) < 3.0 # "symfony/process": "2.8.1" Requires: php-composer(symfony/process) >= 2.8.1 +Requires: php-composer(symfony/process) < 3.0 # "pimple/pimple": "3.0.2" Requires: php-composer(pimple/pimple) >= 3.0.2 @@ -217,6 +263,7 @@ Requires: php-composer(pimple/pimple) < 4.0 # "ircmaxell/password-compat": "1.0.*" Requires: php-composer(ircmaxell/password-compat) >= 1.0.0 +Requires: php-composer(ircmaxell/password-compat) < 2.0 # "nikic/php-parser": "1.4.1" Requires: php-composer(nikic/php-parser) >= 1.4.1 @@ -224,10 +271,12 @@ Requires: php-composer(nikic/php-parser) < 2.0 # "icewind/Streams": "0.5.2" Requires: php-composer(icewind/streams) >= 0.5.2 +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 @@ -237,20 +286,23 @@ 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 +# this includes pear/console_getopt and pear/PEAR # which is not listed in composer.json unlike archive_tar Requires: php-composer(pear/pear-core-minimal) >= 1.10.1 # "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 @@ -290,7 +342,8 @@ Requires: php-composer(lukasreschke/id3parser) < 1.0.0 #"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) >= 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 %if 0%{?rhel} != 5 @@ -314,17 +367,21 @@ Requires: %{_bindir}/smbclient Requires: php-pear(pear.dropbox-php.com/Dropbox) ## Google Drive external storage -Requires: php-google-apiclient >= 1.0.3 +## Version 1.1.4 for autoloader in /usr/share/php +## Note: 1.1.8 has BC breaks +Requires: php-composer(google/apiclient) >= 1.1.4 +Requires: php-composer(google/apiclient) < 1.1.8 ## AWS S3 external storage -Requires: php-aws-sdk >= 2.7.0 +Requires: php-composer(aws/aws-sdk-php) >= 2.7.0 +Requires: php-composer(aws/aws-sdk-php) < 3.0 -## For dependency of apps/gallery +## 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 -%if 0%{?rhel} +%if 0%{?fedora} < 21 && 0%{?rhel} < 7 Requires(post): policycoreutils-python Requires(postun): policycoreutils-python %endif @@ -495,7 +552,7 @@ find -type d -empty -delete # remove extraneous files now we've cleaned up rm "LICENSE INFO" patches.txt -# add our Fedora autoloader +# add our Fedora autoloader cp %{SOURCE8} ./autoload.php # Set the vendor directory to macro based datadir in our autoloader @@ -515,11 +572,15 @@ cat << 'EOF' | tee apps/files_external/3rdparty/autoload.php require_once '%{_datadir}/php/Icewind/Streams/autoload.php'; require_once '%{_datadir}/php/Icewind/SMB/autoload.php'; require_once '%{_datadir}/pear/Dropbox/autoload.php'; -require_once '%{_datadir}/php/Google/autoload.php'; +if (file_exists('%{_datadir}/php/Google1/autoload.php')) { + require_once '%{_datadir}/php/Google1/autoload.php'; +} else { + require_once '%{_datadir}/php/Google/autoload.php'; +} require_once '%{_datadir}/php/Aws/autoload.php'; EOF -# remove gallery external bundled libraries +# remove gallery external bundled libraries rm -r apps/gallery/vendor/{symfony,composer*} rm apps/gallery/composer.lock @@ -604,7 +665,7 @@ for d in $(find . -mindepth 1 -maxdepth 1 -type d | grep -v config); do done for f in {*.php,*.xml,*.html,occ,robots.txt}; do - install -pm 644 "$f" %{buildroot}%{_datadir}/%{name} + install -pm 644 "$f" %{buildroot}%{_datadir}/%{name} done # symlink config dir @@ -637,6 +698,20 @@ install -Dpm 644 %{SOURCE202} \ %{buildroot}%{_sysconfdir}/php-fpm.d/%{name}.conf %endif +%if %{with_systemd} +# Install the systemd timer +install -Dpm 644 %{SOURCE10} %{buildroot}%{_unitdir}/%{name}-cron.service +install -Dpm 644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}-cron.timer +%else +install -d %{buildroot}%{_sysconfdir}/cron.d/ +cat < - 9.1.4-5 +- backport latest Fedora changes +- add disabled /etc/cron.d/owncloud on EL <= 6 + +* Fri Mar 24 2017 Shawn Iwinski - 9.1.4-5 +- 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 + +* Mon Mar 06 2017 James Hogarth - 9.1.4-4 +- A nextcloud slipped in by accident with the systemd timer unit name + +* Tue Feb 28 2017 James Hogarth - 9.1.4-3 +- Add optional systemd timer for cron bz#1419344 +- Better message for Fedora users on large installs bz#1410117 + * Fri Feb 17 2017 Remi Collet - 9.1.4-2 - apply missing patch (integrity check) -- cgit