forked from pool/ghostscript
WIP: Switch over to libalternatives #1
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Sep 16 08:15:18 UTC 2025 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Switch over to libalternatives for ghostscript to provide a gs
|
||||||
|
variant (bsc#1245896)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Aug 4 07:14:46 UTC 2025 - Johannes Meixner <jsmeix@suse.com>
|
Mon Aug 4 07:14:46 UTC 2025 - Johannes Meixner <jsmeix@suse.com>
|
||||||
|
|
||||||
|
@@ -23,6 +23,11 @@
|
|||||||
%global psuffix %{nil}
|
%global psuffix %{nil}
|
||||||
%bcond_without apparmor
|
%bcond_without apparmor
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
|
%bcond_without libalternatives
|
||||||
|
%else
|
||||||
|
%bcond_with libalternatives
|
||||||
|
%endif
|
||||||
Name: ghostscript%{psuffix}
|
Name: ghostscript%{psuffix}
|
||||||
Version: 10.05.1
|
Version: 10.05.1
|
||||||
Release: 0
|
Release: 0
|
||||||
@@ -62,10 +67,15 @@ BuildRequires: libpng-devel
|
|||||||
BuildRequires: libtiff-devel
|
BuildRequires: libtiff-devel
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
|
%if %{with libalternatives}
|
||||||
|
BuildRequires: alts
|
||||||
|
Requires: alts
|
||||||
|
%else
|
||||||
BuildRequires: update-alternatives
|
BuildRequires: update-alternatives
|
||||||
BuildRequires: zlib-devel
|
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(preun): update-alternatives
|
Requires(preun): update-alternatives
|
||||||
|
%endif
|
||||||
|
BuildRequires: zlib-devel
|
||||||
# Provide the additional RPM Provides of the ghostscript-library package
|
# Provide the additional RPM Provides of the ghostscript-library package
|
||||||
# (ghostscript_x11 is provided by the ghostscript-x11 sub-package, see below).
|
# (ghostscript_x11 is provided by the ghostscript-x11 sub-package, see below).
|
||||||
# The "Provides: ghostscript_any" is there to support "BuildRequires: ghostscript_any"
|
# The "Provides: ghostscript_any" is there to support "BuildRequires: ghostscript_any"
|
||||||
@@ -342,10 +352,20 @@ install -D -m 644 %{SOURCE10} %{buildroot}%{_sysconfdir}/apparmor.d/ghostscript
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Move /usr/bin/gs to /usr/bin/gs.bin to be able to use update-alternatives
|
# 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
|
mv %{buildroot}%{_bindir}/gs %{buildroot}%{_bindir}/gs.bin
|
||||||
|
%if %{with libalternatives}
|
||||||
|
mkdir -p %{buildroot}%{_datadir}/libalternatives/gs
|
||||||
|
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/gs
|
||||||
|
cat > %{buildroot}%{_datadir}/libalternatives/gs/10.conf <<-EOF
|
||||||
|
binary=%{_bindir}/gs.bin
|
||||||
|
man=gs.1
|
||||||
|
group=gs
|
||||||
|
EOF
|
||||||
|
%else
|
||||||
|
install -d %{buildroot}%{_sysconfdir}/alternatives
|
||||||
ln -sf %{_bindir}/gs.bin %{buildroot}%{_sysconfdir}/alternatives/gs
|
ln -sf %{_bindir}/gs.bin %{buildroot}%{_sysconfdir}/alternatives/gs
|
||||||
ln -sf %{_sysconfdir}/alternatives/gs %{buildroot}%{_bindir}/gs
|
ln -sf %{_sysconfdir}/alternatives/gs %{buildroot}%{_bindir}/gs
|
||||||
|
%endif
|
||||||
|
|
||||||
%post
|
%post
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
@@ -354,20 +374,30 @@ ln -sf %{_sysconfdir}/alternatives/gs %{buildroot}%{_bindir}/gs
|
|||||||
%apparmor_reload %{_sysconfdir}/apparmor.d/ghostscript
|
%apparmor_reload %{_sysconfdir}/apparmor.d/ghostscript
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
%if ! %{with libalternatives}
|
||||||
%{_sbindir}/update-alternatives \
|
%{_sbindir}/update-alternatives \
|
||||||
--install %{_bindir}/gs gs %{_bindir}/gs.bin 15
|
--install %{_bindir}/gs gs %{_bindir}/gs.bin 15
|
||||||
|
%endif
|
||||||
|
|
||||||
%postun -p /sbin/ldconfig
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%if ! %{with libalternatives}
|
||||||
%preun
|
%preun
|
||||||
if test $1 -eq 0 ; then
|
if test $1 -eq 0 ; then
|
||||||
%{_sbindir}/update-alternatives \
|
%{_sbindir}/update-alternatives \
|
||||||
--remove gs %{_bindir}/gs.bin
|
--remove gs %{_bindir}/gs.bin
|
||||||
fi
|
fi
|
||||||
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
%if %{with libalternatives}
|
||||||
|
%dir %{_datadir}/libalternatives/
|
||||||
|
%dir %{_datadir}/libalternatives/gs/
|
||||||
|
%{_datadir}/libalternatives/gs/10.conf
|
||||||
|
%else
|
||||||
%ghost %config %{_sysconfdir}/alternatives/gs
|
%ghost %config %{_sysconfdir}/alternatives/gs
|
||||||
|
%endif
|
||||||
%{_bindir}/dvipdf
|
%{_bindir}/dvipdf
|
||||||
%{_bindir}/eps2eps
|
%{_bindir}/eps2eps
|
||||||
%{_bindir}/gs
|
%{_bindir}/gs
|
||||||
|
Reference in New Issue
Block a user