From 83629d3344226b562f7448a2e343fc198ed267c0e1ac00c8b0c896586d6aaa36 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 20 Aug 2019 10:24:25 +0000 Subject: [PATCH] Accepting request 724711 from home:WernerFink:branches:Printing - Use update-alternatives to get the real ghostscript binary from /usr/bin/gs to /usr/bin/gs.bin and allow the gswrap package to use this with ist wrapper script - Use update-alternatives to get the real ghostscript binary from /usr/bin/gs to /usr/bin/gs.bin and allow the gswrap package to use this with ist wrapper script OBS-URL: https://build.opensuse.org/request/show/724711 OBS-URL: https://build.opensuse.org/package/show/Printing/ghostscript?expand=0&rev=115 --- ghostscript-mini.changes | 7 +++++++ ghostscript-mini.spec | 21 ++++++++++++++++++++- ghostscript.changes | 7 +++++++ ghostscript.spec | 21 ++++++++++++++++++++- 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/ghostscript-mini.changes b/ghostscript-mini.changes index acb7ba7..2bca600 100644 --- a/ghostscript-mini.changes +++ b/ghostscript-mini.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Aug 13 12:38:45 UTC 2019 - Dr. Werner Fink + +- Use update-alternatives to get the real ghostscript binary from + /usr/bin/gs to /usr/bin/gs.bin and allow the gswrap package to + use this with ist wrapper script + ------------------------------------------------------------------- Thu Apr 4 14:37:09 CEST 2019 - jsmeix@suse.de diff --git a/ghostscript-mini.spec b/ghostscript-mini.spec index f8f32bd..a055969 100644 --- a/ghostscript-mini.spec +++ b/ghostscript-mini.spec @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -24,12 +24,15 @@ BuildRequires: libpng-devel BuildRequires: libtiff-devel BuildRequires: libtool BuildRequires: pkg-config +BuildRequires: update-alternatives BuildRequires: zlib-devel %if 0%{?suse_version} >= 1500 BuildRequires: apparmor-abstractions BuildRequires: apparmor-rpm-macros Requires: apparmor-abstractions %endif +Requires(post): update-alternatives +Requires(preun): update-alternatives Summary: Minimal Ghostscript for minimal build requirements License: AGPL-3.0-only Group: System/Libraries @@ -321,19 +324,35 @@ set -x install -m 644 catalog.devices $DOCDIR install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/apparmor.d/ghostscript +# Move /usr/bin/gs to /usr/bin/gs.bin to be able to use update-alternatives +install -d %buildroot%{_sysconfdir}/alternatives +mv %{buildroot}%{_bindir}/gs %{buildroot}%{_bindir}/gs.bin +ln -sf %{_bindir}/gs.bin %{buildroot}%{_sysconfdir}/alternatives/gs +ln -sf %{_sysconfdir}/alternatives/gs %{buildroot}%{_bindir}/gs + %post /sbin/ldconfig %if 0%{?suse_version} >= 1500 %apparmor_reload /etc/apparmor.d/ghostscript %endif +%{_sbindir}/update-alternatives \ + --install %{_bindir}/gs gs %{_bindir}/gs.bin 15 %postun -p /sbin/ldconfig +%preun +if test $1 -eq 0 ; then + %{_sbindir}/update-alternatives \ + --remove gs %{_bindir}/gs.bin +fi + %files %defattr(-, root, root) +%ghost %config %{_sysconfdir}/alternatives/gs %{_bindir}/dvipdf %{_bindir}/eps2eps %{_bindir}/gs +%{_bindir}/gs.bin %{_bindir}/gsbj %{_bindir}/gsdj %{_bindir}/gsdj500 diff --git a/ghostscript.changes b/ghostscript.changes index 827ec32..6f562fd 100644 --- a/ghostscript.changes +++ b/ghostscript.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Aug 13 12:38:45 UTC 2019 - Dr. Werner Fink + +- Use update-alternatives to get the real ghostscript binary from + /usr/bin/gs to /usr/bin/gs.bin and allow the gswrap package to + use this with ist wrapper script + ------------------------------------------------------------------- Wed May 8 08:46:43 UTC 2019 - jsegitz@suse.com diff --git a/ghostscript.spec b/ghostscript.spec index e1b4fc8..a486489 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -42,6 +42,7 @@ BuildRequires: libpng-devel BuildRequires: libtiff-devel BuildRequires: libtool BuildRequires: pkg-config +BuildRequires: update-alternatives BuildRequires: xorg-x11-devel BuildRequires: xorg-x11-fonts BuildRequires: zlib-devel @@ -50,6 +51,8 @@ BuildRequires: apparmor-abstractions BuildRequires: apparmor-rpm-macros Requires: apparmor-abstractions %endif +Requires(post): update-alternatives +Requires(preun): update-alternatives Summary: The Ghostscript interpreter for PostScript and PDF License: AGPL-3.0-only Group: System/Libraries @@ -457,19 +460,35 @@ set -x install -m 644 catalog.devices $DOCDIR install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/apparmor.d/ghostscript +# Move /usr/bin/gs to /usr/bin/gs.bin to be able to use update-alternatives +install -d %buildroot%{_sysconfdir}/alternatives +mv %{buildroot}%{_bindir}/gs %{buildroot}%{_bindir}/gs.bin +ln -sf %{_bindir}/gs.bin %{buildroot}%{_sysconfdir}/alternatives/gs +ln -sf %{_sysconfdir}/alternatives/gs %{buildroot}%{_bindir}/gs + %post /sbin/ldconfig %if 0%{?suse_version} >= 1500 %apparmor_reload /etc/apparmor.d/ghostscript %endif +%{_sbindir}/update-alternatives \ + --install %{_bindir}/gs gs %{_bindir}/gs.bin 15 %postun -p /sbin/ldconfig +%preun +if test $1 -eq 0 ; then + %{_sbindir}/update-alternatives \ + --remove gs %{_bindir}/gs.bin +fi + %files %defattr(-, root, root) +%ghost %config %{_sysconfdir}/alternatives/gs %{_bindir}/dvipdf %{_bindir}/eps2eps %{_bindir}/gs +%{_bindir}/gs.bin %{_bindir}/gsbj %{_bindir}/gsdj %{_bindir}/gsdj500