1 |
%define version 24.0.2 |
2 |
%define release 2 |
3 |
|
4 |
%define apache_serverroot /usr/share |
5 |
%define apache_confdir /etc/httpd/conf.d |
6 |
%define nc_dir %{apache_serverroot}/nextcloud-src |
7 |
%define nc_config_dir %{nc_dir}/config |
8 |
%define nc_data_dir %{nc_dir}/data |
9 |
|
10 |
%define nc_user www |
11 |
%define nc_group www |
12 |
|
13 |
# Turn off the brp-python-bytecompile script |
14 |
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') |
15 |
|
16 |
|
17 |
Summary: Nextcloud package |
18 |
Name: nextcloud |
19 |
Version: %{version} |
20 |
Release: %{release}%{?dist} |
21 |
License: GPL |
22 |
Source: https://download.nextcloud.com/server/releases/nextcloud-%{version}.tar.bz2 |
23 |
Source1: nextcloud.conf |
24 |
BuildArch: noarch |
25 |
URL: https://nextcloud.com/ |
26 |
|
27 |
BuildRequires: httpd |
28 |
|
29 |
Requires: httpd |
30 |
# Required php packages |
31 |
Requires: php74 |
32 |
Requires: php74-php-fpm |
33 |
Requires: php74-php-gd |
34 |
Requires: php74-php-pdo |
35 |
Requires: php74-php-mbstring |
36 |
Requires: php74-php-pecl-zip |
37 |
Requires: php74-php-imagick |
38 |
|
39 |
# Recommended php packages |
40 |
Requires: php74-php-intl |
41 |
Requires: php74-php-mcrypt |
42 |
|
43 |
# Required php packages for specific apps |
44 |
Requires: php74-php-ldap |
45 |
|
46 |
# Required php packages for MariaDB |
47 |
Requires: php74-php-mysqlnd |
48 |
#rh-php71-php-pdo_mysql |
49 |
|
50 |
# Conflicts: nextcloud < 15 |
51 |
|
52 |
%description |
53 |
Nextcloud files and configuration. |
54 |
|
55 |
This package installs as follows: |
56 |
nc_dir: %{nc_dir} |
57 |
nc_data_dir: %{nc_data_dir} |
58 |
nc_config_dir: %{nc_config_dir} |
59 |
|
60 |
|
61 |
%package src |
62 |
Summary: Webtatic Repository |
63 |
%description src |
64 |
Nextcloud files and configuration. |
65 |
|
66 |
This package installs as follows: |
67 |
nc_dir: %{nc_dir} |
68 |
nc_data_dir: %{nc_data_dir} |
69 |
nc_config_dir: %{nc_config_dir} |
70 |
|
71 |
|
72 |
|
73 |
%pre |
74 |
# true if $1 is greater than or equal $2 |
75 |
verlte() { |
76 |
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] |
77 |
} |
78 |
|
79 |
verlt() { |
80 |
[ "$1" = "$2" ] && return 1 || verlte $1 $2 |
81 |
} |
82 |
# if there is already an installed version |
83 |
if [ -f /usr/share/nextcloud/version.php ] |
84 |
then |
85 |
echo "version.php found, already installed" |
86 |
# get version number |
87 |
installedver=`php -r 'require("/usr/share/nextcloud/version.php"); print "$OC_VersionString";'`; |
88 |
majvers=`echo %{version} | cut -d. -f1` |
89 |
majcurvers=`echo $installedver | cut -d. -f1` |
90 |
# we should fail with exit 1 if |
91 |
# installed version > rpm version |
92 |
if ( verlte %{version} $installedver ) |
93 |
then |
94 |
echo "Installed version has $installedver been upgraded and is most recent than this rpm %{version} version" |
95 |
# echo "backup current install to /usr/share/nextcloud_back" |
96 |
# mkdir /usr/share/nextcloud_back |
97 |
# rsync -ar /usr/share/nextcloud/ /usr/share/nextcloud_back |
98 |
exit 1 |
99 |
elif [ $(($majvers-1)) -gt $majcurvers ] |
100 |
then # installed version < rpm version -1 |
101 |
echo "can not upgrade from $installedver to %{version}, please do a manual or web update with intermediate version" |
102 |
# echo "backup current install to /usr/share/nextcloud_back" |
103 |
# mkdir /usr/share/nextcloud_back |
104 |
# rsync -ar /usr/share/nextcloud/ /usr/share/nextcloud_back |
105 |
exit 1 |
106 |
fi |
107 |
fi |
108 |
|
109 |
%postun |
110 |
# true if $1 is greater than or equal $2 |
111 |
verlte() { |
112 |
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] |
113 |
} |
114 |
|
115 |
verlt() { |
116 |
[ "$1" = "$2" ] && return 1 || verlte $1 $2 |
117 |
} |
118 |
|
119 |
if [ $1 == 1 ]; then |
120 |
# if there is already an installed version |
121 |
if [ -f /usr/share/nextcloud/version.php ] |
122 |
then |
123 |
# echo "version.php found, already installed" |
124 |
# get version number |
125 |
installedver=`php -r 'require("/usr/share/nextcloud/version.php"); print "$OC_VersionString";'`; |
126 |
majvers=`echo %{version} | cut -d. -f1` |
127 |
majcurvers=`echo $installedver | cut -d. -f1` |
128 |
# echo "and the version is $installedver" |
129 |
# we should fail with exit 1 if |
130 |
# installed version > rpm version |
131 |
if ( verlte %{version} $installedver ) |
132 |
then |
133 |
# echo "reverting content" |
134 |
# rsync -ar /usr/share/nextcloud_back/ /usr/share/nextcloud_back |
135 |
# rm -rf /usr/share/nextcloud_back |
136 |
exit 0 |
137 |
elif [ $(($majvers-1)) -gt $majcurvers ] |
138 |
then # installed version < rpm version -1 |
139 |
# echo "reverting content" |
140 |
# rsync -ar /usr/share/nextcloud_back/ /usr/share/nextcloud_back |
141 |
# rm -rf /usr/share/nextcloud_back |
142 |
exit 0 |
143 |
fi |
144 |
fi |
145 |
fi |
146 |
|
147 |
%install |
148 |
rm -rf %{buildroot} |
149 |
mkdir -p %{buildroot}/%{nc_data_dir} |
150 |
mkdir -p %{buildroot}/usr/share/nextcloud-src |
151 |
tar xf %{SOURCE0} -C %{buildroot}/usr/share/nextcloud-src --strip-components 1 |
152 |
#mv %{buildroot}/usr/share/nextcloud %{buildroot}/usr/share/nextcloud-src |
153 |
|
154 |
mkdir -p %{buildroot}/%{nc_dir} |
155 |
mkdir -p %{buildroot}/%{nc_dir}/etc |
156 |
mkdir -p %{buildroot}/%{nc_data_dir} |
157 |
mkdir -p %{buildroot}/%{nc_config_dir} |
158 |
# mkdir -p %{buildroot}/%{nc_dir}/assets |
159 |
mkdir -p %{buildroot}/%{nc_dir}/updater |
160 |
|
161 |
mkdir -p %{buildroot}/etc/httpd/conf.d |
162 |
cp %{SOURCE1} %{buildroot}/etc/httpd/conf.d |
163 |
|
164 |
|
165 |
%files src |
166 |
%defattr(0640,root,%{nc_group},0750) |
167 |
%dir %attr(0775,root,%{nc_group}) %{nc_dir} |
168 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/occ |
169 |
%attr(0750,%{nc_user},%{nc_group}) %{nc_dir}/apps |
170 |
# %attr(0750,%{nc_user},%{nc_group}) %{nc_dir}/assets |
171 |
%attr(0750,%{nc_user},%{nc_group}) %{nc_dir}/updater |
172 |
%attr(0775,%{nc_user},%{nc_group}) %{nc_data_dir} |
173 |
%attr(0775,%{nc_user},%{nc_group}) %{nc_config_dir} |
174 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/lib |
175 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/ocm-provider |
176 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/core |
177 |
#%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/settings |
178 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/3rdparty |
179 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/resources |
180 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/themes |
181 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/ocs* |
182 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/*.php |
183 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/AUTHORS |
184 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/COPYING |
185 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/index.html |
186 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/robots.txt |
187 |
%attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/.htaccess |
188 |
%attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/dist |
189 |
|
190 |
%config(noreplace) %attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/.user.ini |
191 |
%config(noreplace) %attr(0644,root,root) /etc/httpd/conf.d/nextcloud.conf |
192 |
|
193 |
%defattr(0644,%{nc_user},%{nc_group},0755) |
194 |
|
195 |
|
196 |
%changelog |
197 |
* Fri Jul 08 2022 Jean-Philippe Pialasse <tests@pialasse.com> 24.0.2-2.sme |
198 |
- update to release 24.0.2 |
199 |
- make rpm a -src to avoid conflict between webupdates and rpm |
200 |
|
201 |
* Sun Nov 08 2020 Jean-Philipe Pialasse <tests@pialasse.com> 20.0.1-2.sme |
202 |
- first import in SME10 [SME: 11086] |
203 |
- update to release 20.0.1 |
204 |
|
205 |
* Sun Dec 15 2019 Jean-Philipe Pialasse <tests@pialasse.com> 17.0.1-1.sme |
206 |
- update to release 17.0.1 |
207 |
|
208 |
* Sun Sep 08 2019 Jean-Philipe Pialasse <tests@pialasse.com> 16.0.4-1.sme |
209 |
- Update to release 16.0.4 [SME: 10803] |
210 |
|
211 |
* Wed Mar 06 2019 Jean-Philipe Pialasse <tests@pialasse.com> 15.0.0-6.sme |
212 |
- fix typo in postun script [SME: 10747] |
213 |
|
214 |
* Tue Jan 08 2019 Jean-Philipe Pialasse <tests@pialasse.com> 15.0.0-5.sme |
215 |
- remove conflicts nextcloud <15 to allow people to use the rpm update if they are |
216 |
with manual updated version 14 with rpm version 13 [SME: 10696] |
217 |
|
218 |
* Mon Jan 07 2019 Jean-Philipe Pialasse <tests@pialasse.com> 15.0.0-4.sme |
219 |
- prevent rpm to upgrade if webupdate has been used [SME: 10670] |
220 |
and rpm version is < to on disk version |
221 |
or if rppm version is more than one major release greater |
222 |
|
223 |
* Fri Dec 21 2018 Jean-Philipe Pialasse <tests@pialasse.com> 15.0.0-3.sme |
224 |
- Update to release 15.0.0 [SME: 10669] |
225 |
|
226 |
* Wed Dec 19 2018 Jean-Philipe Pialasse <tests@pialasse.com> 13.0.1-5.sme |
227 |
- fix failure to update [SME: 10596] |
228 |
remove assets folder before 13.0.4 update |
229 |
|
230 |
* Sat Apr 07 2018 Jean-Philipe Pialasse <tests@pialasse.com> 13.0.1-4.sme |
231 |
- missing dependency for php71-php-pecl-zip [SME: 10554] |
232 |
|
233 |
* Wed Mar 28 2018 Jean-Philipe Pialasse <tests@pialasse.com> 13.0.1-3.sme |
234 |
- import for SME9 using remi scl |
235 |
|
236 |
* Mon Mar 19 2018 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 13.0.1-1 |
237 |
- Update to release 13.0.1 |
238 |
|
239 |
* Tue Mar 06 2018 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 13.0.0-1 |
240 |
- Update to release 13.0.0 |
241 |
|
242 |
* Thu Jan 25 2018 Alessandro Polidori <alessandro.polidori@nethesis.it> - 12.0.5-1 |
243 |
- Update to release 12.0.5 |
244 |
|
245 |
* Mon Jan 15 2018 Alessandro Polidori <alessandro.polidori@nethesis.it> - 12.0.4-2 |
246 |
- Spec: remove "config" sign from .htaccess |
247 |
|
248 |
* Thu Dec 14 2017 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 12.0.4-1 |
249 |
- Update to release 12.0.4 |
250 |
|
251 |
* Wed Sep 27 2017 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 12.0.3 |
252 |
- Update to release 12.0.3 |
253 |
|
254 |
* Tue Aug 29 2017 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 12.0.2-2 |
255 |
- Avoid security warnings on python compiled files |
256 |
|
257 |
* Wed Aug 23 2017 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 12.0.2 |
258 |
- Update to release 12.0.2 |
259 |
|
260 |
* Wed May 24 2017 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 12.0.0 |
261 |
- Update to release 12.0.0 |
262 |
- Fix spec warnings - Thanks to @mbevc1 |
263 |
|
264 |
* Wed May 17 2017 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 11.0.3-2 |
265 |
- Fix WebDAV authentication - Thanks to Davide Principi |
266 |
|
267 |
* Wed May 17 2017 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 11.0.3 |
268 |
- Update to release 11.0.3 |
269 |
|
270 |
* Wed Mar 15 2017 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 11.0.2 |
271 |
- Update to release 11.0.2 |
272 |
- Move installation inside /usr/share/nextcloud |
273 |
- Switch to php-fpm |
274 |
|
275 |
* Thu Dec 15 2016 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 10.0.2 |
276 |
- Bump release: 10.0.2 |
277 |
|
278 |
* Mon Aug 01 2016 Giacomo Sanchietti <giacomo.sanchietti@nethesis.it> - 9.0.53-2 |
279 |
- First Nextcloud release - NethServer/dev#5055 |
280 |
|