1 |
%define version 15.0.0 |
%define version 15.0.0 |
2 |
%define release 1 |
%define release 4 |
3 |
|
|
4 |
%define apache_serverroot /usr/share |
%define apache_serverroot /usr/share |
5 |
%define apache_confdir /etc/httpd/conf.d |
%define apache_confdir /etc/httpd/conf.d |
47 |
Requires: php71-php-mysqlnd |
Requires: php71-php-mysqlnd |
48 |
#rh-php71-php-pdo_mysql |
#rh-php71-php-pdo_mysql |
49 |
|
|
50 |
|
Conflicts: nextcloud < 15 |
51 |
|
|
52 |
%description |
%description |
53 |
Nextcloud files and configuration. |
Nextcloud files and configuration. |
57 |
nc_data_dir: %{nc_data_dir} |
nc_data_dir: %{nc_data_dir} |
58 |
nc_config_dir: %{nc_config_dir} |
nc_config_dir: %{nc_config_dir} |
59 |
|
|
60 |
|
%pre |
61 |
|
# true if $1 is greater than or equal $2 |
62 |
|
verlte() { |
63 |
|
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] |
64 |
|
} |
65 |
|
|
66 |
|
verlt() { |
67 |
|
[ "$1" = "$2" ] && return 1 || verlte $1 $2 |
68 |
|
} |
69 |
|
# if there is already an installed version |
70 |
|
if [ -f /usr/share/nextcloud/version.php ] |
71 |
|
then |
72 |
|
echo "version.php found, already installed" |
73 |
|
# get version number |
74 |
|
installedver=`php -r 'require("/usr/share/nextcloud/version.php"); print "$OC_VersionString";'`; |
75 |
|
majvers=`echo %{version} | cut -d. -f1` |
76 |
|
majcurvers=`echo $installedver | cut -d. -f1` |
77 |
|
# we should fail with exit 1 if |
78 |
|
# installed version > rpm version |
79 |
|
if ( verlte %{version} $installedver ) |
80 |
|
then |
81 |
|
echo "Installed version has $installedver been upgraded and is most recent than this rpm %{version} version" |
82 |
|
# echo "backup current install to /usr/share/nextcloud_back" |
83 |
|
# mkdir /usr/share/nextcloud_back |
84 |
|
# rsync -ar /usr/share/nextcloud/ /usr/share/nextcloud_back |
85 |
|
exit 1 |
86 |
|
elif [ $(($majvers-1)) -gt $majcurvers ] |
87 |
|
then # installed version < rpm version -1 |
88 |
|
echo "can not upgrade from $installedver to %{version}, please do a manual or web update with intermediate version" |
89 |
|
# echo "backup current install to /usr/share/nextcloud_back" |
90 |
|
# mkdir /usr/share/nextcloud_back |
91 |
|
# rsync -ar /usr/share/nextcloud/ /usr/share/nextcloud_back |
92 |
|
exit 1 |
93 |
|
fi |
94 |
|
fi |
95 |
|
|
96 |
|
%postun |
97 |
|
# true if $1 is greater than or equal $2 |
98 |
|
verlte() { |
99 |
|
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] |
100 |
|
} |
101 |
|
|
102 |
|
verlt() { |
103 |
|
[ "$1" = "$2" ] && return 1 || verlte $1 $2 |
104 |
|
} |
105 |
|
|
106 |
|
if [ $1 == 1 ]]; then |
107 |
|
# if there is already an installed version |
108 |
|
if [ -f /usr/share/nextcloud/version.php ] |
109 |
|
then |
110 |
|
# echo "version.php found, already installed" |
111 |
|
# get version number |
112 |
|
installedver=`php -r 'require("/usr/share/nextcloud/version.php"); print "$OC_VersionString";'`; |
113 |
|
majvers=`echo %{version} | cut -d. -f1` |
114 |
|
majcurvers=`echo $installedver | cut -d. -f1` |
115 |
|
# echo "and the version is $installedver" |
116 |
|
# we should fail with exit 1 if |
117 |
|
# installed version > rpm version |
118 |
|
if ( verlte %{version} $installedver ) |
119 |
|
then |
120 |
|
# echo "reverting content" |
121 |
|
# rsync -ar /usr/share/nextcloud_back/ /usr/share/nextcloud_back |
122 |
|
# rm -rf /usr/share/nextcloud_back |
123 |
|
exit 0 |
124 |
|
elif [ $(($majvers-1)) -gt $majcurvers ] |
125 |
|
then # installed version < rpm version -1 |
126 |
|
# echo "reverting content" |
127 |
|
# rsync -ar /usr/share/nextcloud_back/ /usr/share/nextcloud_back |
128 |
|
# rm -rf /usr/share/nextcloud_back |
129 |
|
exit 0 |
130 |
|
fi |
131 |
|
fi |
132 |
|
fi |
133 |
|
|
134 |
%install |
%install |
135 |
rm -rf %{buildroot} |
rm -rf %{buildroot} |
158 |
%attr(0775,%{nc_user},%{nc_group}) %{nc_data_dir} |
%attr(0775,%{nc_user},%{nc_group}) %{nc_data_dir} |
159 |
%attr(0775,%{nc_user},%{nc_group}) %{nc_config_dir} |
%attr(0775,%{nc_user},%{nc_group}) %{nc_config_dir} |
160 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/lib |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/lib |
161 |
|
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/ocm-provider |
162 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/core |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/core |
163 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/settings |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/settings |
164 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/3rdparty |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/3rdparty |
167 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/ocs* |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/ocs* |
168 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/*.php |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/*.php |
169 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/AUTHORS |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/AUTHORS |
170 |
|
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/COPYING |
171 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/index.html |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/index.html |
172 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/robots.txt |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/robots.txt |
173 |
%attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/.htaccess |
%attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/.htaccess |
179 |
|
|
180 |
|
|
181 |
%changelog |
%changelog |
182 |
* Fri Dec 21 2018 Jean-Philipe Pialasse <tests@pialasse.com> 15.0.0-1.sme |
* Mon Jan 07 2019 Jean-Philipe Pialasse <tests@pialasse.com> 15.0.0-4.sme |
183 |
|
- prevent rpm to upgrade if webupdate has been used [SME: 10670] |
184 |
|
and rpm version is < to on disk version |
185 |
|
or if rppm version is more than one major release greater |
186 |
|
|
187 |
|
* Fri Dec 21 2018 Jean-Philipe Pialasse <tests@pialasse.com> 15.0.0-3.sme |
188 |
- Update to release 15.0.0 [SME: 10669] |
- Update to release 15.0.0 [SME: 10669] |
189 |
|
|
190 |
* Wed Dec 19 2018 Jean-Philipe Pialasse <tests@pialasse.com> 13.0.1-5.sme |
* Wed Dec 19 2018 Jean-Philipe Pialasse <tests@pialasse.com> 13.0.1-5.sme |