nextcloud/nextcloud.spec
Eric Schirra b727d1eba0 Accepting request 910354 from home:ecsos:server
- Update to 22.1.0
  - Update guzzlehttp/guzzle requirement from 6.5.2 to 7.3.0 in 
    /build/integration (server#27654)
  - Bump vue and vue-template-compiler (server#27658)
  - Bump vue-router from 3.5.1 to 3.5.2 (server#27659)
  - Ignore subdomain for soa queries (server#27825)
  - Fix in locking cache check (server#27826)
  - Fixes recursion count incrementation (server#27848)
  - Make search popup usable on mobile, too (server#27856)
  - Cache images on browser (server#27861)
  - Fix add group button (server#27878)
  - Fix dark theme on public link shares (server#27889)
  - Make user status usable on mobile (server#27898)
  - Check if dns_get_record returns non-false (server#27925)
  - Correctly skip suppressed errors in PHP 8.0 (server#27938)
  - Fix newfileMenu on public page (server#27942)
  - Do not escape display name in dashboard welcome text (server#27944)
  - Fix svg icons disapearing in app navigation when text overflows (server#27957)
  - Revert "Update guzzlehttp/guzzle requirement from 6.5.2 to 7.3.0
    in /build/integration" (server#27959)
  - Also hide group from direct matches (server#27964)
  - Show registered breadcrumb detail views in breadcrumb menu (server#27966)
  - Fix regression in file sidebar (server#27974)
  - Allow to get a local cloud id without going through the contacts
    manager (server#27979)
  - Multiple Emails UI and Integration (server#28001)
  - Improve notcreatable permissions hint (server#28008)
  - Some multiselect design fixes (server#28011)
  - Only display supported email scopes (server#28014)
  - Update CRL due to revoked twofactor_nextcloud_notification.crt (server#28016)
  - Increase footer height for longer menus (server#28043)
  - Add titleTooltip to sidebar (server#28047)
  - Mask password for Redis and RedisCluster on connection failure (server#28053)
  - Fix missing theming for login button (server#28061)
  - Improve Emails UX (server#28071)
  - Fix overlapping of elements in certain views (server#28073)
  - Disable HEIC image preview provider for performance concerns (server#28079)
  - Improve provider check (server#28085)
  - Sanitize more functions from the encryption app (server#28089)
  - Hide download button for public preview of audio files (server#28093)
  - Fix dark theme in file exists dialog (server#28109)
  - Support redis user password auth and tls encryption (server#28112)
  - Bump @babel/core from 7.14.3 to 7.14.8 (server#28121)
  - Let memory limit set in tests fit the used amount (server#28123)
  - Bump @nextcloud/babel-config from 1.0.0-beta.1 to 1.0.0 (server#28126)
  - Allow empty Redis config (server#28131)
  - Add an option to the multiple files selected actions to add and
    remov… (server#28135)
  - Bump css-vars-ponyfill from 2.4.3 to 2.4.5 (server#28149)
  - Make sure that the dav propfind plugins always use the proper
    user id (server#28152)
  - Admin Audit - Sharing: createShare - report the full path (server#28167)
  - Fix sort function of files multiple selection actions (server#28168)
  - User management - Add icon to user groups (server#28170)
  - Bump @babel/preset-env from 7.14.7 to 7.14.8 (server#28177)
  - Bump sass from 1.35.1 to 1.35.2 (server#28179)
  - Bump autosize from 4.0.2 to 4.0.4 (server#28181)
  - Fix variable override in file view (server#28193)
  - Fix comments file action sidebar opening (server#28197)
  - Set openfile params when following internal links (server#28215)
  - Fix Files breadcrumbs being hidden even if there is enough
    space (server#28222)
  - Dont apply jail search filter is on the root (server#28228)
  - Fix missing label of Search function (server#28244)
  - Add missing order attribute to tag multiselect action (server#28247)
  - Update guzzlehttp/guzzle requirement from 6.5.2 to 6.5.5 in 
    /build/integration (server#28269)
  - Bump css-loader from 5.2.6 to 5.2.7 (server#28270)
  - Bump css-vars-ponyfill from 2.4.5 to 2.4.6 (server#28272)
  - Bump regenerator-runtime from 0.13.7 to 0.13.9 (server#28273)
  - Fix "Enable notification emails" (activity#611)
  - Show add, del and restored files within by and self filter (activity#614)
  - Only call getCloudId if needed (activity#618)
  - Link from app-navigation-settings to personal settings (activity#623)
  - Remove echo (circles#688)
  - Returns files shared to Personal (circles#698)
  - Make cs-fix/cs-check (circles#699)
  - Cs fix (circles#700)
  - Backport of 704 (circles#708)
  - Avoid timeout on check (circles#709)
  - Better probe (circles#714)
  - Removing hidden flag by default (circles#717)
  - Generate probe if needed (circles#719)
  - Adding unified search (circles#721)
  - Detect source of search (circles#724)
  - Remove root circles from search for new members (circles#727)
  - Sending mail on new shares (circles#729)
  - GetDefinition (circles#732)
  - Cloud_force_base (circles#737)
  - Fixing notification and mails (circles#738)
  - Remote inherited and memberships (circles#740)
  - Sendmail on new fileshare (circles#741)
  - Fix phpdoc+lint (circles#742)
  - Better display of mail addresses (circles#744)
  - Limit non-local circles as members of local circles (circles#747)
  - Local stays local (circles#749)
  - Local circles starts local (circles#751)
  - Throw instead of doing nothing (circles#754)
  - Send mails to inherited members on GS (circles#755)
  - Optional details on Link (circles#757)
  - Include and config path in loopback (circles#759)
  - Cleaning old code (circles#761)
  - Migration to 22.1.0 - child shares (circles#762)
  - Fix pdfviewer design (files_pdfviewer#445)
  - Include version number in firstrunwizard (firstrunwizard#568)
  - Remove timeout of browser notifications (notifications#1049)
  - Some Design fixes (text#1711)
  - Unify error responses and add logging where appropriate (text#1717)
  - Bump eslint-plugin-import from 2.23.3 to 2.23.4 (text#1734)
  - Bump @babel/core from 7.14.3 to 7.14.6 (text#1739)
  - Fix: rich workspaces overlap with new file dropdown (text#1769)
  - Azul/fix links 1676 (text#1775)
  - Extend mimetypes for direct editing (text#1781)
  - Bump @vue/test-utils from 1.2.1 to 1.2.2 (text#1792)
  - Make occ command return an integer as return code (text#1797)
  - Custom input rule to add first character after bullet
    (Backport #1798) (text#1806)
  - Fix: cypress icon close selector (text#1808)
  - Disable header timeout on mobile (viewer#977)

OBS-URL: https://build.opensuse.org/request/show/910354
OBS-URL: https://build.opensuse.org/package/show/server:php:applications/nextcloud?expand=0&rev=154
2021-08-05 15:48:06 +00:00

328 lines
11 KiB
RPMSpec

#
# spec file for package nextcloud
#
# Copyright (c) 2021 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: 22.1.0
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.1.0
Requires: php >= 7.3.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: php7-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 < 7.5.0
Requires: mod_php_any >= 7.3.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%{?suse_version} >= 1500
a2enmod php7
%else
a2enmod php5
%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