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