1 |
%define version 12.0.3 |
2 |
%define rel 2 |
3 |
%define prerel %{nil} |
4 |
|
5 |
%if "%{prerel}" != "%{nil}" |
6 |
%define lc_prerel %(echo %{prerel} | tr "A-Z" "a-z") |
7 |
%define release %mkrel 1.%{lc_prerel}.%{rel} |
8 |
%else |
9 |
%define release %mkrel %{rel} |
10 |
%endif |
11 |
|
12 |
# exclude PHP dependencies as long as their usage is not proven |
13 |
%define __requires_exclude_from ^%{_datadir}/.*$ |
14 |
%define __jar_repack %{nil} |
15 |
|
16 |
Summary: Open personal cloud |
17 |
Name: nextcloud |
18 |
Version: %{version} |
19 |
Release: %{release} |
20 |
License: AGPLv3 |
21 |
Group: Networking/WWW |
22 |
Url: http://nextcloud.com |
23 |
Source0: https://download.nextcloud.com/server/releases/%{name}-%{version}%{?prerel}.tar.bz2 |
24 |
Source1: %{name}-httpd.conf |
25 |
Source2: %{name}-httpd.inc |
26 |
Source4: %{name}-mysql.txt |
27 |
Source5: %{name}-postgresql.txt |
28 |
Source7: %{name}-config.php |
29 |
# Stop OC from trying to do stuff to .htaccess files. Just calm down, OC. |
30 |
# Distributors are on the case. |
31 |
Patch1: %{name}-12.0.2-dont_update_htacess.patch |
32 |
# Disable the integrity checking whilst a better way to deal with it is found |
33 |
Patch5: %{name}-9.1.0-default_integrity_check_disabled.patch |
34 |
# Direct the admin to the correct cli command for upgrades |
35 |
Patch9: %{name}-12.0.2-correct-cli-upgrade.patch |
36 |
Requires: apache-mod_php |
37 |
Requires: php-curl |
38 |
Requires: php-dom |
39 |
Requires: php-exif |
40 |
Requires: php-fileinfo |
41 |
Requires: php-gd |
42 |
Requires: php-iconv |
43 |
Requires: php-json |
44 |
Requires: php-ldap |
45 |
Requires: php-mbstring |
46 |
Requires: php-openssl |
47 |
Requires: php-pcre |
48 |
Requires: php-pdo |
49 |
Requires: php-session |
50 |
Requires: php-simplexml |
51 |
Requires: php-xmlwriter |
52 |
Requires: php-zip |
53 |
Requires: php-filter |
54 |
Requires: %{name}-database = %{version}-%{release} |
55 |
BuildArch: noarch |
56 |
|
57 |
%description |
58 |
A personal cloud server which runs on you personal server |
59 |
and enables accessing your data from everywhere and sharing |
60 |
with other people. |
61 |
|
62 |
%package mysql |
63 |
Summary: MySQL database support for NextCloud |
64 |
Provides: %{name}-database = %{version}-%{release} |
65 |
Requires: %{name} = %{version}-%{release} |
66 |
# From getSupportedDatabases, mysql => pdo, mysql |
67 |
Requires: php-pdo_mysql |
68 |
|
69 |
%description mysql |
70 |
This package ensures the necessary dependencies are in place for NextCloud to |
71 |
work with MySQL / MariaDB databases. It does not require a MySQL / MariaDB |
72 |
server to be installed, as you may well wish to use a remote database |
73 |
server. |
74 |
If you want the database to be on the same system as NextCloud itself, you must |
75 |
also install and enable a MySQL / MariaDB server package. See README.mysql for |
76 |
more details. |
77 |
|
78 |
%package postgresql |
79 |
Summary: PostgreSQL database support for NextCloud |
80 |
Provides: %{name}-database = %{version}-%{release} |
81 |
Requires: %{name} = %{version}-%{release} |
82 |
# From getSupportedDatabases, pgsql => function, pg_connect |
83 |
Requires: php-pgsql |
84 |
|
85 |
%description postgresql |
86 |
This package ensures the necessary dependencies are in place for NextCloud to |
87 |
work with a PostgreSQL database. It does not require the PostgreSQL server |
88 |
package to be installed, as you may well wish to use a remote database |
89 |
server. |
90 |
If you want the database to be on the same system as NextCloud itself, you must |
91 |
also install and enable the PostgreSQL server package. See README.postgresql |
92 |
for more details. |
93 |
|
94 |
%package sqlite |
95 |
Summary: SQLite 3 database support for NextCloud |
96 |
Provides: %{name}-database = %{version}-%{release} |
97 |
Requires: %{name} = %{version}-%{release} |
98 |
# From getSupportedDatabases, pgsql => class, SQLite3 |
99 |
Requires: php-sqlite3 php-pcre |
100 |
|
101 |
%description sqlite |
102 |
This package ensures the necessary dependencies are in place for NextCloud to |
103 |
work with an SQLite 3 database stored on the local system. |
104 |
|
105 |
%prep |
106 |
%setup -q -n %{name} |
107 |
%autopatch -p 1 |
108 |
cp %{SOURCE4} README.mysql |
109 |
cp %{SOURCE5} README.postgresql |
110 |
|
111 |
# drop upstream update notification app |
112 |
rm -rf apps/updatenotification |
113 |
# also remove the actual updater |
114 |
rm -rf updater |
115 |
|
116 |
%install |
117 |
install -d -m 755 %{buildroot}%{_datadir}/%{name} |
118 |
# create nextcloud datadir |
119 |
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}/data |
120 |
# create writable app dir for appstore |
121 |
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}/apps |
122 |
# create nextcloud sysconfdir |
123 |
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name} |
124 |
|
125 |
# install content |
126 |
for d in $(find . -mindepth 1 -maxdepth 1 -type d | grep -v config); do |
127 |
cp -a "$d" %{buildroot}%{_datadir}/%{name} |
128 |
done |
129 |
|
130 |
for f in {*.php,*.xml,*.html,occ,robots.txt}; do |
131 |
install -p -m 644 "$f" %{buildroot}%{_datadir}/%{name} |
132 |
done |
133 |
|
134 |
# symlink config dir |
135 |
ln -sf %{_sysconfdir}/%{name} %{buildroot}%{_datadir}/%{name}/config |
136 |
|
137 |
# nextcloud looks for ca-bundle.crt in config dir |
138 |
ln -sf %{_sysconfdir}/pki/tls/certs/ca-bundle.crt %{buildroot}%{_sysconfdir}/%{name}/ca-bundle.crt |
139 |
|
140 |
# set default config |
141 |
install -p -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/%{name}/config.php |
142 |
|
143 |
install -D -m 644 %{SOURCE1} %{buildroot}%{webappconfdir}/%{name}.conf |
144 |
install -D -m 644 %{SOURCE2} %{buildroot}%{webappconfdir}/%{name}.inc |
145 |
|
146 |
cat > %{buildroot}%{_datadir}/%{name}/.htaccess <<EOF |
147 |
# Version: %{version} |
148 |
EOF |
149 |
|
150 |
install -d -m 755 %{buildroot}%{_sysconfdir}/cron.d |
151 |
cat > %{buildroot}%{_sysconfdir}/cron.d/%{name} <<EOF |
152 |
# Run cron from to execute task even when no user connected |
153 |
*/15 * * * * apache /usr/bin/php -f /usr/share/nextcloud/cron.php |
154 |
EOF |
155 |
|
156 |
%pre |
157 |
# on update from previous release, move data directory from |
158 |
# %{_localstatedir}/lib/%{name} to %{_localstatedir}/lib/%{name}/data |
159 |
if [ $1 -gt 1 ] ; then |
160 |
if [ -d %{_localstatedir}/lib/%{name}/ -a ! -d %{_localstatedir}/lib/%{name}/data ]; then |
161 |
mv %{_localstatedir}/lib/%{name} %{_localstatedir}/lib/%{name}.tmp |
162 |
mkdir %{_localstatedir}/lib/%{name} |
163 |
mv %{_localstatedir}/lib/%{name}.tmp %{_localstatedir}/lib/%{name}/data |
164 |
fi |
165 |
fi |
166 |
|
167 |
===================================================================== |
168 |
cat > README.urpmi <<EOF |
169 |
|
170 |
Starting with Nextcloud version 12, Mageia package puts the apps dir |
171 |
in a dedicated data folder. This change cannot be automated when |
172 |
upgrading from previous version, so you'll have to edit by yourself |
173 |
the config file using /etc/nextcloud/config.php.rpmnew. |
174 |
|
175 |
EOF |
176 |
===================================================================== |
177 |
|
178 |
%files |
179 |
%doc AUTHORS config/config.sample.php README.urpmi |
180 |
|
181 |
%dir %attr(-,apache,apache) %{_sysconfdir}/%{name} |
182 |
%config(noreplace) %attr(0600,apache,apache) %{_sysconfdir}/%{name}/config.php |
183 |
%{_sysconfdir}/%{name}/ca-bundle.crt |
184 |
|
185 |
%{_datadir}/%{name} |
186 |
|
187 |
%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name} |
188 |
%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name}/apps |
189 |
%dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/data |
190 |
|
191 |
%config(noreplace) %{webappconfdir}/nextcloud.conf |
192 |
%config(noreplace) %{webappconfdir}/nextcloud.inc |
193 |
%config(noreplace) %{_sysconfdir}/cron.d/%{name} |
194 |
|
195 |
%files mysql |
196 |
%doc README.mysql |
197 |
|
198 |
%files postgresql |
199 |
%doc README.postgresql |
200 |
|
201 |
%files sqlite |