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