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