SHA256
1
0
forked from pool/nextcloud
nextcloud/nextcloud.spec
Eric Schirra c6d25b3668 Accepting request 1041791 from home:ecsos:server
- Update to 24.0.8
  - Update guzzlehttp/guzzle requirement from 7.4.5 to 7.5.0 in /build/integration (server#33888)
  - Add rate limiting on lost password emails (server#34659)
  - Emit typed event when preview is requested (server#34855)
  - Avoid double ldap_unbind in Wizard.php (server#34942)
  - Skip general login with email for non-valid addresses and LDAP (server#34947)
  - Cleanup tempfiles after each cron job run (server#34949)
  - Run session token renewals in a database transaction (server#34952)
  - Fix invalid date in security.txt (server#34966)
  - Avoid a crash when a PHP extension has no version (server#35005)
  - Fix unsuccessful token login logged as error (server#35012)
  - Only show cron warning after 24h due to time insensitive jobs (server#35018)
  - Fix duplicate event email notifications (server#35019)
  - Cast to int (server#35022)
  - Add repair command to fix wrong share ownership (server#35039)
  - Fix size calculation on copying the skeleton files (server#35049)
  - Add description for calendar uri (server#35059)
  - Fix sidebar not automatically hidden in Files app (server#35061)
  - Fix top margin in empty versions list (server#35065)
  - Make sure that path is normalized and then checked, (server#35088)
  - Fix HTML entities not decoded in comment just added (server#35100)
  - Fix PublicKeyTokenProviderTest import and mock (server#35101)
  - Appropriate length check in Notification.php (server#35113)
  - Use the updated mariadb10.6 container in drone (server#35114)
  - Fix distorted previews when using imaginary (server#35115)
  - [LDAP] always create instance of own user manager (server#35131)
  - Run integration tests on 3rdparty bump (server#35134)
  - Revert “Appropriate length check in Notification.php” (server#35140)
  - Detect weird local ips (server#35141)
  - Make sure to not pass null to DateTime::createFromFormat (server#35162)
  - Mark more config values as sensitive (server#35200)
  - Fix settings for setting default expiration date (server#35215)
  - Fix JSON error when comment has no reactions (server#35245)
  - Properly compare quota against both float/int values (server#35250)
  - Delay updating setup providers untill we register the mounts (server#35258)
  - Also cancel XHR when cancelling uploads (server#35266)
  - Hide warning about missing apps for when shipped in the next version (server#35292)
  - Bump swiftmailer/swiftmailer to 6.3.0 in stable24 (server#35297)
  - Don’t use quota cache through user management (server#35313)
  - Fix mentions rendering in comment editor (server#35321)
  - Check quota on file copy (server#35328)
  - Check quota on file copy (server#35332)
  - Revert “Fix quota type to int” (server#35334)
  - Prevents the selection of encrypted folders when clicking on the “Select all” checkbox (server#35349)
  - Handle badly named version files more gracefully and log information (server#35351)
  - Fix forwarding the object id when searching comments (server#35356)
  - Update cache when file size === 0 (server#35367)
  - Fix UX of renaming token (server#35392)
  - Update some libs (server#35395)
  - Do not check quota for non Node (server#35409)
  - Update behat/behat requirement from ~3.11.0 to ~3.12.0 in /build/integration (server#35564)
  - Downgrade ubuntu in order to fix CI (server#35607)
  - Add mlocati/ip-lib in stable24 (3rdparty#1221)
  - Bump swiftmailer/swiftmailer to 6.3.0 in stable24 (3rdparty#1237)
  - Run NPM audit fix (activity#1004)
  - Update nextcloud/ocp dependency (activity#993)
  - Do not pass an instance of User where a string is expected (activity#996)
  - Update nextcloud/ocp dependency (activity#999)
  - Re-activate getMember() (circles#1204)
  - Refresh cache on demand (circles#1215)
  - Avoid exception loop (circles#1221)
  - Audit fix (files_pdfviewer#682)
  - Update nextcloud/ocp dependency (firstrunwizard#753)
  - Update some libs (logreader#818)
  - Update nextcloud/ocp dependency (nextcloud_announcements#132)
  - Update nextcloud/ocp dependency (nextcloud_announcements#135)
  - Still push notifications of twofactor_nextcloud_notification when in DND (notifications#1356)
  - Update nextcloud/ocp dependency (notifications#1359)
  - Update nextcloud/ocp dependency (notifications#1364)
  - Run NPM audit fix (notifications#1372)
  - Update user status with event data (notifications#1378)
  - Update some libs (password_policy#412)
  - Update nextcloud/ocp dependency (photos#1442)
  - Bump @vue/test-utils from 1.3.0 to 1.3.3 (photos#1461)
  - Bump postcss from 8.4.18 to 8.4.19 (photos#1479)
  - Update nextcloud/ocp dependency (photos#1480)
  - Run npm audit fix (photos#1496)
  - Audit fix (privacy#813)
  - Bump @nextcloud/dialogs from 3.1.2 to 3.1.4 (privacy#816)
  - Fix(deps): update dependency prosemirror-markdown to ^1.10.1 (text#3339)
  - Update nextcloud/ocp dependency (text#3341)
  - Avoid saving without changes (text#3351)
  - Chore(deps): update dependency @cypress/webpack-preprocessor to ^5.15.3 (text#3360)
  - Chore(deps): update dependency @vue/test-utils to ^1.3.3 (text#3361)
  - Fix(deps): update tiptap to ^2.0.0-beta.202 (text#3362)
  - Chore(deps): update dependency eslint-plugin-jsdoc to ^39.6.2 (text#3363)
  - Update nextcloud/ocp dependency (text#3366)
  - DirectEditing: Set session user for DirectSession editing (text#3372)
  - Chore(deps): update dependency @cypress/webpack-preprocessor to ^5.15.4 (text#3387)
  - Don’t apply author annotations when in composition (text#3396)
  - Set IUserSession user in SessionController if available (text#3398)
  - Fix typo in serializePlainText (text#3402)
  - Disable rich workspace rendering when view is not visible (text#3403)
  - Chore(deps): update dependency @cypress/webpack-preprocessor to ^5.15.5 (text#3413)
  - Update nextcloud/ocp dependency (text#3418)
  - Fix(deps): update dependency core-js to ^3.26.1 (text#3421)
  - Fix(deps): update tiptap (text#3441)
  - Chore(deps): update dependency regenerator-runtime to ^0.13.11 (text#3448)
  - Fix(deps): update dependency prosemirror-model to ^1.18.3 (text#3457)
  - Update npm dependencies (text#3469)
  - Bring back menubar without formatting on plain text mode (text#3475)
  - Audit fix (viewer#1478)

OBS-URL: https://build.opensuse.org/request/show/1041791
OBS-URL: https://build.opensuse.org/package/show/server:php:applications/nextcloud?expand=0&rev=188
2022-12-09 06:44:51 +00:00

328 lines
11 KiB
RPMSpec

#
# spec file for package nextcloud
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#
%if 0%{?suse_version}
%define apache_myserverroot %{apache_serverroot}/htdocs
%define apache_confdir %{apache_sysconfdir}/conf.d
%define apache_docdir /usr/share/doc/packages
%else
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
%define apache_serverroot /var/www/html
%define apache_confdir /etc/httpd/conf.d
%define apache_user apache
%define apache_group apache
%define __jar_repack 0
%else
%define apache_serverroot /var/www
%define apache_confdir /etc/httpd/conf.d
%define apache_user www
%define apache_group www
%endif
%endif
%define nc_user %{apache_user}
%define nc_dir %{apache_myserverroot}/%{name}
%define ocphp_bin /usr/bin
%if 0%{?rhel} == 600 || 0%{?rhel_version} == 600 || 0%{?centos_version} == 600
%define statedir /var/run
%else
%define statedir /run
%endif
Name: nextcloud
Version: 24.0.8
Release: 0
Summary: File hosting service
License: AGPL-3.0-only
Group: Productivity/Networking/Web/Utilities
URL: https://nextcloud.com
Source0: https://download.nextcloud.com/server/releases/%{name}-%{version}.tar.bz2
Source1: apache_secure_data
Source2: README
Source3: README.SELinux
Source4: README.SUSE
Source5: robots.txt
Source10: %{name}-cron
Source11: %{name}-cron.service
Source12: %{name}-cron.timer
Source99: %{name}-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: apache-rpm-macros
BuildRequires: cron
BuildRequires: fdupes
BuildRequires: unzip
#
Requires: cron
Requires: curl
Requires: libxml2-2
Requires: mariadb >= 10.2
Requires: php-bz2
Requires: php-dom
Requires: php-gd
Requires: php-intl
Requires: php-json
Requires: php-mbstring
Requires: php-mysql
Requires: php-posix
Requires: php-zip
#
%if 0%{?fedora_version} || 0%{?rhel} || 0%{?rhel_version} || 0%{?centos_version}
Requires: php < 8.2.0
Requires: php >= 7.4.0
Requires: php-process
Requires: php-xml
Recommends: sqlite
%endif
#
%if 0%{?suse_version}
Requires: php-ctype
Requires: php-curl
# SUSE does not include the fileinfo module in php-common.
Requires: php-fileinfo
Requires: php-iconv
Requires: php-openssl
Requires: php-pear
Requires: php-xmlreader
Requires: php-xmlwriter
Requires: php-zip
Requires: php-zlib
Recommends: sqlite3
%{?systemd_requires}
%endif
# Database connectors:
Recommends: php-sqlite
#Recommends: php-pgsql
# Require for specific apps:
Requires: php-ftp
Requires: php-ldap
#Requires: php-imap
#Requires: php-smbclient
# Recommend for specific apps:
Recommends: php-exif
Recommends: php-gmp
# For enhanced server performance:
Recommends: php-APCu
Recommends: php-bcmath
# For preview generation:
Recommends: php-imagick
Recommends: php-ffmpeg
#Recommends: libreoffice
# For command line processing:
Recommends: php-pcntl
%description
Nextcloud is a suite of client-server software for creating file
hosting services and using them.
%package apache
Summary: Apache configuration for %{name}
Group: Productivity/Networking/Web/Utilities
BuildRequires: apache2 >= 2.4
Requires: %{name} = %{version}
Requires: apache2
Requires: mod_php_any < 8.2.0
Requires: mod_php_any >= 7.4.0
Supplements: packageand(apache2:%name)
%description apache
This subpackage contains the Apache configuration files
%prep
%setup -q -n %{name}
cp %{SOURCE2} .
cp %{SOURCE3} .
cp %{SOURCE4} .
cp %{SOURCE5} .
### Don't remove git files!!
### git files should not be removed, otherwise nextcloud rise up integrity check failure in some situations.
###
## delete unneeded gitfiles
#rm -r `find . -name ".gitignore" -or -name ".gitkeep" -or -name ".github"`
## remove entries in signature.json to prevent integrity check failure
#find . -iname signature.json \
# -exec sed -i "/\/.gitignore\": ./d" "{}" \; \
# -exec sed -i "/\/.gitkeep\": ./d" "{}" \; \
# -exec sed -i "/\/.github\": ./d" "{}" \;
#rm -f 3rdparty/symfony/debug/Resources/ext/*.{c,h}
%build
%install
# no server side java code contained, alarm is false
idir=$RPM_BUILD_ROOT/%{apache_myserverroot}/%{name}
mkdir -p $idir
mkdir -p $idir/data
mkdir -p $idir/search
cp -aRf * $idir
cp -aRf .htaccess $idir
cp -aRf .user.ini $idir
# $idir/l10n to disappear in future
#rm -f $idir/l10n/l10n.pl
if [ ! -f $idir/robots.txt ]; then
install -p -D -m 644 %{SOURCE5} $idir/robots.txt
fi
# create the AllowOverride directive
install -p -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{apache_confdir}/nextcloud.conf
ocpath="%{apache_myserverroot}/%{name}"
sed -i -e"s|@DATAPATH@|${ocpath}|g" $RPM_BUILD_ROOT/%{apache_confdir}/nextcloud.conf
# not needed for distro packages
rm -f ${idir}/indie.json
%if 0%{?suse_version}
# link duplicate doc files
%fdupes -s $RPM_BUILD_ROOT/%{apache_myserverroot}/%{name}
%endif
# CronJob
install -d -m 0755 %{buildroot}%{_sysconfdir}/cron.d
install -D -m 0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/cron.d/%{name}
install -D -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}-cron.service
install -D -m 0644 %{SOURCE12} %{buildroot}%{_unitdir}/%{name}-cron.timer
sed -i -e"s|@APACHE_USER@|%{apache_user}|g" %{buildroot}%{_sysconfdir}/cron.d/%{name}
sed -i -e"s|@APACHE_MYSERVERROOT@|%{apache_myserverroot}|g" %{buildroot}%{_sysconfdir}/cron.d/%{name}
sed -i -e"s|@APACHE_USER@|%{apache_user}|g" %{buildroot}%{_unitdir}/%{name}-cron.service
sed -i -e"s|@APACHE_MYSERVERROOT@|%{apache_myserverroot}|g" %{buildroot}%{_unitdir}/%{name}-cron.service
mkdir -p %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-cron
%pre
%service_add_pre %{name}-cron.timer %{name}-cron.service
# avoid fatal php errors, while we are changing files
# https://github.com/nextcloud
#
# We don't do this for new installs. Only for updates.
# If the first argument to pre is 1, the RPM operation is an initial installation. If the argument is 2,
# the operation is an upgrade from an existing version to a new one.
if [ $1 -gt 1 -a ! -s %{statedir}/apache_stopped_during_nextcloud_install ]; then
echo "o %{name} pre-install: Checking for running Apache"
# FIXME: this above should make it idempotent -- a requirement with openSUSE.
# it does not work.
%if 0%{?suse_version} && 0
service apache2 status | grep running > %{statedir}/apache_stopped_during_nextcloud_install
service apache2 stop
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
service httpd status | grep running > %{statedir}/apache_stopped_during_nextcloud_install
service httpd stop
%endif
fi
if [ -s %{statedir}/apache_stopped_during_nextcloud_install ]; then
echo "o %{name} pre-install: Stopping Apache"
fi
if [ $1 -eq 1 ]; then
echo "o %{name} pre-install: First install starting"
else
echo "o %{name} pre-install: Upgrade starting ..."
fi
# https://github.com/nextcloud
if [ -x %{ocphp_bin}/php -a -f %{nc_dir}/occ ]; then
echo "o %{name} pre-install: occ maintenance:mode --on"
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ maintenance:mode --on" || true
echo yes > %{statedir}/occ_maintenance_mode_during_nextcloud_install
fi
%post
%service_add_post %{name}-cron.timer %{name}-cron.service
if [ $1 -eq 1 ]; then
%if 0%{?suse_version}
%if 0%{?sle_version} >= 150400 || 0%{?suse_version} > 1500
a2enmod php8
%else
a2enmod php7
%endif
%endif
fi
if [ -s %{statedir}/apache_stopped_during_nextcloud_install ]; then
echo "o %{name} post-install: Restarting Apache"
## If we stopped apache in pre section, we now should restart. -- but *ONLY* then!
## Maybe delegate that task to occ upgrade? They also need to handle this, somehow.
%if 0%{?suse_version}
service apache2 start
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
service httpd start
%endif
fi
if [ -s %{statedir}/occ_maintenance_mode_during_nextcloud_install ]; then
echo "o %{name} post-install: occ maintenance:repair (fix possible errors)"
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ maintenance:repair" || true
echo "o %{name} post-install: occ db:add-missing-* (add missing db things)"
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ maintenance:mimetype:update-db" || true
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ db:add-missing-columns" || true
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ db:add-missing-indices" || true
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ db:add-missing-primary-keys" || true
echo "o %{name} post-install: occ update apps"
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ app:update --all" || true
echo "o %{name} post-install: occ upgrade"
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ upgrade" || true
echo "o %{name} post-install: occ maintenance:mode --off"
su %{nc_user} -s /bin/sh -c "cd %{nc_dir}; PATH=%{ocphp_bin}:$PATH php ./occ maintenance:mode --off" || true
fi
rm -f %{statedir}/apache_stopped_during_nextcloud_install
rm -f %{statedir}/occ_maintenance_mode_during_nextcloud_install
if [ $1 -eq 1 ]; then
echo "o %{name} post-install: First install complete"
else
echo "o %{name} post-install: Upgrade complete"
fi
%preun
%service_del_preun %{name}-cron.timer %{name}-cron.service
%postun
%service_del_postun %{name}-cron.timer %{name}-cron.service
%files
%defattr(644,root,root,755)
%exclude %{apache_myserverroot}/%{name}/README
%exclude %{apache_myserverroot}/%{name}/README.SUSE
%exclude %{apache_myserverroot}/%{name}/README.SELinux
%doc README README.SUSE README.SELinux
%config(noreplace) %{_sysconfdir}/cron.d/%{name}
%{_sbindir}/rc%{name}-cron
%{_unitdir}/%{name}-cron.service
%{_unitdir}/%{name}-cron.timer
%{apache_myserverroot}/%{name}
%attr(-,%{apache_user},%{apache_group}) %{apache_myserverroot}/%{name}/occ
%config(noreplace) %{apache_myserverroot}/%{name}/.user.ini
%defattr(664,%{apache_user},%{apache_group},775)
%{apache_myserverroot}/%{name}/apps
%{apache_myserverroot}/%{name}/core/js/mimetypelist.js
%dir %{apache_myserverroot}/%{name}/core/img/filetypes
%defattr(660,%{apache_user},%{apache_group},770)
%{apache_myserverroot}/%{name}/config
%{apache_myserverroot}/%{name}/data
%files apache
%config(noreplace) %{apache_confdir}/nextcloud.conf
%changelog