Only notify if older version is used

OBS-URL: https://build.opensuse.org/package/show/server:mail/mutt?expand=0&rev=205
This commit is contained in:
Dr. Werner Fink 2020-01-28 14:24:38 +00:00 committed by Git OBS Bridge
parent 7060731913
commit 97ec7e1a9b
2 changed files with 26 additions and 7 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jan 28 13:42:02 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Add version check, that is if installed mutt version does not
fir the installing version then do notify message
-------------------------------------------------------------------
Tue Jan 28 10:13:24 UTC 2020 - Dr. Werner Fink <werner@suse.de>

View File

@ -61,8 +61,11 @@ BuildRequires: update-desktop-files
%endif
BuildRequires: w3m
URL: http://www.mutt.org
Requires(post): %install_info_prereq
Requires(preun): %install_info_prereq
Requires(postun): /usr/bin/rm
Requires(post): /usr/bin/mkdir
Requires(post): /usr/bin/cat
Requires(pre): /usr/bin/zcat
Requires(pre): /usr/bin/grep
Recommends: hunspell
Provides: muttssl
Obsoletes: muttssl
@ -124,6 +127,8 @@ enhancements.
Summary: Additional Documentation about Mutt
Group: Documentation/Other
Requires: %{name} = %{version}
Requires(post): %install_info_prereq
Requires(preun): %install_info_prereq
Recommends: perl(Expect)
Provides: %{name}:%{_docdir}/%name/COPYRIGHT
BuildArch: noarch
@ -272,29 +277,38 @@ install -D -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/skel/.muttrc
install -D -m 644 %{SOURCE9} %{buildroot}%{_datadir}/%name/mailcap
rm -vf %{buildroot}%{_docdir}/%name/manual.txt
install -D -m 644 doc/manual.txt.gz %{buildroot}%{_docdir}/%name/
%if 0%{?suse_version}
%suse_update_desktop_file mutt
%endif
%if 0%{?suse_version} > 1130
%pre
if test $1 -gt 1 -a -e %{_docdir}/%name/manual.txt.gz
then
zcat %{_docdir}/%name/manual.txt.gz | grep -F 'version %{version}' > /run/mutt-version
fi
%post
%mime_database_post
mkdir -p %{_localstatedir}/adm/update-messages
cat > %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-notify <<-'EOF'
if test -f /run/mutt-version -a ! -s /run/mutt-version
then
mkdir -p %{_localstatedir}/adm/update-messages
cat > %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-notify <<-'EOF'
With %{name}-%{version} some variables and the behaviour changes:
$send_multipart_alternative changes to run in batch mode on ask-yes.
$write_bcc changes to default off
EOF
fi
%postun
%mime_database_postun
rm -f %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-notify
%post doc
%install_info --info-dir=%{_infodir} "%{_infodir}/mutt.info.gz"
%preun doc
%install_info_delete --info-dir=%{_infodir} "%{_infodir}/mutt.info.gz"
%endif
%files
%defattr(-,root,root)
@ -317,7 +331,6 @@ cat > %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-notify
%{_datadir}/mutt/mailcap
%dir %doc %{_docdir}/%name/
%doc %{_docdir}/%name/manual.txt.gz
%ghost %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-notify
%files doc
%defattr(-,root,root)