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