%define version 15.0.0 %define rel 1 %define prerel %{nil} %if "%{prerel}" != "%{nil}" %define lc_prerel %(echo %{prerel} | tr "A-Z" "a-z") %define release %mkrel 1.%{lc_prerel}.%{rel} %else %define release %mkrel %{rel} %endif # exclude PHP dependencies as long as their usage is not proven %define __requires_exclude_from ^%{_datadir}/.*$ %define __jar_repack %{nil} Summary: Open personal cloud Name: nextcloud Version: %{version} Release: %{release} License: AGPLv3 Group: Networking/WWW Url: http://nextcloud.com Source0: https://download.nextcloud.com/server/releases/%{name}-%{version}%{?prerel}.tar.bz2 Source1: %{name}-httpd.conf Source2: %{name}-httpd.inc Source4: %{name}-mysql.txt Source5: %{name}-postgresql.txt Source7: %{name}-config.php # Disable the integrity checking whilst a better way to deal with it is found Patch5: %{name}-14.4.0-default_integrity_check_disabled.patch # Direct the admin to the correct cli command for upgrades Patch9: %{name}-12.0.2-correct-cli-upgrade.patch Requires: apache-mod_php >= 3:7.2.0 Requires: php-curl >= 3:7.2.0 Requires: php-dom >= 3:7.2.0 Requires: php-exif >= 3:7.2.0 Requires: php-fileinfo >= 3:7.2.0 Requires: php-gd >= 3:7.2.0 Requires: php-iconv >= 3:7.2.0 Requires: php-json >= 3:7.2.0 Requires: php-ldap >= 3:7.2.0 Requires: php-mbstring >= 3:7.2.0 Requires: php-openssl >= 3:7.2.0 Requires: php-pcre >= 3:7.2.0 Recommends: php-pcntl >= 3:7.2.0 Requires: php-pdo >= 3:7.2.0 Requires: php-session >= 3:7.2.0 Requires: php-simplexml >= 3:7.2.0 Requires: php-xmlwriter >= 3:7.2.0 Requires: php-zip >= 3:7.2.0 Requires: php-filter >= 3:7.2.0 Requires: %{name}-database = %{version}-%{release} BuildArch: noarch %description A personal cloud server which runs on you personal server and enables accessing your data from everywhere and sharing with other people. %package mysql Summary: MySQL database support for NextCloud Provides: %{name}-database = %{version}-%{release} Requires: %{name} = %{version}-%{release} # From getSupportedDatabases, mysql => pdo, mysql Requires: php-pdo_mysql >= 3:7.2.0 %description mysql This package ensures the necessary dependencies are in place for NextCloud to work with MySQL / MariaDB databases. It does not require a MySQL / MariaDB server to be installed, as you may well wish to use a remote database server. 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} # From getSupportedDatabases, pgsql => function, pg_connect Requires: php-pdo_pgsql >= 3:7.2.0 %description postgresql This package ensures the necessary dependencies are in place for NextCloud to work with a PostgreSQL database. It does not require the PostgreSQL server package to be installed, as you may well wish to use a remote database server. If you want the database to be on the same system as NextCloud itself, you must also install and enable the PostgreSQL server package. See README.postgresql for more details. %package sqlite Summary: SQLite 3 database support for NextCloud Provides: %{name}-database = %{version}-%{release} Requires: %{name} = %{version}-%{release} # From getSupportedDatabases, pgsql => class, SQLite3 Requires: php-pdo_sqlite >= 3:7.2.0 Requires: php-pcre >= 3:7.2.0 %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 %setup -q -n %{name} %autopatch -p 1 cp %{SOURCE4} README.mysql cp %{SOURCE5} README.postgresql # drop upstream update notification app rm -rf apps/updatenotification # also remove the actual updater rm -rf updater %install install -d -m 755 %{buildroot}%{_datadir}/%{name} # create nextcloud datadir install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}/data # create writable app dir for appstore install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}/apps # create nextcloud sysconfdir install -d -m 755 %{buildroot}%{_sysconfdir}/%{name} # install content 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,occ,robots.txt}; do install -p -m 644 "$f" %{buildroot}%{_datadir}/%{name} done # symlink config dir ln -sf %{_sysconfdir}/%{name} %{buildroot}%{_datadir}/%{name}/config # nextcloud looks for ca-bundle.crt in config dir ln -sf %{_sysconfdir}/pki/tls/certs/ca-bundle.crt %{buildroot}%{_sysconfdir}/%{name}/ca-bundle.crt # set default config install -p -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/%{name}/config.php install -D -m 644 %{SOURCE1} %{buildroot}%{webappconfdir}/%{name}.conf install -D -m 644 %{SOURCE2} %{buildroot}%{webappconfdir}/%{name}.inc cat > %{buildroot}%{_datadir}/%{name}/.htaccess < %{buildroot}%{_sysconfdir}/cron.d/%{name} <