1 |
%define version 24.0.2 |
%define version 24.0.2 |
2 |
%define release 2 |
%define release 3 |
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 |
68 |
nc_data_dir: %{nc_data_dir} |
nc_data_dir: %{nc_data_dir} |
69 |
nc_config_dir: %{nc_config_dir} |
nc_config_dir: %{nc_config_dir} |
70 |
|
|
|
|
|
|
|
|
71 |
%pre |
%pre |
|
# true if $1 is greater than or equal $2 |
|
|
verlte() { |
|
|
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] |
|
|
} |
|
|
|
|
|
verlt() { |
|
|
[ "$1" = "$2" ] && return 1 || verlte $1 $2 |
|
|
} |
|
|
# if there is already an installed version |
|
|
if [ -f /usr/share/nextcloud/version.php ] |
|
|
then |
|
|
echo "version.php found, already installed" |
|
|
# get version number |
|
|
installedver=`php -r 'require("/usr/share/nextcloud/version.php"); print "$OC_VersionString";'`; |
|
|
majvers=`echo %{version} | cut -d. -f1` |
|
|
majcurvers=`echo $installedver | cut -d. -f1` |
|
|
# we should fail with exit 1 if |
|
|
# installed version > rpm version |
|
|
if ( verlte %{version} $installedver ) |
|
|
then |
|
|
echo "Installed version has $installedver been upgraded and is most recent than this rpm %{version} version" |
|
|
# echo "backup current install to /usr/share/nextcloud_back" |
|
|
# mkdir /usr/share/nextcloud_back |
|
|
# rsync -ar /usr/share/nextcloud/ /usr/share/nextcloud_back |
|
|
exit 1 |
|
|
elif [ $(($majvers-1)) -gt $majcurvers ] |
|
|
then # installed version < rpm version -1 |
|
|
echo "can not upgrade from $installedver to %{version}, please do a manual or web update with intermediate version" |
|
|
# echo "backup current install to /usr/share/nextcloud_back" |
|
|
# mkdir /usr/share/nextcloud_back |
|
|
# rsync -ar /usr/share/nextcloud/ /usr/share/nextcloud_back |
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
72 |
|
|
73 |
%postun |
%postun |
|
# true if $1 is greater than or equal $2 |
|
|
verlte() { |
|
|
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] |
|
|
} |
|
|
|
|
|
verlt() { |
|
|
[ "$1" = "$2" ] && return 1 || verlte $1 $2 |
|
|
} |
|
|
|
|
|
if [ $1 == 1 ]; then |
|
|
# if there is already an installed version |
|
|
if [ -f /usr/share/nextcloud/version.php ] |
|
|
then |
|
|
# echo "version.php found, already installed" |
|
|
# get version number |
|
|
installedver=`php -r 'require("/usr/share/nextcloud/version.php"); print "$OC_VersionString";'`; |
|
|
majvers=`echo %{version} | cut -d. -f1` |
|
|
majcurvers=`echo $installedver | cut -d. -f1` |
|
|
# echo "and the version is $installedver" |
|
|
# we should fail with exit 1 if |
|
|
# installed version > rpm version |
|
|
if ( verlte %{version} $installedver ) |
|
|
then |
|
|
# echo "reverting content" |
|
|
# rsync -ar /usr/share/nextcloud_back/ /usr/share/nextcloud_back |
|
|
# rm -rf /usr/share/nextcloud_back |
|
|
exit 0 |
|
|
elif [ $(($majvers-1)) -gt $majcurvers ] |
|
|
then # installed version < rpm version -1 |
|
|
# echo "reverting content" |
|
|
# rsync -ar /usr/share/nextcloud_back/ /usr/share/nextcloud_back |
|
|
# rm -rf /usr/share/nextcloud_back |
|
|
exit 0 |
|
|
fi |
|
|
fi |
|
|
fi |
|
74 |
|
|
75 |
%install |
%install |
76 |
rm -rf %{buildroot} |
rm -rf %{buildroot} |
113 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/index.html |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/index.html |
114 |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/robots.txt |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/robots.txt |
115 |
%attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/.htaccess |
%attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/.htaccess |
116 |
%attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/dist |
%attr(0755,%{nc_user},%{nc_group}) %{nc_dir}/dist |
117 |
|
|
118 |
%config(noreplace) %attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/.user.ini |
%config(noreplace) %attr(0644,%{nc_user},%{nc_group}) %{nc_dir}/.user.ini |
119 |
%config(noreplace) %attr(0644,root,root) /etc/httpd/conf.d/nextcloud.conf |
%config(noreplace) %attr(0644,root,root) /etc/httpd/conf.d/nextcloud.conf |
122 |
|
|
123 |
|
|
124 |
%changelog |
%changelog |
125 |
|
* Fri Jul 08 2022 Jean-Philippe Pialasse <tests@pialasse.com> 24.0.2-3.sme |
126 |
|
- removing pre and postun scripts |
127 |
|
- fix dist permissions |
128 |
|
|
129 |
* Fri Jul 08 2022 Jean-Philippe Pialasse <tests@pialasse.com> 24.0.2-2.sme |
* Fri Jul 08 2022 Jean-Philippe Pialasse <tests@pialasse.com> 24.0.2-2.sme |
130 |
- update to release 24.0.2 |
- update to release 24.0.2 |
131 |
- make rpm a -src to avoid conflict between webupdates and rpm |
- make rpm a -src to avoid conflict between webupdates and rpm |