Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates-src > by-pkgid > dc5feca39412fbab1eebceada9450c1e > files > 10

nextcloud-12.0.6-3.mga6.src.rpm

%define version 12.0.6
%define rel 3
%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
# Stop OC from trying to do stuff to .htaccess files. Just calm down, OC.
# Distributors are on the case.
Patch1:       %{name}-12.0.2-dont_update_htacess.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
# Direct the admin to the correct cli command for upgrades
Patch9:       %{name}-12.0.2-correct-cli-upgrade.patch
Requires:     apache-mod_php
Requires:     php-curl
Requires:     php-dom
Requires:     php-exif
Requires:     php-fileinfo
Requires:     php-gd
Requires:     php-iconv
Requires:     php-json
Requires:     php-ldap
Requires:     php-mbstring
Requires:     php-openssl
Requires:     php-pcre
Requires:     php-pdo
Requires:     php-session
Requires:     php-simplexml
Requires:     php-xmlwriter
Requires:     php-zip
Requires:     php-filter
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

%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

%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 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
%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,*.xml,*.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 <<EOF
# Version: %{version}
EOF

install -d -m 755 %{buildroot}%{_sysconfdir}/cron.d
cat > %{buildroot}%{_sysconfdir}/cron.d/%{name} <<EOF
# Run cron from to execute task even when no user connected
*/15 * * * * apache /usr/bin/php -f /usr/share/nextcloud/cron.php
EOF

cat > README.urpmi <<EOF
Upgrade information

Starting with Nextcloud version 12, the config file changes a lot. 
When upgrading from a previous version, you will have to edit by yourself
the config file using /etc/nextcloud/config.php.rpmnew as reference.
EOF


%pre
# on update from previous release, move data directory from
# %{_localstatedir}/lib/%{name} to %{_localstatedir}/lib/%{name}/data
if [ $1 -gt 1 ] ; then
    if [ -d %{_localstatedir}/lib/%{name}/ -a ! -d %{_localstatedir}/lib/%{name}/data ]; then
        mv %{_localstatedir}/lib/%{name} %{_localstatedir}/lib/%{name}.tmp
        mkdir %{_localstatedir}/lib/%{name}
        mv %{_localstatedir}/lib/%{name}.tmp %{_localstatedir}/lib/%{name}/data
    fi
fi


%files
%doc AUTHORS config/config.sample.php README.urpmi

%dir %attr(-,apache,apache) %{_sysconfdir}/%{name}
%config(noreplace) %attr(0600,apache,apache) %{_sysconfdir}/%{name}/config.php
%{_sysconfdir}/%{name}/ca-bundle.crt

%{_datadir}/%{name}

%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}
%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}/apps
%dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/data

%config(noreplace) %{webappconfdir}/nextcloud.conf
%config(noreplace) %{webappconfdir}/nextcloud.inc
%config(noreplace) %{_sysconfdir}/cron.d/%{name}

%files mysql
%doc README.mysql

%files postgresql
%doc README.postgresql

%files sqlite


%changelog
* Tue May 01 2018 zezinho <zezinho> 12.0.6-3.mga6
  (not released yet)
+ Revision: 1224172
- Rebuild to fix broken signature
- sqlite and pgsql requires now pdo
- new security fix mga#22936
- add README.urpmi
- new version to MGA6 fix #22026

* Tue May 16 2017 luigiwalser <luigiwalser> 11.0.3-1.mga6
+ Revision: 1102246
- 11.0.3

* Sun Mar 05 2017 neoclust <neoclust> 11.0.2-1.mga6
+ Revision: 1088905
- New version 11.0.2

* Sun Jan 01 2017 luigiwalser <luigiwalser> 10.0.2-1.mga6
+ Revision: 1078936
- 10.0.2

* Sun Dec 11 2016 ngompa <ngompa> 10.0.1-3.mga6
+ Revision: 1074254
- Remove unneeded %%pretrans

* Mon Oct 24 2016 neoclust <neoclust> 10.0.1-2.mga6
+ Revision: 1063374
- Requires php-opcache

* Wed Oct 12 2016 zezinho <zezinho> 10.0.1-1.mga6
+ Revision: 1060534
- new version now in tar.bz2

* Tue Sep 13 2016 neoclust <neoclust> 10.0.0-1.mga6
+ Revision: 1052529
- New version 10.0.0

* Wed Aug 10 2016 neoclust <neoclust> 9.0.53-1.mga6
+ Revision: 1045479
- Add owncloud.conf for compatibility
- New version 9.0.53

* Mon Jul 04 2016 neoclust <neoclust> 9.0.50-2.mga6
+ Revision: 1038684
- Fix nextcloud URL

* Sun Jun 19 2016 neoclust <neoclust> 9.0.50-1.mga6
+ Revision: 1036847
- imported package nextcloud