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