From f366a261751ef3f88a61394e32e9c6560c7b42e6 Mon Sep 17 00:00:00 2001 From: Marcus A. Romer Date: Jan 14 2020 19:51:10 +0000 Subject: Fix update from 4.8.0-1 and earlier In 4.8.0-2 the method to unbundle MathJax was changed from a simple symlink handled by the %posttrans and %preun scriptlets to the one implemented by Calibre itself. This made updating from 4.8.0-1 and earlier impossible. Renaming the MathJax folder and letting the scriptlets create a symlink again is ugly but fixes this issue. --- diff --git a/calibre.spec b/calibre.spec index f22f194..a83fbfd 100644 --- a/calibre.spec +++ b/calibre.spec @@ -6,7 +6,7 @@ Name: calibre Version: 4.8.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: E-book converter and library manager License: GPLv3 URL: https://calibre-ebook.com/ @@ -332,6 +332,10 @@ ln -s --relative \ rm -f %{buildroot}/%{_datadir}/metainfo/calibre-ebook-edit.appdata.xml rm -f %{buildroot}/%{_datadir}/metainfo/calibre-ebook-viewer.appdata.xml +# rename MathJax folder to allow upgrade from 4.8.0-1 and earlier, which +# relied on a symlink handled by the %%preun and %%posttrans scriptlets +mv %{buildroot}%{_datadir}/calibre/mathjax %{buildroot}%{_datadir}/calibre/mathjax-fedora + %check # ignore tests on 32 bit arches for now as there's a pdf issue CALIBRE_PY3_PORT=1 python3 setup.py test \ @@ -341,6 +345,14 @@ CALIBRE_PY3_PORT=1 python3 setup.py test \ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/calibre-gui.appdata.xml +%preun +if [ -L %{_datadir}/calibre/mathjax ]; then + rm -f %{_datadir}/calibre/mathjax +fi + +%posttrans +ln -s -r %{_datadir}/calibre/mathjax-fedora %{_datadir}/calibre/mathjax + %files %license LICENSE %doc Changelog.yaml COPYRIGHT README.md @@ -378,6 +390,10 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/calibre-g %{_datadir}/metainfo/*.appdata.xml %changelog +* Tue Jan 14 2020 Marcus A. Romer - 4.8.0-3 +- Add workaround to allow upgrade from 4.8.0-1 and earlier + (required by the change in method to unbundle MathJax). + * Sun Jan 12 2020 Marcus A. Romer - 4.8.0-2 - Update dependencies. - Remove some obsolete packaging workarounds.